Skip to content

Latest commit

 

History

History
101 lines (64 loc) · 2.26 KB

README.md

File metadata and controls

101 lines (64 loc) · 2.26 KB

DinoDO - Go-based Todo List API

DinoDO

Description

DinoDO is a simple Todo List API developed in Go, utilizing the following tools:

The application uses a MySQL database to store tasks.

Features

  • 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.

Configuration

  1. Install dependencies:

        go mod tidy
  2. 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.
  3. Run the application:

    go run main.go

    The application will be available at http://localhost:4000.

Usage Examples

Task Creation

curl -X POST http://localhost:4000/api/v1/tasks -d '{"task": "New Task", "finished":false}'

Task Editing

curl -X PUT http://localhost:4000/api/v1/tasks/{id} -d '{"title": "Updated Task", "finished": true}'

Task Listing

curl http://localhost:4000/api/v1/tasks

Task Listing By ID

curl http://localhost:4000/api/v1/tasks/{id}

Delete Task

curl -X DELETE http://localhost:4000/api/v1/tasks/{id}

User Register

curl -X POST http://localhost:4000/auth/register -d '{"name": "User Name","email": "[email protected]", "username": "example", "password": "password"}'

Get User Details

curl http://localhost:4000/users/{id} -H "Authorization: Bearer <your_token>"

Contributions

Contributions are welcome! Feel free to open issues and pull requests.

License

This project is for educational purposes only and is licensed under the MIT License. MIT License.