This project is a Go-based REST API that offers a variety of endpoints designed to supply data for integration with the Double Track Recommendation Web.
- Go 1.22
- Chi (HTTP Router)
- SQLx (database library)
- Viper (configuration management)
- Air (hot reload for development)
- PostgreSQL (database)
To run the project with Docker Compose, follow these steps:
- Start the PostgreSQL Docker container by running:
docker-compose up -d db
- Run database migrations and seed data by executing:
go run cmd/database/migrations/up/main.go && go run cmd/database/seeder/main.go
- Finally, launch the application using Docker Compose:
docker-compose up api
This will start the application in a Docker container, allowing you to interact with the REST API. You can interact with the API by navigating to https://localhost:8080.
To run the project in development mode, follow these steps:
- Make sure you have installed air for hot reload. Refer to air docs for installation instructions.
- Run the following command to start the application with air:
air
This will launch the application with hot reload enabled, allowing you to make changes to the code and see them reflected in real-time without restarting the server.