https://github.com/basemax/go-api-todolist
A Todo List (API) Web-service project designed by Go Language and using MongoDB as a database for storing and managing tasks.
https://github.com/basemax/go-api-todolist
api api-rest go golang mongo mongodb todo-api todo-api-go todo-app todo-list todolist
Last synced: about 1 month ago
JSON representation
A Todo List (API) Web-service project designed by Go Language and using MongoDB as a database for storing and managing tasks.
- Host: GitHub
- URL: https://github.com/basemax/go-api-todolist
- Owner: BaseMax
- License: gpl-3.0
- Created: 2022-09-12T04:46:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T23:32:47.000Z (over 1 year ago)
- Last Synced: 2025-10-25T11:57:28.199Z (8 months ago)
- Topics: api, api-rest, go, golang, mongo, mongodb, todo-api, todo-api-go, todo-app, todo-list, todolist
- Language: Go
- Homepage:
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GO API Todo List
A Web service Todo List (API) project designed by Go Language and using MongoDB as a database for storing and managing tasks.
## Tools
- ENV: https://github.com/joho/godotenv
- MUX: https://github.com/gorilla/mux
- Mongo: https://go.mongodb.org/mongo-driver
## API Routes
- **Get a single task**
- Route: `host:8000/api/v1/get/{_id}/`
- Description: replace {_id} with mongodb document id
- Method: GET
- **Get all tasks**
- Route: `host:8000/api/v1/get/`
- Description: return a list of tasks
- Method: GET
- **Insert a new task**
- Route: `host:8000/api/v1/craete/`
- Description: send a JSON request with these fields:
```json
{
"name": "name of task",
"description": "info about task",
"status": true
}
```
- method: POST
- **Delete a task**
- Route: `host:8000/api/v1/delete/{_id}/`
- Description: replace {_id} with desired task id returned in create response
- Method: DELETE
- **Update/Edit a task**
- Route: `host:8000/api/v1/update/{_id}`
- Description: replace {_id} with desired task id and send a JSON in body same as create route.
- Method: PUT
## How to run
You can run this app using 2 methods:
1. **Manual**
1. Clone this repo, rename `env.env` to `.env`, fill fields in `.env` file as desired
2. Run `go build .`
3. Run binary named `./go-api-todolist`
2. **Docker compose**
1. Clone this repo.
2. Run `docker-compose up -d` and wait for app to run on `localhost:8000`
## Authors
- Amir
- Max Base
© Copyright 2022, Max Base