This repository contains a Go application for managing products and their prices, including functionalities for CRUD operations and seeding the database with initial data.
-
cmd/: Contains the main application and seed command entry points.
server/main.go: The main application entry point, serves the REST API.seed/main.go: Command to seed the database with initial product data.
-
app/: Contains the application logic.
-
sql/: Contains a very simple database migration scripts setup.
-
models/: Contains the data models and repositories used in the application.
-
.env: Environment variables file for configuration.
- Create a github/bitbucket/gitlab repository and push all this code as-is.
- Create a new branch, and provide a pull-request against the main branch with your changes. Instructions to follow.
- Ensure you have Go installed on your machine.
- Ensure you have Docker installed on your machine.
- Important makefile targets:
make tidy: will install all dependencies.make docker-up: will start the required infrastructure services via docker containers.make seed:⚠️ Will destroy and re-create the database tables.make test: Will run the tests.make run: Will start the application.make docker-down: Will stop the docker containers.
Follow up for the assignemnt here: ASSIGNMENT.md