TODO_GO: a simple todo API created in Golang with a minimum number of dependencies and configuration

TODO_GO golang icon

TODO_GO is a simple todo API created in Golang with a minimum number of dependencies and configuration.

Content

Inspiration

As many times, when you want to start a new frontend project, you will need to create or to find a simple backend API to structure your application. Usually using something like The Rick and Morty API which is very complete, but doesn't allow you make any change on the API. In this case, you will be able to use the API and change it as much as you need.

Prerequisites

In order to run this project you will need Go v1.17 installed on your local environment: Golang.

Also you will need to create a database in MongoDB. To do this you can install MonogoDB on your computer or use a free cloud solution: MongoDB.

Installation

1. Clone the project

Clone this project using the following command:

git clone [email protected]:AlejandroAcev/todo_go.git

2. Install the dependencies

Install all the required dependencies using:

go get ./...

3. Add the configuration

Add the required values to connect the API with the MongoDB database and the desired port in the .env file:

PORT=8080
MONGO_PASS=MySecretPass
MONGO_URI=mongodb+srv://<your_user>:${MONGO_PASS}@mongogeneric.ujgee.mongodb.net/<database_name>?retryWrites=true&w=majority

4. Run the project

The simplest way to run the code is usgin the following command.

go run main.go

But if you prefer you can compile the code and generate an executable to run on your machine:

go build -o todo_go #or the name that you prefer

Routes

In order to connect your web application you can use any of the following endpoints:

GET         /api/tasks               # Shows all the task created
POST        /api/task                # Creates a new task with the specified data
GET         /api/task/<id>           # Shows the details of a specific task
POST | PUT  /api/task/<id>           # Modify/Update the task selected
DELETE      /api/task/<id>           # Delete the specified task

Also you can find a Thunder collection and a thunder environment file with all the required data and information to use the app.

Example of body for create a new task:

POST /api/task

{
    "title": "Title example!",
    "description": "This is a very long description",
    "tags": ["Tag1", "Tag2"],
    "completed": false
}

Credits

Alejandro Acevedo - @AlejandroAcev

License

The MIT License (MIT)

Copyright (c) 2022 Alejandro Acevedo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Owner
Alejandro Acevedo Gonzalez
Alejandro Acevedo Gonzalez
Similar Resources

A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021

Simple-api - Create Simple `Hello World` APIs from Various Programming Languages

simple-api Create Simple `Hello World` APIs from Various Programming Languages.

Jan 18, 2022

An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Dec 30, 2022

Arweave-api - Arweave API implementation in golang

Arweave API Go implementation of the Arweave API Todo A list of endpoints that a

Jan 16, 2022

Reservationbox-api - Reservationbox Api with golang

Reservationbox-api - Reservationbox Api with golang

reservationbox-api How to set up application Cloning git on this link : https://

Jan 30, 2022

Go api infra - Infrastructure for making api on golang so easy

Go Infra Api Infrastructre methods and types for make api simple Response abstra

Jun 18, 2022

A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

Mar 5, 2022

Golang API for Whatsapp API MultiDevice version

Golang API for Whatsapp API MultiDevice version

Go Whatsapp API Multi Device Version Required Mac OS: brew install vips export C

Jan 3, 2023

Awb-kh-api - AWB KH API WITH GOLANG

AWB KH API Da die vorhandene API des Abfallwirtschaftsbetriebs in Bad Kreuznach

Feb 11, 2022
Todo-list - In this project using golang and mySql to create todo-list to Add and remove
Todo-list - In this project using golang and mySql to create todo-list to Add and remove

TODO-Fullstack-App-Go-Gin-Postgres-React This fullstack application creates a TODO List Web Page using the Go/Gin/Postgres/React Stack. Starting the a

Apr 7, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
Simple Golang API for creating todo notes

Simple Golang API for creating todo notes To run: foo@bar:~$ cd backend foo@bar:~$ go run . Application will be listening on localhost:8080 API routes

Oct 27, 2021
Todo api with Golang.

Todo api with Golang. API Description: GET /api/todo => [{"id":1,"text":"First Todo"},{"id":2,"text":"Second Todo"}], POST /api/todo => {text:"Third

Dec 19, 2021
A simple todolist application API created using Golang

API Aplikasi KegiatanQ Merupakan API aplikasi todolist sederhana yang dibuat men

Dec 29, 2021
Clean-todo - An example of go app with clean architecture

clean-todo An example of go app with clean application Functionality This is a s

Jan 26, 2022
planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

planet planet is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve command install

Oct 31, 2021
👀The vaws command was created to simplify the display of AWS resources.

Vaws The vaws command was created to simplify the display of AWS resources. This repository is a Go version of the command that was created in the fol

Feb 12, 2022
Delete CloudFormation stacks respecting stack dependencies
Delete CloudFormation stacks respecting stack dependencies

CFN Teardown Cleanup CloudFormation stacks respecting the order of dependencies. Features Stack name pattern matching for deletion. Finds out dependen

Oct 9, 2022
Package figtree provides a multi-paradigm SDK for sophisticated configuration file access

Package figtree provides a multi-paradigm SDK for sophisticated configuration file access. Motivation Figtree syntax is based on classic key/value pai

Dec 31, 2021