Zen Tasker is a versatile service built with Go and MongoDB, offering seamless functionality for efficient data handling through a RESTful API. Designed with a clean architecture, it ensures modularity, scalability, and maintainability while leveraging MongoDB for robust data storage.
Delivery/
├── main.go
├── controllers/
│ └── controller.go
└── routers/
└── router.go
Domain/
└── domain.go
Infrastructure/
├── auth_middleWare.go
├── jwt_service.go
└── password_service.go
Usecases/
├── task_usecases.go
└── user_usecases.go
Repositories/
├── task_repository.go
└── user_repository.go
tests/
├── Delivery/
│ └── controllers_test.go
├── Infrastructure/
│ ├── jwt_services_test.go
│ └── middleware_test.go
├── Repositories/
│ ├── task_repository_test.go
│ └── user_repository_test.go
├── Usecases/
│ ├── task_usecases_test.go
│ └── user_usecases_test.go
└── mocks/
├── JWTService.go
├── PasswordService.go
├── TaskRepository.go
├── TaskUsecase.go
├── UserRepository.go
└── UserUsecase.go
docs
└── api_documentation.md
coverage.out
go.mod
go.sum
main.go
README.md
-
Clone the repository:
git clone https://github.com/Tamiru-Alemnew/Zen-Tasker.git
-
Change to the project directory:
cd Zen-Tasker
-
Install the Go dependencies:
go mod tidy
Before running the application, ensure you have a MongoDB Atlas connection URl and update the configuration in the .env
file with your specific details:
-
Create environment file:
cp example.env .env
-
Update the
.env
file with the following configurations:MONGO_URL=<your-mongodb-atlas-url> # MongoDB Atlas connection URL. JWT_SECRET=<your-jwt-secret> # The secret key for signing JWT tokens.
Replace
<your-mongodb-connection-string>
and<your-jwt-secret>
with your MongoDB connection string and a secure JWT secret, respectively.
To run the application, use:
make run
The application will start a server on port 8080
. You can access the API at http://localhost:8080/
.
To run tests with coverage, use:
make test
To generate and view a detailed test coverage report, use:
make coverage
- User Authentication
- Register:
POST /register
- Login:
POST /login
- Register:
- Task Management
- Add Task:
POST /tasks
- Get All Tasks:
GET /tasks
- Get Task by ID:
GET /tasks/{id}
- Update Task:
PUT /tasks/{id}
- Delete Task:
DELETE /tasks/{id}
- Add Task:
- User Management
- Promote User:
PATCH /promot/{id}
- Promote User:
Refer to Documentation for detailed API usage and request/response formats.