Skip to content

awesome-academy/Go-Architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Architecture

Demo common Architecture for web servers golang

  • This Project demo API create/get animals

Sample 3 Layered Architecture

Diagram: alt text

Source Code:

Branch: layered-architecture

How to run this project?

We can run this project with Docker. Here, I am providing both ways to run this project.

  • Clone this project
# Move to your workspace
cd your-workspace

# Clone this project into your workspace
git clone https://github.com/awesome-academy/Go-Architecture.git

# Move to the project root directory
cd Go-Architecture
  • Create a file .env similar to .env.example at the root directory with your configuration.
  • Install Docker and Docker Compose.
  • Run docker-compose up
  • Access API using http://localhost:3000

Example API Request and Response

  • Create animal

    • request

        curl -X POST http://localhost:3000/animal -H 'Content-Type: application/json' -d '{"name":"Name Test","age":10}'
      
    • response

      {
        "id": 1,
        "name": "Name Test",
        "age": 10
      }

Contributing to Go Architecture

All pull requests are welcome.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published