It's an API of simple ecommerce to CRUD product and add image of product based on Echo framework.
-
Run the application using the command in the terminal:
make run-app
-
Browse to localhost:7788/swagger/index.html.
-
To get access to all feature product, you need to regist and login the account.
-
After the login, copy a token from the response, then click "Authorize", enter the value for "apiKey" in a form: "Bearer {token}". For example:
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTYzNTU4NDMwNiwiZXhwIjoxNjM1NTg3OTA2fQ.s5hFizdpccvA6cM6p--RhiD81qUpn_typ3LwAJgPbVU
-
To see uploads image, go to path
localhost:7788/uploads/{filename}
- Registration
- Authentication with JWT
- CRUD API for product
- Upload Image of product
- Migrations
- Swagger docs
- Docker development environment
- Language: Go
- Framework: Echo
- Authentication: jwt-Go
- Database: MySQL
- ORM: GORM
- Migration: Go-mirations
- Mock: Mocking db
- API Docs: Swagger
- Container: Docker
The architecture is heavily influenced by the Clean Architecture and Hexagonal Architecture. Clean Architecture is an architecture where the business rules can be tested without the UI, database, web server, or any external element.