This project is a rest api for ecommerce application written in golang with some tests and uses gofiber, gorm, postgres, swagger docs, jwt.
- create database first in postgres, data for running tests are also required.
- uuid-ossp extension for postgres require. run on psql --> CREATE EXTENSION "uuid-ossp";
- create .env file in root directory of the project
- add below lines in .env file
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=123456
DB_NAME=ecomm_alpha
SECRET=asd
- run command: go run main.go
-
for available tests, run commands : \
go test .\tests\sellertests\ -v
go test .\tests\addresstests\ -v
go test .\tests\storetests\ -v
go test .\tests\producttests\ -v
go test .\tests\buyertests\ -v
go test .\tests\carttests\ -v
go test .\tests\ordertests\ -v