Skip to content

This project aims to create a REST API that connects directly to MongoDB, performing CRUD operations. I developed an API using the Go programming language and the GIN framework.

Notifications You must be signed in to change notification settings

JuanCampbsi/go_api_mongo_db

Repository files navigation

Go Reference Test

Api Go REST - GIN + MongoDB

🛠 Description


This project aims to create a REST API that connects directly to MongoDB, performing CRUD operations. I developed the API using the Go programming language and the GIN framework, and all endpoints are documented with Swagger.

To facilitate deployment and ensure consistency of the development environment, I used Docker to upload and manage the MongoDB instance.

The project design is modular, following recognized development standards. I carefully selected the logic and structure, creating a specific folder for settings. This folder includes log files, connection to MongoDB and database initialization.

I developed a custom logger to handle various responses and information from endpoints, from success responses to errors.

I opted for a custom approach to data validation, avoiding external libraries, which allowed me to validate JSON structures accurately.

To speed up development, I also created a Makefile with customized commands that facilitate routine tasks.

Swagger


Intro


⌨ Installation

To use it, you need to clone the repository, install the dependencies and run the project.

# Up Docker
$ docker compose up  

# Open terminal/cmd and then Clone this repository
$ git clone https://github.com/JuanCampbsi/go_api_mongo_db.git

# Access project folder in terminal/cmd
$ cd go_api_mongo_db

# Install the dependencies
$ go mod tidy

# Run the application in development mode
$ go run main.go  

⌨ Stack of technologies and libraries


👨‍💻 Author 💻

Developed by Juan Campos

About

This project aims to create a REST API that connects directly to MongoDB, performing CRUD operations. I developed an API using the Go programming language and the GIN framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published