Skip to content

v-venes/go-rest-api

Repository files navigation

Table of Contents

Golang REST API

About the project

This project is a simple rest API used for knowledge purposes. Some packages used in this project:

  • Mux - HTTP router and URL matcher for Go web servers
  • Gorm - ORM library for Go

Status

The project is complete, I don't want to modify anything, it's just a way to understand more about Go, Gorilla/Mux, and Gorm.

Getting started

First you MUST have Go, Docker, Docker Compose and Git installed

  1. Clone the repository:
git clone git@github.com:BikutaDesu/go-rest-api.git
  1. Open the project:
cd go-rest-api
  1. Start the containers:
docker-compose up
  1. Run the project:
go run main.go

Layout

├── .gitignore
├── docker-compose.yml
├── README.md
├── main.go
├── controllers
│   └── controllers.go
├── database
│   └── db.go
├── middleware
│   └── middleware.go
├── migration
│   └── docker-database-initial.sql
├── models
│   └── people.go
├── routes
│   └── routes.go

A brief description of the layout:

  • .gitignore specifies intentionally untracked files that Git should ignore.
  • docker-compose.yml file defining services, networks, and volumes for a Docker application.
  • README.md description of the project.
  • main.go main file.
  • controllers api controllers.
  • database location responsible for database services.
  • middleware api middlewares.
  • migration database migrations.
  • models api models.
  • routes api routes.

Notes

  • Before running the project you MUST build de containers in docker-compose.yml file.

About

Simple REST API using Go, Mux and Gorm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages