DinoDO is a simple Todo List API developed in Go, utilizing the following tools:
- gin-gonic - Web framework for Go
- gorm - Go ORM
- uuid - UUID generation in Go
- godotenv - Loading environment variables in Go
The application uses a MySQL database to store tasks.
- Task Creation: Add new tasks to the list.
- Task Editing: Update the content or status of an existing task.
- Task Listing: View all available tasks.
- Task Listing By ID: View task by provided ID.
- Delete Tasks: Remove tasks from the list.
- JWT Authentication: Secure routes with JSON Web Token authentication.
-
Install dependencies:
go mod tidy
-
Set up environment variables:
- Create a
.env
file in the project root and configure the necessary variables. An example is provided in the.env.example
file.
- Create a
-
Run the application:
go run main.go
The application will be available at
http://localhost:4000
.
curl -X POST http://localhost:4000/api/v1/tasks -d '{"task": "New Task", "finished":false}'
curl -X PUT http://localhost:4000/api/v1/tasks/{id} -d '{"title": "Updated Task", "finished": true}'
curl http://localhost:4000/api/v1/tasks
curl http://localhost:4000/api/v1/tasks/{id}
curl -X DELETE http://localhost:4000/api/v1/tasks/{id}
curl -X POST http://localhost:4000/auth/register -d '{"name": "User Name","email": "[email protected]", "username": "example", "password": "password"}'
curl http://localhost:4000/users/{id} -H "Authorization: Bearer <your_token>"
Contributions are welcome! Feel free to open issues and pull requests.
This project is for educational purposes only and is licensed under the MIT License. MIT License.