This is my portfolio project that simulates the backend operations of a simple e-commerce platform. It's built using Golang, and leverages gRPC and gRPC-Gateway for efficient, strongly-typed, and easily-scalable API endpoints.
Golang: Backend implementation
gRPC: API design and communication
gRPC-Gateway: To expose the gRPC API over HTTP/REST
PostgreSQL: Database
Docker: Containerization and dependency management
-
brew install golang-migrate
-
brew install sqlc
Clone the repository
git clone https://github.com/theme-ce/simple-shop.git
Navigate to the project directory
cd simple-shop
Start the PostgreSQL Docker container
make postgres
Create the database
make createdb
Run migrations
make migrateup
Running the Server Generate SQL and Protobuf Code
make sqlc proto
Start the server
make server
Test
make test
The database schema is available for public viewing at Dbdocs.
Once the server is running, the API documentation can be accessed through Swagger UI at http://localhost:8080/swagger.
This project uses gomock for creating mock objects and assertions in the unit tests. Gomock provides a flexible and convenient way to add mock testing to your Golang application.