Categorygithub.com/kennizen/e-commerce-backend
repository
0.0.0-20240930070721-16db33d32d6d
Repository: https://github.com/kennizen/e-commerce-backend.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

E-Commerce Backend API's (Dummy)

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.

Backend Features

  • 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) šŸ‘®.

Steps to get going

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.git

The following are the ports used by the application so make sure nothing is already bound to them.

Ports - 8080, 5433, 6600, 6601

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 build
docker compose up

Wait 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.

For API docs type the following into the browser's url.

http://localhost:8080/swagger/index.html#/

For opening Dozzle visit

http://localhost:6600/dozzle/

For using the PgAdmin visit the following URL

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.