A modern social media platform built with ASP.NET Core 7.0, featuring user authentication, posts, comments, reactions, and real-time notifications.
-
User Authentication & Authorization
- ASP.NET Core Identity integration
- Role-based access control (Admin & User roles)
- Email confirmation support
- Account management
-
Social Networking
- Create, edit, and delete posts with rich content
- Upload images and file attachments
- Like/Unlike posts
- Comment on posts
- Follow/Unfollow users
- View user profiles
-
Admin Dashboard
- User management
- Lock/Unlock user accounts
- Change user roles
- View all posts and users
-
Notifications System
- Real-time notifications for follows, comments, and reactions
- Mark notifications as read
- Notification count badges
-
Modern UI/UX
- Responsive design with Bootstrap 5
- Custom styling with Poppins font
- Interactive components
- Smooth animations and transitions
- Backend: ASP.NET Core 7.0 MVC
- Database: SQL Server (configurable to SQL Server Express or LocalDB)
- ORM: Entity Framework Core 7.0
- Authentication: ASP.NET Core Identity
- Frontend:
- Razor Pages
- Bootstrap 5
- Bootstrap Icons
- JavaScript/jQuery
- Custom CSS
Before running this project, ensure you have the following installed:
- .NET 7.0 SDK
- SQL Server Express or SQL Server LocalDB
- Visual Studio 2022 (optional, but recommended)
- Git
git clone https://github.com/YasserZr/GoPost.git
cd GoPostUpdate the connection string in appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=.\\SQLEXPRESS;Database=aspnet-GoPost;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"
}
}Note: Adjust the connection string based on your SQL Server setup.
cd GoPost
dotnet restoredotnet ef database updateThis will create the database and apply all migrations.
dotnet runThe application will be available at:
- HTTPS: https://localhost:7134
- HTTP: http://localhost:5219
After running the application, the system will attempt to create an admin role. To create an admin user:
- Register a new account with email:
admin@example.com - The system will automatically assign the Admin role if configured in
Program.cs
Alternatively, update the email in Program.cs to match your desired admin account.
GoPost/
├── Areas/
│ └── Identity/ # Identity pages (login, register, etc.)
├── Attributes/ # Custom attributes
├── Controllers/ # MVC Controllers
│ ├── AdminController.cs
│ ├── CommentsController.cs
│ ├── FollowsController.cs
│ ├── HomeController.cs
│ ├── NotificationsController.cs
│ ├── PostsController.cs
│ ├── ProfilesController.cs
│ └── ReactionsController.cs
├── Data/ # Database context and migrations
│ ├── ApplicationDbContext.cs
│ └── Migrations/
├── Helpers/ # Helper classes
│ └── StringExtensions.cs
├── Models/ # Data models and ViewModels
│ ├── ApplicationUser.cs
│ ├── Post.cs
│ ├── Comment.cs
│ ├── Reaction.cs
│ ├── Follow.cs
│ ├── Notification.cs
│ └── ViewModels/
├── Views/ # Razor views
│ ├── Home/
│ ├── Posts/
│ ├── Profiles/
│ ├── Admin/
│ └── Shared/
├── wwwroot/ # Static files (CSS, JS, images)
│ ├── css/
│ ├── js/
│ ├── images/
│ └── uploads/ # User-uploaded files
├── appsettings.json # Application configuration
└── Program.cs # Application entry point
To enable email confirmation, configure SMTP settings in appsettings.json:
{
"EmailSettings": {
"SmtpServer": "smtp.gmail.com",
"SmtpPort": 587,
"SenderEmail": "your-email@gmail.com",
"SenderName": "GoPost",
"Username": "your-email@gmail.com",
"Password": "your-app-password"
}
}Password requirements and other identity options can be configured in Program.cs:
builder.Services.AddDefaultIdentity<ApplicationUser>(options =>
{
options.Password.RequireDigit = false;
options.Password.RequireLowercase = false;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.Password.RequiredLength = 6;
options.SignIn.RequireConfirmedAccount = true;
})- Log in to your account
- Navigate to the home page
- Click "Create New Post"
- Fill in the title and content
- Optionally upload images or files
- Click "Create" to publish
- Search for users using the search bar
- Visit their profile
- Click the "Follow" button
- View their posts in your feed
- Log in with an admin account
- Navigate to the Admin Dashboard
- Manage users, lock/unlock accounts, and change roles
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
YasserZr
- GitHub: @YasserZr
- ASP.NET Core team for the excellent framework
- Bootstrap team for the UI components
- All contributors and users of this project
If you have any questions or need help, please open an issue on GitHub.
Made with ❤️ using ASP.NET Core