Welcome to the Walmart Ecommerce API built with Go. In this document, I document the project features, considerations made and things that could be improved.
This is an Ecommerce API built with Go (Golang). I chose go because of it's shear speed, performance and simplicity. Furthermore, my primary tech stack is mostly composed of Python, TypeScript, JavaScript and Go. Having used express, nestjs, flask and fastAPI, I decided to build a project with Go Fiber which boasts itself as the fastest go Rest Framework. For data storage, I decided to use MongoDB which is a NoSQL database suitable for datasets that may vary over time and it's vast search ability.
-
User Management
-
User Authentication with JWT and cookies
-
User Authorization & http middleware
-
Product Management & Rating
-
Saved Carts to allow synchronization.
-
Saved Products (Favorite Products)
-
HTTP Request data validation
-
Golang: The Ecommerce backend is powered by Go. Go is leading in the development of cloud products and services.
-
Fiber: Fiber is a Go web framework built on top of Fasthttp, the fastest HTTP engine for Go. It's designed to ease things up for fast development with zero memory allocation and performance in mind.
-
MongoDB: Mongo is a modern NoSQL database suitable for datasets that may vary over time and it's vast search ability
To run this server, you need to clone the repo to your local environment.
git clone https://github.com/efenstakes/walmart-api-go api
Navigate to the folder.
cd ./api
Install dependencies
go get .
Create a .env
and set the below values:
-
PORT
the port the API runs on -
JWT_SIGNING_KEY
The JWT signing key used to sign JWT tokens -
DB_URI
Mongo db instance URI (from docker, local mongo compass or cloud)
Run the Go Fiber server with:
go main.go
Happy building :(.
If you wish to contact me, use my email efenstakes101@gmail.com.