A social networking web application built with ASP.NET Core 9.0 MVC. Users can create posts, follow each other, react and comment, join groups, and receive notifications. Post content is moderated automatically using the Google Gemini AI API.
- Authentication — Registration, login, and role-based access control via ASP.NET Identity
- Posts — Create, edit, delete, and explore posts; image uploads via Cloudinary
- Comments — Add and edit comments on posts
- Reactions — React to posts
- Follow system — Follow/unfollow users; support for private accounts
- Groups — Create and join groups; group profile pages
- Notifications — In-app notification feed
- User profiles — Display name, bio, profile picture, follower/following counts
- Content moderation — AI-powered content analysis using Google Gemini to screen posts and comments
- Seeded data — Roles, demo users, groups, and posts are automatically inserted on first run
| Layer | Technology |
|---|---|
| Framework | ASP.NET Core 9.0 MVC |
| ORM | Entity Framework Core 9.0 |
| Database | MySQL 8.4 |
| Identity | ASP.NET Core Identity |
| AI | Google Generative AI (Gemini) |
| Frontend | Bootstrap, jQuery |
| Containerisation | Docker / Docker Compose |
- Docker and Docker Compose, or .NET 9 SDK
- A Google AI Studio API key
- (Optional) A Cloudinary account for image uploads
-
Clone the repository:
git clone <repo-url> cd DotNet
-
Create a
.envfile in the project root (next todocker-compose.yml) with your secrets:GOOGLE_API_KEY=your_google_ai_api_key # Optional — defaults shown below MYSQL_DATABASE=OS_DB MYSQL_USER=appuser MYSQL_PASSWORD=apppass MYSQL_ROOT_PASSWORD=rootpass APP_PORT=8080
-
Add the following tools/ packages to your app container (docker exec commands):
dotnet tool install --global dotnet-ef dotnet add package Pomelo.EntityFrameworkCore.MySql --version 9.0.0
-
Start the application:
docker compose up -d
-
Open your browser at http://localhost:8080.
Migrations are applied and the database is seeded automatically on startup.
-
Make sure you have the .NET 9 SDK and a running MySQL 8.4 instance.
-
Update
OSSocial/appsettings.jsonwith your real values:{ "GoogleAi": { "ApiKey": "your_google_ai_api_key" }, "ConnectionStrings": { "DefaultConnection": "Server=localhost;Port=3306;Database=OS_DB;User=appuser;Password=apppass;" } } -
Restore dependencies and run:
cd OSSocial dotnet run -
Open your browser at the URL printed in the terminal
After the first run, demo accounts are available. Check OSSocial/Models/SeedData.cs for the exact usernames and passwords.
| Role | Purpose |
|---|---|
| Admin | Full administrative access |
| User | Standard account |
OSSocial/
├── Controllers/ # MVC controllers (Posts, Comments, Groups, Profiles, …)
├── Models/ # Entity models and ApplicationUser
├── Views/ # Razor views
├── Data/ # EF Core DbContext
├── Migrations/ # EF Core migrations
├── Services/ # ContentAnalysisService (Google Gemini integration)
├── Areas/Identity/ # ASP.NET Identity Razor pages (login, register, …)
└── wwwroot/ # Static assets (CSS, JS, images)