Maoni is a Go API template that follows the clean architecture principles. It includes all CRUD operations.
Before you begin, ensure you have installed the following:
- Go version 1.20+
- Docker
- Task - Helps in running multiple commands all at once.
- golangci-lint - Helps in linting the API.
Clone the repository and run the app using Task:
git clone https://github.com/karokojnr/maoni.git
cd maoni
task runLint the app using the following command:
task lintRun integration tests with:
task integration-test
Run end-to-end tests with:
task e2e-test
| Method | Endpoints | Action |
|---|---|---|
| POST | /api/v1/comment | Create a new comment |
| GET | /api/v1/comment/:id | Retrieve a comment by id |
| PUT | /api/v1/comment/:id | Update a comment |
| DELETE | /api/v1/comment/:id | Delete a comment |
Some requests require a JWT Token. You can generate a JWT token at jwt.io using c2VjcmV0ignvbnNlY3JldCJ9 as the secret.
To authenticate an API request, provide your JWT token in the Authorization header:
Authorization [token]These requests require authentication:
- POST /api/v1/comment
- PUT /api/v1/comment/:id
- DELETE /api/v1/comment/:id
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
This project is licensed under the MIT License. See the LICENSE file for details.