This project is an example of an Online Book Store. It's designed to demonstrate how to create a backend API using Go programming language and a Postgres database to store book and order information.
These instructions will guide you through getting a copy of the project up and running on your local machine for development and testing purposes.
Before you begin, ensure you have Docker installed on your machine. Docker is required to run the Postgres database in a container.
Follow these steps to get your development environment running:
-
Clone the repository
-
From terminal, navigate to the project directory
-
Build the application:
make build
- Start the Postgres database:
make run-db
- This command starts a PostgreSQL container in the background.
- Init the database migration tables,
make
command:
make db cmd=init
- Migrate and seed the database:
make db cmd=migrate
- Start the application:
make run
The Swagger documentation for the API is available at http://localhost:8080/docs once the application is running. This documentation provides a detailed overview of the available API endpoints, their parameters, and responses.
Visit the Makefile
in the root dir to see all available commands.
- Go - The programming language used.
- Bun - ORM for Go.
- Echo - Web framework for Go.
- PostgreSQL - Database Management.
- Docker - Containerization.