Giter Club home page Giter Club logo

go-todo-crud's Introduction

Todo CRUD REST API ๐Ÿ“

This project is a simple RESTful CRUD (Create, Read, Update, Delete) API for managing todos. It provides basic operations to interact with a todo list, allowing users to create, read, update, and delete todo items.

I built this project to get started with Go.

API Endpoints ๐Ÿš€

  1. Get all todos

    • Endpoint: GET /todo
    • Description: Retrieve a list of all todos.
  2. Create a new todo

    • Endpoint: POST /todo
    • Payload:
      • Name (string): The name of the todo.
      • Description (string): A description of the todo.
      • Completed (boolean): Indicates whether the todo is completed.
      • ID (number): Unique identifier for the todo.
    • Description: Create a new todo with the provided information.
  3. Update a todo by ID

    • Endpoint: PUT /todo/{id}
    • Payload:
      • Name (string): The updated name of the todo.
      • Description (string): The updated description of the todo.
      • Completed (boolean): The updated completion status of the todo.
    • Description: Update an existing todo identified by its ID with the provided information.
  4. Delete a todo by ID

    • Endpoint: DELETE /todo/{id}
    • Description: Delete a todo item based on its unique ID.

Project URL ๐ŸŒ

Visit the live deployment of this API: Todo CRUD API

Getting Started ๐Ÿ› ๏ธ

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/mecies/go-todo-crud.git
  2. Install dependencies:

    cd go-todo-crud
    go install
  3. Create a .env file and populate the following vars (requires a Postgres DB)

    DB_USER=
    DB_PASS=
    DB_HOST=
    DB_NAME=
    DB_PORT=
    PORT=
  4. Run the project:

    go run main.go

    The API will be accessible at http://localhost:{PORT}.

License ๐Ÿ“œ

This project is licensed under the do-whatever-you-want-license.

go-todo-crud's People

Contributors

mecies avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.