Git Product home page Git Product logo

rest_api_todo_go's Introduction

Go Todo REST API

A RESTful API for simple todo application with Go using gorilla/mux (A nice mux library) and gorm (An ORM for Go)

Installation & Run

# Download this project
go get github.com/chiraag-kakar/rest_api_todo_go

Before running API server, you should set the database config with yours or set the your database config with my values on config.go

func GetConfig() *Config {
	return &Config{
		DB: &DBConfig{
			Dialect:  "mysql",
			Username: "guest",
			Password: "Guest0000!",
			Name:     "todoapp",
			Charset:  "utf8",
		},
	}
}
# Build and Run
cd rest_api_todo_go
go build
./go-rest_api_todo_go

# API Endpoint : http://127.0.0.1:3000

Structure

├── app
│   ├── app.go
│   ├── handler          // Our API core handlers
│   │   ├── common.go    // Common response functions
│   │   ├── projects.go  // APIs for Project model
│   │   └── tasks.go     // APIs for Task model
│   └── model
│       └── model.go     // Models for our application
├── config
│   └── config.go        // Configuration
└── main.go

API

/projects

  • GET : Get all projects
  • POST : Create a new project

/projects/:title

  • GET : Get a project
  • PUT : Update a project
  • DELETE : Delete a project

/projects/:title/archive

  • PUT : Archive a project
  • DELETE : Restore a project

/projects/:title/tasks

  • GET : Get all tasks of a project
  • POST : Create a new task in a project

/projects/:title/tasks/:id

  • GET : Get a task of a project
  • PUT : Update a task of a project
  • DELETE : Delete a task of a project

/projects/:title/tasks/:id/complete

  • PUT : Complete a task of a project
  • DELETE : Undo a task of a project

Todo

  • Support basic REST APIs.
  • Support Authentication with user for securing the APIs.
  • Make convenient wrappers for creating API handlers.
  • Write the tests for all APIs.
  • Organize the code with packages
  • Make docs with GoDoc
  • Building a deployment process

rest_api_todo_go's People

Contributors

chiraag-kakar avatar

Stargazers

Aesam 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.