The app is a backend service for a blog, providing a RESTful API for creating, reading, updating, and deleting posts. It uses JWT tokens for authentication, allowing users to securely log in and access protected routes.
It is built using .NET 7.0 and has a layered architecture with five different layers: API, Business, Data Access, Entities, and Web. The API layer exposes the endpoints and handles incoming HTTP requests. The Business layer contains the business logic for the app. The Data Access layer communicates with the database using Entity Framework Core. The Entities layer defines the models used by the app. The Web layer contains the frontend code for the app.
Swagger is used to document the API and provide a user interface for testing the endpoints. AutoMapper is used to map data between the database models and the API models, and BCrypt is used to hash and salt user passwords for secure storage.
You can access development roadmap from here
- User authentication using JWT tokens
- CRUD operations
- Swagger documentation
- AutoMapper for mapping data between models
- BCrypt for hashing and salting passwords
- Clone the repo
git clone https://github.com/emrecancorapci/YetAnotherBlogProject_Backend.git
- Build the project
dotnet build
- Run the project
dotnet run --project src/API/API.csproj
- Open the Swagger UI
{URL}/swagger/index.html
- Create
appsettings.json
atAPI
folder. You can useappsettings.example.json
as a template.
{
"ConnectionStrings": {
"DefaultConnection": "Server={SERVER};Port={PORT};Database={DATABASE};User Id={USER};Password={PASSWORD};"
},
"JsonWebTokenKeys": {
"Subject": "Login",
"IssuerSigningKey": "{KEY}"
}
}