repository
0.0.0-20240725184850-cfc1852ffb35
Repository: https://github.com/emilioddev/gintasker.git
Documentation: pkg.go.dev
# README
GinTasker
GinTasker is a simple Todo List API built using Go, Gin, GORM, and Viper. This API allows users to manage their tasks efficiently with basic CRUD operations: Create, Read, Update, and Delete. It's designed as a lightweight and straightforward solution for task management.
Features
- Task Management: Create, view, update, and delete tasks.
- Built with Go: Utilizes Go's robust features for building scalable and fast applications.
- Frameworks and Libraries: Incorporate Gin for routing, GORM for ORM, and Viper for configuration management.
- No User Authorization: Focused on core functionality without authentication.
Table of Contents
Installation
To set up GinTasker on your local machine, follow these steps:
- Clone the repository:
git clone https://github.com/EmiliodDev/GinTasker
cd GinTasker
- Install dependencies:
go mod tidy
-
Configure the application:
Create a
config.yaml
file:
appname: GinTasker
port: "8080"
db:
host: localhost
port: "3306"
user: youruser
password: yourpassword
name: yourdbname
- Run the application:
make run
-
Access the API:
The API will be available at
http://localhost:8080
.
Usage
You can interact with the API using tools like Postman or cURL. Here are some example requests:
-
List all tasks:
curl http://localhost:8080/api/v1/tasks
-
Get task by ID:
curl http://localhost:8080/api/v1/task/{id}
-
Create a new task:
curl -X POST http://localhost:8080/api/v1/create -H "Content-Type: application/json" -d '{"name": "New Task", "description": "Complete the assignment.", "completed": false}'
-
Update task:
curl -X PUT http://localhost:8080/api/v1/update/{id} -H "Content-Type: application/json" -d '{"name": "Updated Task", "description": "Update the assignment.", "completed": true}'
-
Delete task:
curl -X DELETE http://localhost:8080/api/v1/delete/{id}
API Endpoints
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/tasks | Get all tasks |
GET | /api/v1/task/{id} | Get a specific task |
POST | /api/v1/create | Create a new task |
PUT | /api/v1/update/{id} | Update a specific task |
DELETE | /api/v1/delete/{id} | Delete a specific task |
License
This project is licensed under the MIT License. See the LICENSE file for details.