Skip to content

Sakthi-Developer/e-commerceapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛒 E-Commerce Backend API (Rust + Actix Web)

📌 Project URL on Roadmap.sh

This project is a simple backend for an e-commerce application built using Rust, Actix Web, and PostgreSQL. It supports user authentication, product browsing, shopping cart management, and checkout functionality.

🚀 Features

  • ✅ User Sign-Up & Login with JWT
  • ✅ Product Listing & Search
  • ✅ Add to Cart, View Cart, Remove Item from Cart
  • ✅ Checkout functionality
  • ✅ PostgreSQL integration using SQLx

🧱 Tech Stack

  • Backend: Rust, Actix Web
  • Database: PostgreSQL
  • Querying: Raw SQL queries via sqlx
  • Authentication: JWT

📦 API Endpoints

🔐 Authentication

Method Endpoint Description
POST /signUp Register new user
POST /logIn Login user

🛍️ Products

Method Endpoint Description
GET /product/all Get all products
GET /product/{id} Get product by ID
POST /search Search for a product

🛒 Cart

Method Endpoint Description
GET /create_cart Create a cart for a user
POST /addToCart Add product to user's cart
GET /myCart View all items in the cart
GET /flushCart Remove all items from cart
GET /removeItem-crat Remove an item or reduce qty

💳 Checkout

Method Endpoint Description
GET /checkout Proceed to checkout

🛠️ Getting Started

Prerequisites

  • Rust (latest stable)
  • PostgreSQL installed and running
  • sqlx-cli for database setup

Run the server

# Clone the repository
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name

# Set your environment variables in `.env`
DATABASE_URL=postgres://username:password@localhost/database
JWT_SECRET=your_secret_key
STRIPE_SECRET=stripe_secret_key

# Run the project
cargo run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages