This is a simple Todo application API built with Golang. It leverages Couchbase as the database and uses various libraries to enhance functionality, including JWT for authentication, Fiber for the web framework, and Swagger for API documentation.
- Create, read, update, and delete (CRUD) operations for todos
- User authentication with JWT
- Input validation
- API documentation with Swagger
- Logging with Zap
- Configuration management with Viper
- Couchbase: Database
- Fiber: Web framework
- JWT: Authentication
- Swagger: API documentation
- Viper: Configuration
- Zap: Logging
- Testify: Testing
-
Clone the repository:
git clone https://github.com/harundurmus/go-todo-app.git cd todo-app-api -
Install dependencies:
go mod tidy
-
Configure the application by modifying the
config.yamlfile as needed.
- Start the application using Docker Compose:
docker-compose up
Swagger documentation is available at /swagger/index.html when the server is running.
To run the tests, use the following commands:
To run unit tests:
make unit-testTo run unit test coverage:
make unit-test-coverageTo generate a test coverage report:
make unit-test-coverage-file