Backend API service for DiscountDB - the open-source coupon and discount database.
- Language: Go
- Cache: Redis
- Database: PostgreSQL
- API Documentation: Swagger/OpenAPI
- Go 1.21+
- Docker and Docker Compose
- swag (for API documentation)
git clone https://github.com/ImGajeed76/discountdb-api.git
cd discountdb-apigo mod downloadcp .env.example .envConfigure the following in your .env:
- PostgreSQL connection details
- Redis connection details
# Install swag if you haven't already
go install github.com/swaggo/swag/cmd/swag@latestswag init -g ./cmd/api/main.goTo simplify the setup of Redis and PostgreSQL, use the provided docker-compose.yml file:
- Start the services using Docker Compose:
docker-compose up -dThis 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- Ensure Docker is running and the containers are healthy (
docker psto check their status). - If ports 5432 or 6379 are already in use, update the
docker-compose.ymlfile to use different host ports.
To stop the services:
docker-compose downThis 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.
- DiscountDB Frontend - Main repository containing the SvelteKit frontend
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Submit a pull request
For questions and support:
- Open an issue
- Visit the main project repository