Ecommerce App using Echo
We intend to develop an e-commerce application with a REST
architecture using the Echo framework. Echo is a Go web framework
known for its exceptional performance, extensibility, and
minimalistic design.
Prerequisites
Before starting up this project, make sure you have the necessary dependencies installed in your machine.
Software Installation
-
Go - Go is an open source programming language that makes it simple to build secure, scalable systems.
-
Docker - Docker helps developers bring their ideas to life by conquering the complexity of app development.
-
PostgreSQL - The World's Most Advanced Open Source Relational Database
-
golangci-lint - is a fast Go linters runner. It runs linters in parallel, uses caching, supports yaml config, etc.
For running Postgres locally using Docker, run the following command:
docker run --name ecommerce-local-db -p 5432:5432 -e POSTGRES_PASSWORD=******** -d postgres
Execute in Postgres DB Shell
create database ecommerce;
Database Schema
Environment Variables
Before launching the application, be certain to configure the necessary environment variables.
- JWT_SECRET
- DB_HOST
- DB_USERNAME
- DB_PASSWORD
- DB_NAME
- DB_PORT
Using Windows? Run the following command
Application Startup
Running App
make run
Building App
make build
Executing Tests
make test
REST Examples
You can find the Postman Collection/HTTP Client for GoLand under postman_httpclient
directory.
Docker
You have the option to retrieve the image from DockerHub.
Running Application in Local Kubernetes
Proceed with the instructions to launch your
application within a local Kubernetes cluster,
such as Docker Desktop or Minikube.
Before proceeding, make sure to update the ConfigMap.