Skip to content

youneshenniwrites/fastapi-next-ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

🛒 E-commerce App (FastAPI + Next.js + AWS)

📖 Overview

This is a full-stack e-commerce web application built with FastAPI (backend) and Next.js (frontend). The project demonstrates modern full-stack practices including:

  • Type-safe React frontend with TypeScript
  • Scalable RESTful APIs with FastAPI
  • PostgreSQL (AWS RDS) as the database
  • Redis caching for performance
  • AWS ECS Fargate for containerized deployment
  • CI/CD with GitHub Actions
  • Monitoring with Sentry + CloudWatch

🏗️ Architecture

Core

  • Frontend: Next.js (React + TypeScript)
  • Backend: FastAPI (Python)
  • Database: PostgreSQL (AWS RDS)
  • Deployment: AWS ECS Fargate + ECR
  • CI/CD: GitHub Actions

Advanced

  • Cache: Redis
  • Secrets Management: AWS Secrets Manager
  • Monitoring/Logging: Sentry, CloudWatch
  • Search: Elasticsearch (optional)
  • Domain & TLS: Route 53 + AWS ACM

🔧 Features

  • User registration & login (JWT auth)
  • Product catalog (CRUD)
  • Shopping cart
  • Checkout flow (with order persistence)
  • Basic admin panel (manage products)
  • API documentation auto-generated by FastAPI (Swagger UI)
  • Unit & integration tests (pytest + Jest/RTL)

⚙️ Tech Stack

Frontend

  • Next.js
  • React
  • TypeScript
  • Jest + React Testing Library

Backend

  • Python
  • FastAPI
  • SQLAlchemy + Alembic
  • PostgreSQL
  • Redis
  • pytest

DevOps / Infra

  • Docker & Docker Compose
  • AWS ECS Fargate
  • AWS RDS (PostgreSQL)
  • AWS Secrets Manager
  • AWS CloudWatch
  • GitHub Actions

🚀 Getting Started

Prerequisites

  • Node.js (>=18)
  • Python (>=3.10)
  • Docker & Docker Compose
  • AWS account

Clone the Repo

git clone https://github.com/your-username/fastapi-next-ecommerce.git
cd fastapi-next-ecommerce

Run Locally (Docker Compose)

docker-compose up --build

Frontend: http://localhost:3000 Backend: http://localhost:8000/docs


🧪 Testing

Backend (pytest)

cd backend
pytest

Frontend (Jest + RTL)

cd frontend
npm test

🔄 CI/CD

  • PRs trigger GitHub Actions pipeline:

    • Run tests (frontend + backend)
    • Build Docker images
    • Push to AWS ECR
    • Deploy to ECS Fargate

📊 Monitoring

  • Sentry for error tracking
  • AWS CloudWatch for logs & metrics

🔐 Security

  • Secrets managed via AWS Secrets Manager
  • HTTPS enabled via AWS ACM + Route 53 + ALB

📂 Project Structure

/frontend     -> Next.js app
/backend      -> FastAPI app
/infra        -> Terraform/CDK scripts (infra as code)
/.github      -> CI/CD workflows

🛣️ Roadmap

  • Core CRUD APIs
  • Auth & JWT
  • Cart & Checkout
  • Admin panel
  • CI/CD pipeline
  • Monitoring & logging
  • Advanced search (Elasticsearch)

About

Full-stack e-commerce web application built with FastAPI (backend) and Next.js (frontend).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published