Skip to content

AbdulRehman-z/ecommerce-golang-fiber-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce implemented with fiber(v2)

This is e-commerce backend implemented with fiber(v2) and mongodb. It is a simple e-commerce backend with basic features.

Features

  • User jwt authentication with argon2 password hashing
  • User roles (admin, user)
  • User profile
  • User cart
  • User orders
  • Product CRUD
  • Admin routes

Routes

Auth Routes

  • POST /api/v1/auth/signup (signup)
  • POST /api/v1/auth/signin (signin)
  • POST /api/v1/auth/signout (signout)
  • POST /api/v1/auth/profile (get user profile)

Product Routes

  • GET /api/v1/products (get all products)
  • GET /api/v1/products/:id (get product by id)
  • POST /api/v1/products/create (create product) -- admin only
  • PUT /api/v1/products/:id (update product) -- admin only
  • DELETE /api/v1/products/:id (delete product) -- admin only

Cart Routes

  • POST /api/v1/cart/remove/:id (remove product from cart)
  • POST /api/v1/cart/add/:id (add product to cart)

Order Routes

  • POST /api/v1/orders (get all orders)
  • POST /api/v1/orders/create (create order)

Admin Routes

  • GET /api/v1/admin/getUsers (get all users) -- admin only
  • GET /api/v1/admin/getUser/:id (get user by id) -- admin only
  • GET /api/v1/admin/deleteUsers (delete all users) -- admin only
  • GET /api/v1/admin/delete/:id (delete user by id) -- admin only

How to work with this repo

  • Clone the repo
  • Run go mod tidy to install all the dependencies
  • Run go run . to start the server

License

This project is licensed under the MIT License - see the LICENSE file for details

Releases

No releases published

Packages

No packages published

Languages