An open API service indexing awesome lists of open source software.

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) ๐ŸŒฑ

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
```


![cat](https://github-production-user-asset-6210df.s3.amazonaws.com/62666332/253642655-0438a9e1-d47d-4570-873c-5ddd59f46e9e.svg)