https://github.com/soelz4/user-management-system-mongo-crud-api
User Management System ๐ค (CRUD API) with NoSQL DataBase (MongoDB) ๐ฑ
https://github.com/soelz4/user-management-system-mongo-crud-api
database golang gorilla-mux http-server mongodb nosql server
Last synced: 11 months ago
JSON representation
User Management System ๐ค (CRUD API) with NoSQL DataBase (MongoDB) ๐ฑ
- Host: GitHub
- URL: https://github.com/soelz4/user-management-system-mongo-crud-api
- Owner: soelz4
- Created: 2024-06-09T08:32:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T07:56:10.000Z (about 2 years ago)
- Last Synced: 2025-05-05T05:03:00.678Z (about 1 year ago)
- Topics: database, golang, gorilla-mux, http-server, mongodb, nosql, server
- Language: Go
- Homepage:
- Size: 8.23 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# user-management-system-mongo-crud-api
โ ๏ธ **NOTE!!!!!** This Goalng App Written for Me - So some Things Might not Work on Your PC or Laptop as this was Never Intended to be a Usable Full Fledged Application, in that Case, Please Try if You Can Fix that Up as Much as Possible, or you can Open an Issue for Help :) - You Need to Change Something Related to Database (in Makefile, docker-compose.yml and ...) - So Please Check Everything Before Running the Database and Server.

## Requirements
- make
- [MongoDB](https://www.mongodb.com/)
- [MongoDB Docker Image](https://hub.docker.com/r/mongodb/mongodb-community-server)
- Create a Docker Network to Connect Golang Server Container and MongoDB Container with Each other
## Makefile
A Standard GNU Make File is Provided to Help with Running and Building Locally.
```text
help ๐ฌ This Help Message
lint ๐ Lint & Format, will not Fix but Sets Exit Code on Error
lint-fix ๐ Lint & Format, will Try to Fix Errors and Modify Code
build ๐จ Build Binary File
run >_ Run the Web Server Locally at PORT 9010
init ๐ฅ Download Dependencies From go.mod File
clean ๐งน Clean up Project
mongodb ๐ฑ Pull MongoDB Docker Image from Docker Hub Registry
docker-network ๐ชก Create Docker Network
image ๐ฆ Build Docker Container Image from Dockerfile
push ๐ค Push Container Image to Registry
compose-up ๐งท Create and Start Containers
compose-down ๐งผ Stop and Remove Containers, Networks
```
Makefile Variables
| Makefile Variable | Default |
| ----------------- | -------------------------------------------------- |
| SRC_DIR | ./src/ |
| DEFAULT_GOAL | help |
| BINARY_NAME | main |
| BINARY_DIR | ./bin/ |
| IMAGE_REPO | soelz/golang-user-management-system-mongo-crud-api |
| IMAGE_TAG | 0.1 |
| MongoDB_IMAGE | mongodb/mongodb-community-server:latest |
## DataBase (NoSQL MongoDB)
MongoDB Go Driver Configurations ([The Official Golang driver for MongoDB](https://github.com/mongodb/mongo-go-driver)) Available in [./src/pkg/config/app.go](src/pkg/config/app.go).
## Containers
RUN Server in a Container
```bash
docker run --name mongodb --network backend -p 27017:27017 -d mongodb/mongodb-community-server:latest
```
```bash
docker run --name gumsmca --network backend -p 9010:9010 soelz/golang-user-management-system-mongo-crud-api:0.1
```
OR
Just Execute this Command ~>
```bash
make compose-up
```
