This is a blog application API and Batch designed using the Onion Architecture.
-
Domain Layer
-
Contains the core business logic of the application
-
Composed of entities, value objects, domain services, and repositories
-
Independent of external layers
-
Repository
- Responsible for persisting domain objects
- Defines only interfaces
-
-
Usecase Layer
- Contains the business logic to implement the application's features
- Depends on the domain layer and repository interfaces
-
Infrastructure Layer
- Contains technical implementations such as databases and external APIs
- Provides implementations for repository interfaces
-
UI Layer
- Provides the user interface
- Includes HTTP handlers, middleware, etc.
POST /api/users/register- Register a new userPOST /api/users/login- User loginGET /api/users/:id- Get user informationPUT /api/users/:id- Update user informationDELETE /api/users/:id- Delete user
POST /api/blogs- Create a new blog postGET /api/blogs- Get list of blog postsGET /api/blogs/:id- Get blog post detailsGET /api/users/:id/blogs- Get list of blog posts by userPUT /api/blogs/:id- Update blog postDELETE /api/blogs/:id- Delete blog post
POST /api/blogs/:id/comments- Add a comment to a blog postGET /api/blogs/:id/comments- Get comments for a blog postPUT /api/comments/:id- Update a commentDELETE /api/comments/:id- Delete a comment