- Signup(
/signup
) POST - Signin(
/signin
) POST
- Query Products(
/products
) GET - Query Product By Id(
/products/:id
) GET - Create Product(
/products
) POST - Update Product(
/products/:id
) PUT - Delete Product(
/products/:id
) DELETE
- Query Categories(
/categories
) GET - Create Category(
/categories
) POST - Update Category(
/categories/:id
) PUT - Delete Category(
/categories/:id
) DELETE
- Query Orders(
/orders
) GET - Create Order(
/orders
) POST
This project use air to live reload. If you are familiar with nodemon
the concept is same but air
is built with Go.
Rename .air.example.toml to .air.toml and modify DB_HOST
and DB_NAME
properly.
full_bin = "DB_HOST=localhost:27017 DB_NAME=dermacare ./tmp/main"
Then run
make generate-private-key && make generate-public-key
to generate public
and private
keys pair. After that, you can just run air
in the root of your project directory.
To run the application inside container you need to do these things.
- Copy
.env.example
insidezarf/docker
to.env
file. - Create a docker network called
dermacare
by running this commanddocker create network dermacare
. - Since containers(one for
database
and one forapplication
) are running within the same network, they can connect each other by their name. update theDB_HOST
inside.env
to
DB_HOST=db:27017
DB_NAME=YOUR_DB_NAME
Note
db
is come fromservices
name which declare insidedocker-compose.yaml
.
- Run
make start
. This command will builddermacare-service:tag
image and will start the application. - Server is running on port
3000
.
Unit tests can be run for specific folder or can be run at root level. To run unit test for specific folder, go to the folder and enter command
go test -v
Note
-v
flag is for verbose
To run all unit tests run this command at root level
make test
- Add Unit Test for Data Layer.
- Support search(filter) in all query services.
- Indexing on email fields to prevent duplicate email.
- Add other services
- Analytic, Summary
- Excel Export
- Rotating Secret
- Embed Admin UI to Binary