Categorygithub.com/BrunoPolaski/go-crud
modulepackage
0.0.0-20240815175617-ba15e7aa3931
Repository: https://github.com/brunopolaski/go-crud.git
Documentation: pkg.go.dev

# README

GoLang API Rest

A users Rest API using Go with the MVC architectural pattern, along with a login that verifies the user credentials. The create user method encrypts with jwt before saving in MongoDB, then the user is able to login.

Main tools

MongoDB JWT Docker

Other tools inside this project

  • Gin
  • Testify
  • Gomock
  • Zap

Status

Build status

Initializing without Docker

If you don't have docker installed, you can install Mongo and MongoExpress, create a collection and start to use it by running the application with:

go mod download
go run main.go

Initializing with Docker

To start the app, mongo and mongo-express, make sure you have docker installed and simply run in the terminal:

docker compose up

And you will be ready to go!

After this, you can create a user with:

curl --json '{
	"email": "[email protected]",
	"name": "John",
	"age": 22,
	"password": "Chewbacca@777"
}' localhost:8080/user

And log in the server with:

curl -u <username>:<password> localhost:8080/auth/login

Testing

To test the app, you must run the following command in the terminal:

go test -v ./...

# Packages

No description provided by the author