System Requirements
Minimum Requirements
.NET 8.0 SDK
Database Server
IDE
Git
Recommended Specifications
- OS: Windows 10/11, macOS 12+, or Linux (Ubuntu 20.04+)
- RAM: 8 GB minimum, 16 GB recommended
- Storage: 2 GB for dependencies and build artifacts
- CPU: 64-bit processor, 2+ cores recommended
Prerequisites Installation
Install .NET 8.0 SDK
8.0.xInstalling on Different Platforms
Installing on Different Platforms
Install Database Server
SQL Server LocalDB (Recommended for Development)
SQL Server LocalDB (Recommended for Development)
SQL Server Express (Windows)
SQL Server Express (Windows)
SQL Server on Linux/macOS (Docker)
SQL Server on Linux/macOS (Docker)
SQLite (Lightweight Alternative)
SQLite (Lightweight Alternative)
Install Development Tools
Visual Studio 2022 (Recommended for Windows)
Visual Studio 2022 (Recommended for Windows)
- ASP.NET and web development
- .NET desktop development
- Data storage and processing (for SQL Server tools)
- ReSharper or CodeMaid
- NUnit Test Adapter
- REST Client or Postman extension
Visual Studio Code (Cross-Platform)
Visual Studio Code (Cross-Platform)
- C# (Microsoft)
- C# Dev Kit (Microsoft)
- NuGet Package Manager
- REST Client
JetBrains Rider (Cross-Platform)
JetBrains Rider (Cross-Platform)
Install Entity Framework Core Tools
Install Git (Optional but Recommended)
Project Setup
Clone or Download the Project
- Download the project ZIP file
- Extract to your desired location
- Open terminal in the extracted folder
Restore NuGet Packages
- ASP.NET Core 8.0 packages
- Entity Framework Core 8.0
- MediatR, AutoMapper, FluentValidation
- Testing frameworks (NUnit, Moq, FluentAssertions)
- All other dependencies
Configuration
Configure JWT Authentication
src/Web/appsettings.json:- Key: Must be at least 32 characters. Use a strong random string.
- ExpireMinutes: Access token lifetime (recommended: 15-60 minutes)
- RefreshTokenExpirationDays: Refresh token lifetime (recommended: 7-30 days)
Configure Security Settings (Optional)
src/Web/appsettings.json:Security Settings Explained
Security Settings Explained
ExpirationDays: How long refresh tokens are validMaxActiveTokensPerUser: Limit concurrent sessions per user
MaxAttemptsPerIp: Login attempts allowed per IPWindowMinutes: Time window for counting attemptsIpBlockDurationMinutes: Temporary block duration
MaxFailedAttempts: Failed logins before account lockoutLockoutMinutes: Account lockout durationResetFailedAttemptsAfterMinutes: When to reset failure counter
EnableAutoBlock: Automatically block abusive IPsAutoBlockAfterAttempts: Attempts before auto-blockAutoBlockDurationHours: Auto-block duration
Use User Secrets for Development (Recommended)
appsettings.json, use User Secrets:Configure Email Service (Optional)
Email Providers
Email Providers
- Brevo (included): Free tier available, easy integration
- SendGrid: 100 emails/day free
- Mailgun: 5,000 emails/month free
- AWS SES: Pay-as-you-go pricing
- Custom SMTP: Use your own mail server
Database Migration
Apply Database Migrations
- Create the
SAPFIAIDbdatabase - Create all tables (AspNetUsers, RefreshTokens, Permissions, etc.)
- Apply initial data seeding
Migration Output Example
Migration Output Example
Verify Database Creation
- Server:
(localdb)\mssqllocaldb - Database:
SAPFIAIDb
- AspNetUsers, AspNetRoles, AspNetUserRoles
- RefreshTokens
- LoginAttempts
- IpBlackLists
- AuditLogs
- Permissions, RolePermissions
Seed Initial Data (Optional)
- Default administrator role
- Basic permissions
- System configuration
Manual Admin User Creation
Manual Admin User Creation
Running the Application
Start the API Server
- Open
SAPFIAI.sln - Press F5 or click the green play button
- Select “Web” profile if prompted
Verify the Application is Running
- Swagger UI: https://localhost:5001/api
- Health Check: https://localhost:5001/health
Production Deployment
Publish the Application
./publish folder.Apply Production Migrations
Program.cs (not recommended for production):Deploy to Hosting Platform
Deploy to Azure App Service
Deploy to Azure App Service
Deploy to Docker
Deploy to Docker
Dockerfile in project root:Deploy to IIS (Windows Server)
Deploy to IIS (Windows Server)
- Install .NET 8.0 Hosting Bundle
- Create IIS Application Pool (.NET CLR Version: No Managed Code)
- Create IIS Website pointing to
./publishfolder - Configure
web.config(auto-generated by publish) - Set Application Pool identity to access SQL Server
- Restart IIS
Troubleshooting
Database Connection Issues
Database Connection Issues
-
Verify SQL Server is running:
-
Test connection string:
- Check firewall rules (for remote SQL Server)
- Enable TCP/IP in SQL Server Configuration Manager
Migration Failures
Migration Failures
dotnet ef database update failsSolutions:-
Verify EF Core tools are installed:
-
Drop and recreate database:
-
Check for migration conflicts:
JWT Token Issues
JWT Token Issues
- Verify JWT key is at least 32 characters
- Check token expiration settings
- Ensure clock synchronization (server time)
- Verify
IssuerandAudiencematch in settings
SSL Certificate Errors in Development
SSL Certificate Errors in Development
Port Already in Use
Port Already in Use
- Change ports in
launchSettings.json - Find and kill the process using the port: