Simple app product order with Echo HTTP Response Framework, GORM for Object relation model, PostgreSQL for database.
This Backend Application is used for simple order product, in this application there are two models / ERD Schema likes User / Costumer & Products. Also have several features like JWT, Authentication & Authorization. There are 3 main modules :
- Customer Management (Get with paginate, Get Detail, Insert, Update, Delete, Search)
- Order Management (Get with paginate, Get Detail, Insert, Update, Delete, Search)
- Authentication Management (Get Login Data, Insert Login Data)
Notes : 1In this application there are two types of users (Roles). admins and costumer. Admin can do Costumer Management but Role Costumer can't, Registration page can only register Costumer roles, Admins can only be registered through seeding data.
1. go run . serve //to run the app / server
2. go run . migrate -u //for database migration
# or
go run . migrate -d //for rollback
3. go run . seed // to seeding data Role admin if u want Email : "admin@gmail.com" Pass : admin12345678
- Clone the repository
https://github.com/adiet95/costumer-order.git
- Install dependencies
go mod tidy
Wait a minute, if still error run
go mod vendor
- Add Env File
DB_USER="postgres"
DB_HOST="localhost"
DB_NAME="go-order"
DB_PASS="root"
JWT_KEYS="Rahasiaaaa"
PORT=":8080"
DB_PORT="5432"
- Database Migration and Rollback
go run main.go migrate --up //for database migration table
# or
go run main.go migrate --down //for rollback the database
- Seeding data admin
go run . seed
Purpose to login as Admin's Role
{
"email": "admin@gmail.com",
"password": "admin12345678"
}
- Run the app
go run . serve
API Documentation <- Click Link
- Linkedin : Achmad Shiddiq