Prerequisites
Ensure you have the following installed on your system:- .NET 10.0 SDK - Required for building and running the application
- SQLite - Lightweight database for local development
- Git - For cloning the repository
Verify .NET Installation
Check your .NET SDK version:10.0.x or higher.
Installation Steps
Dependencies
The project includes the following key packages (fromSocial-Media-Activity-Feed.csproj):
- Microsoft.EntityFrameworkCore.Sqlite - Database provider for SQLite
- Microsoft.AspNetCore.Authentication.JwtBearer - JWT authentication middleware
- Microsoft.EntityFrameworkCore.Tools - EF Core command-line tools for migrations
Configuration
JWT Settings
Configure JWT authentication using .NET user secrets for secure credential storage:- Jwt:Issuer - The issuer name for token validation (e.g., “SocialMediaAPI”)
- Jwt:Key - A secure secret key for signing tokens (minimum 32 characters recommended)
Database Connection String
The application is configured to use SQLite with the following connection string (fromProgram.cs):
social.db in your project root directory.
Application Settings
Theappsettings.json file contains logging and host configuration:
JWT settings are intentionally not stored in
appsettings.json for security. Always use user secrets for local development and environment variables or secure vaults for production.Database Setup
Install EF Core Tools
If you haven’t installed Entity Framework Core tools globally:Run Migrations
Create and initialize the database:- Creates the
social.dbSQLite database file - Applies all migrations to create the schema
- Sets up tables for Users, Follows, Posts, Notifications, and more
View Available Migrations
To see all available migrations:Verification
Verify your installation by running the application:Test the API
Check if the API is running:Troubleshooting
Missing JWT Configuration
If you see authentication errors, ensure JWT settings are configured:Database Connection Issues
If the database fails to connect:- Ensure the
social.dbfile has write permissions - Run
dotnet ef database updateto recreate the database - Check for migration errors in the console output
Port Already in Use
If port 5000 or 5001 is already in use, specify a different port:Next Steps
Now that you have the API installed:- Follow the Quickstart Guide to create your first user and make API calls
- Review the API Reference for all available endpoints
- Learn about Authentication flows
- Explore Database Design and relationships