user-service-go
user-service-go copied to clipboard
User management microservice written in Go with Postgres
user-registration-service-go
- Simple user registration microservice written in Go with Postgres database.
- Uses clean architecture to accept requests from exposed API's and persist in database.
- Flow : API --> Controller --> Service --> Business --> Database
Running the server
- Dev mode (default)
go run main.go
- Prod mode
go run main.go --mode prod
Config
- All the server config is read from
/config/config.{mode}.json
List of API's
Method | Endpoint | Payload | Response | Description |
POST | /user/signup |
|
|
New user signup |
POST | /user/login |
|
|
User login |
GET | /user/{id} |
|
Get user by `id` | |
GET | /org/{id} |
|
Get org by `id` |
Packages used
-
GORM
- Database ORM -
VIPER
- Environment variables -
MUX
- HTTP Router
TODO
- Add server events logging (info, success, warn, error).
- Graceful server shutdown
- Add JWT authentication.
- Add logout functionality.
- Add user update and delete functionality.
- Add org update and delete functionality.
License
MIT