https://github.com/su1uv/GinTasker
Simple TODO List API
https://github.com/su1uv/GinTasker
api api-rest gin-framework golang mysql-database
Last synced: about 2 months ago
JSON representation
Simple TODO List API
- Host: GitHub
- URL: https://github.com/su1uv/GinTasker
- Owner: su1uv
- License: mit
- Created: 2024-07-24T17:05:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-25T18:48:57.000Z (almost 2 years ago)
- Last Synced: 2026-04-24T09:48:48.258Z (about 2 months ago)
- Topics: api, api-rest, gin-framework, golang, mysql-database
- Language: Go
- Homepage:
- Size: 7.77 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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](#installation)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [License](#license)
## Installation
To set up GinTasker on your local machine, follow these steps:
1. **Clone the repository**:
```bash
git clone https://github.com/EmiliodDev/GinTasker
cd GinTasker
```
2. **Install dependencies**:
```bash
go mod tidy
```
3. **Configure the application**:
Create a `config.yaml` file:
```yaml
appname: GinTasker
port: "8080"
db:
host: localhost
port: "3306"
user: youruser
password: yourpassword
name: yourdbname
```
4. **Run the application**:
```bash
make run
```
5. **Access the API**:
The API will be available at `http://localhost:8080`.
## Usage
You can interact with the API using tools like [Postman](https://www.postman.com/) or [cURL](https://curl.se/). Here are some example requests:
- **List all tasks**:
```bash
curl http://localhost:8080/api/v1/tasks
```
- **Get task by ID**:
```bash
curl http://localhost:8080/api/v1/task/{id}
```
- **Create a new task**:
```bash
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**:
```bash
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**:
```bash
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](./LICENSE) file for details.