{"id":18356616,"url":"https://github.com/kerolesnabiel/SocialMediaAPI","last_synced_at":"2025-10-30T19:30:29.853Z","repository":{"id":261183127,"uuid":"883492291","full_name":"kerolesnabill/SocialMediaAPI","owner":"kerolesnabill","description":"A RESTful API for a social media platform built using ASP.NET Web API. This project follows the Clean Architecture principles and provides features like user authentication, post management, comments, likes, and more.","archived":false,"fork":false,"pushed_at":"2024-11-22T17:37:03.000Z","size":176,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-23T21:42:28.430Z","etag":null,"topics":["asp-net-core-web-api","clean-architecture","cqrs","csharp","dependency-injection","entity-framework-core","identity","integration-testing","restful-api","solid","sql-server","tdd","testing","unit-testing"],"latest_commit_sha":null,"homepage":"https://social-media-api.azurewebsites.net/swagger","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kerolesnabill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-05T03:57:11.000Z","updated_at":"2024-11-28T00:33:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8ee00c9-f85b-4101-841d-2e0e83c3d3a5","html_url":"https://github.com/kerolesnabill/SocialMediaAPI","commit_stats":null,"previous_names":["kerolesnabill/socialmediaapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolesnabill%2FSocialMediaAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolesnabill%2FSocialMediaAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolesnabill%2FSocialMediaAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolesnabill%2FSocialMediaAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kerolesnabill","download_url":"https://codeload.github.com/kerolesnabill/SocialMediaAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239032205,"owners_count":19570770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core-web-api","clean-architecture","cqrs","csharp","dependency-injection","entity-framework-core","identity","integration-testing","restful-api","solid","sql-server","tdd","testing","unit-testing"],"created_at":"2024-11-05T22:10:56.673Z","updated_at":"2025-10-30T19:30:29.449Z","avatar_url":"https://github.com/kerolesnabill.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social Media API\n\nA RESTful API for a social media platform built using ASP.NET Web API. This project follows the Clean Architecture principles and provides features like user authentication, post management, comments, likes, and more.\n\n## Project Overview\n\nThis API serves as the backend for a social media platform, providing functionality for user authentication, content creation, user interaction, and administrative control. The project demonstrates expertise in building scalable, secure, and maintainable backend systems.\n\n## Features\n\n- **User Management**:\n\n  - User registration, login, and profile updates.\n  - Upload profile picture.\n  - Change user password.\n\n- **Posts**:\n\n  - CRUD operations for posts.\n  - Like/unlike functionality for posts.\n  - Feed generation for followed users.\n\n- **Comments**:\n\n  - CRUD operations for comments on posts.\n  - Like/unlike functionality for comments.\n\n- **Search**:\n\n  - Search for posts by keyword.\n  - Search for users by username or name.\n\n- **Follow System**:\n\n  - Follow and unfollow users.\n  - View followers and following lists.\n\n- **Admin Controls**:\n  - Manage user roles.\n  - Delete any user, post, or comment.\n\n## Technologies Used\n\n- **Framework**: ASP.NET Web API\n- **Database**: SQL Server with Entity Framework Core\n- **Authentication**: ASP.NET Identity with JWT\n- **Architecture**: Clean Architecture\n- **Libraries and Tools**:\n  - `AutoMapper` - Object mapping.\n  - `FluentValidation.AspNetCore` - Validation.\n  - `MediatR` - Mediator pattern for CQRS.\n  - `Serilog` - Logging.\n  - `Swashbuckle.AspNetCore` - Swagger documentation.\n  - `xUnit` `Moq` - Testing.\n\n## API Endpoints\n\n### Posts\n\n- `POST /api/posts` - Create a new post.\n- `GET /api/posts` - Get all posts.\n- `GET /api/posts/feed` - Get posts from followed users.\n- `GET /api/posts/{id}` - Get a post by ID.\n- `PATCH /api/posts/{id}` - Update a post.\n- `DELETE /api/posts/{id}` - Delete a post.\n- `POST /api/posts/{postId}/like` - Like/unlike a post.\n- `GET /api/posts/{postId}/likes` - Get a list of users who liked a post.\n\n### Comments\n\n- `POST /api/posts/{postId}/comments` - Add a comment to a post.\n- `GET /api/posts/{postId}/comments` - Get all comments on a post.\n- `PATCH /api/posts/{postId}/comments/{commentId}` - Update a comment.\n- `DELETE /api/posts/{postId}/comments/{commentId}` - Delete a comment.\n- `POST /api/posts/{postId}/comments/{commentId}/like` - Like/unlike a comment.\n- `GET /api/posts/{postId}/comments/{commentId}/likes` - Get a list of users who liked a comment.\n\n### Users\n\n- `POST /api/users/register` - Register a new user.\n- `POST /api/users/login` - Log in.\n- `POST /api/users/refresh` - Refresh JWT token.\n- `GET /api/users/{id}` - Get user profile by ID.\n- `PATCH /api/users/me` - Update current user profile.\n- `DELETE /api/users/me` - Delete current user account.\n- `POST /api/users/{id}/follow` - Follow a user.\n- `DELETE /api/users/{id}/unfollow` - Unfollow a user.\n- `POST /api/users/manage/info` - Change the password.\n\n### Admin\n\n- `POST /api/admin/userRole` - Assign a role to a user.\n- `DELETE /api/admin/userRole` - Remove a role from a user.\n- `GET /api/admin/users` - Get all users.\n- `DELETE /api/admin/users/{userId}` - Delete a user.\n- `DELETE /api/admin/posts/{postId}` - Delete a post.\n\n### Search\n\n- `GET /api/search/posts` - Search posts by keyword.\n- `GET /api/search/users` - Search users by username or email.\n\n## Live Demo\n\n- On Azure: https://social-media-api.azurewebsites.net/swagger\n- On MonsterASP.NET: http://social-media.runasp.net/swagger\n\n## Setup Instructions\n\n1. **Clone the Repository**:\n\n   ```bash\n   git clone https://github.com/kerolesnabill/SocialMediaAPI.git\n   cd SocialMediaAPI\n   ```\n\n2. **Install Dependencies**:\n\n   ```bash\n    dotnet restore\n   ```\n\n3. **Configure the Database**:\n\n   - Update the `appsettings.json` file with your SQL Server and blob storage connection strings.\n\n4. **Run Migrations**:\n\n   ```bash\n   dotnet ef database update\n   ```\n\n5. **Run the Application**:\n\n   ```bash\n   dotnet run\n   ```\n\n6. **Access Swagger UI**:\n   - Open `http://localhost:{port}/swagger` in your browser.\n\n## Testing\n\nTo run the tests:\n\n```bash\ndotnet test\n```\n\n## License\n\n- This project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerolesnabiel%2FSocialMediaAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerolesnabiel%2FSocialMediaAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerolesnabiel%2FSocialMediaAPI/lists"}