This repository represents an online e-commerce platform backend system written in Go that is solely made to make frontend mockups and designs for generic use cases.
This repository does not contain complex APIs but simple CRUD APIs as a base.
- Pre-seeded with 190+ product data 🛒.
- User authentication with JWT 🔐.
- Custom middleware for logging user requests 📰.
- Rotating refresh token strategy 🔑.
- Payload validation ✅.
- Monitoring and logging with Dozzle 🖥️.
- API docs with Swagger 🗎.
- Live reloading with Go AIR 🔃.
- Containerized with Docker 🐳.
- Postgres as the database 🐘.
- PgAdmin (for folks wanting to view the database design and the data in the browser) 👮.
Make sure to have Docker installed on your system. If not, you can follow this link to get it installed. With that done, clone the repository into your local machine.
git clone https://github.com/kennizen/e-commerce-backend.gitThe following are the ports used by the application so make sure nothing is already bound to them.
Once the repository is cloned, start by typing these commands into your terminal. Make sure you are at the root of the project.
docker compose builddocker compose upWait for docker to finish setup and you should see after all the logs that.
🚀🚀🚀 Server started on host port 8080.
If all the above steps are successful then the database is created, product data is seeded into the database, all the necessary migrations are done and you are good to go.
http://localhost:8080/swagger/index.html#/
http://localhost:6600/dozzle/
http://localhost:6601/login?next=/
You will be greeted with a login screen with username and password both of which can be found in the .env file of the project as PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD.
Once you enter PgAdmin click on Add New Server then under General provide a name for your connection. Then move to Connection tab there Host name/address will be postgres as the database is running inside docker so this is the container's name. Maintenance database will be ecommerce. Username and Password will be postgres. Save the connection and you should be connected to the database inside docker.
So there you have it. Now you can start creating your beautiful frontend mockups for an e-commerce application.