Giter Site home page Giter Site logo

crud-api-go-echo's Introduction

codeid-boiler

This project is code.id boilerplate to create API in Golang Echo Framework

  • PORT : 3030
  • PATH : /

Installation

# clone the repo
$ git clone 

# go into app's directory
$ cd my-project

Build & Run

Local environment

# build 
$ go build

# run in development 
$ ENV=DEV go run main.go
$ ENV=DEV ./filego

# run in staging 
$ ENV=STAGING go run main.go
$ ENV=STAGING ./filego

# run in production 
$ ENV=PROD go run main.go
$ ENV=PROD ./filego

Docker environment

# build 
$ docker build -t codeid-api:latest .

# config
sudo sysctl -w vm.max_map_count=262144 # it is required for elasticsearch config

# run
$ docker compose up

Documentation

Install environment

# get swagger package 
$ go get github.com/swaggo/swag

# move to swagger dir
$ cd $GOPATH/src/github.com/swaggo/swag

# install swagger cmd 
$ go install cmd/swag

Generate documentation

# generate swagger doc
$ swag init --propertyStrategy snakecase

to see the results, run app and access {{url}}/swagger/index.html

Description

This project built in clean architecture that contains :

  1. Http
  2. Factory
  3. Middleware
  4. Handler
  5. Binder
  6. Validation
  7. Service
  8. Repository
  9. Model
  10. Database

This project have some default function :

  • Context
  • Validator
  • Transaction
  • Pagination & Sort
  • Filter
  • Env
  • Response
  • Redis
  • Elasticsearch
  • Log

This project have some default endpoint :

  • Auth
    • Login
    • Register
  • Sample
    • Get (with pagination, sort, & filter)
    • GetByID
    • Create (with transaction)
    • Update (with transaction)
    • Delete

Author

CodeID Backend Team

crud-api-go-echo's People

Contributors

mcholismalik avatar

Forkers

yasinqurni

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.