Open-source Go backend API for DiscountDB - a coupon and discount database with PostgreSQL and Redis.
Backend API service for DiscountDB - the open-source coupon and discount database.
git clone https://github.com/ImGajeed76/discountdb-api.git
cd discountdb-api
go mod download
cp .env.example .env
Configure the following in your .env:
# Install swag if you haven't already
go install github.com/swaggo/swag/cmd/swag@latest
swag init -g ./cmd/api/main.go
To simplify the setup of Redis and PostgreSQL, use the provided docker-compose.yml file:
docker-compose up -d
This will spin up Redis and PostgreSQL containers.
Once Redis and PostgreSQL are running via Docker Compose, you can run the API:
go run cmd/api/main.go
docker ps to check their status).docker-compose.yml file to use different host ports.To stop the services:
docker-compose down
This will stop and remove the containers.
This project is licensed under the GNU General Public License v3 (GPL-3.0). See the LICENSE file for details.
For questions and support: