DotNetIntegration

.Net Integration for My Portfolio Website

.NET Integration for My Portfolio Website

Implementation Status

This document outlines the implementation of the ASP.NET Core backend API for the Next.js portfolio website. The integration has been successfully completed and includes the following features:

  1. βœ… ASP.NET Core API with Entity Framework Core

  2. βœ… SQL Server database integration

  3. βœ… JWT authentication for admin features

  4. βœ… RESTful APIs for projects, blog posts, skills, etc.

  5. βœ… Next.js frontend integration using custom hooks and services

  6. βœ… Response caching for improved performance

1. Backend API with ASP.NET Core

The API has been implemented with the following structure:

api/
β”œβ”€β”€ Controllers/      # API controllers for each entity
β”œβ”€β”€ Models/          # Entity models
β”œβ”€β”€ Data/            # Database context
β”œβ”€β”€ DTOs/            # Data transfer objects
└── Migrations/      # EF Core migrations

The following packages have been installed:

Database Structure

The database has been implemented with proper entity relationships and JSON serialization for arrays:

Entity models have been implemented with proper properties:

2. API Controllers

3. Authentication with JWT

4. Integration with Next.js Frontend

Option 1: API Routes Proxy

Update your Next.js API routes to proxy requests to the .NET backend:

5. Frontend Integration with Next.js

The frontend has been updated to communicate directly with the ASP.NET Core API. A service layer and custom React hooks have been implemented for easier consumption:

API Services

Custom Hooks

5. Deployment Options

Azure App Service

Deploy your .NET API to Azure App Service and your Next.js frontend to Vercel:

Docker Compose for Local Development

6. Authentication and Protected Routes

JWT authentication has been implemented for admin features:

Backend Authentication

Frontend Authentication

Protected Admin Routes

7. Integration Status and Next Steps

βœ… Completed:

  • ASP.NET Core API project setup

  • Entity Framework Core and SQL Server integration

  • API controllers for all portfolio entities

  • JWT authentication

  • React hooks for API data fetching

  • Admin components for protected routes

πŸ”œ Next Steps:

  1. Enhance error handling and API resilience

  2. Add automated testing for API endpoints

  3. Implement DevOps pipeline for the .NET backend

  4. Set up production deployment for SQL Server database

  5. Add JWT authentication for admin access

  6. Update Next.js components to integrate with the API

  7. Deploy both applications (Next.js to Vercel, .NET to Azure)

Last updated