Skip to content
piotrsacPublic

About

Full-stack e-commerce web app built with React and Flask, featuring authentication, product browsing, reviews, cart management, orders, and notifications.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

ShopShop

A full-stack e-commerce demo built with React and Flask, focused on the complete shopping flow: authentication, product browsing, reviews, cart management, checkout, order history, and notifications.

React TypeScript Flask SQLite

Overview

ShopShop is a compact but complete online store project that combines a React frontend with a Flask REST API backend. The application covers the main customer journey of a modern store: creating an account, logging in, exploring the catalog, filtering products, opening product details, leaving reviews, adding items to the cart, placing an order, and tracking post-purchase notifications.

The project is designed as a practical full-stack implementation rather than a static UI mockup. It includes persistent storage with SQLite, JWT-based authentication, seeded demo data, and a frontend that consumes the backend API directly.

Main Features

  • User registration and login with JWT access and refresh tokens
  • Product catalog with search and category filtering
  • Product details page with stock info and customer reviews
  • Add-to-cart flow with quantity selection
  • Checkout process that converts cart items into an order
  • Order history view for authenticated users
  • Notifications generated after checkout and mark-as-read support
  • Seed script that populates the app with demo products, users, and reviews

Home / Product Catalog

Zrzut ekranu 2026-03-09 173950

Product Details

Zrzut ekranu 2026-03-09 174433

Reviews

Zrzut ekranu 2026-03-09 174445

Cart / Checkout

Zrzut ekranu 2026-03-09 174241

Order History

Zrzut ekranu 2026-03-09 174301

Notifications

Zrzut ekranu 2026-03-09 174318

Authentication View

Zrzut ekranu 2026-03-09 174329

Tech Stack

Layer Technologies
Frontend React 19, TypeScript, React Router, React Bootstrap, Bootstrap, Lucide React
Backend Flask, Flask-SQLAlchemy, Flask-JWT-Extended, Flask-CORS
Database SQLite
Tooling Create React App, npm, Python virtual environment
External data source Fake Store API used by the seed script

Project Structure

PROJECT_WDAI/
├── backend/
│   ├── app/
│   │   ├── routes/
│   │   ├── __init__.py
│   │   ├── models.py
│   │   └── utils.py
│   ├── requirements.txt
│   ├── run.py
│   └── seed.py
├── frontend/
│   ├── public/
│   ├── src/
│   │   ├── api/
│   │   ├── components/
│   │   ├── hooks/
│   │   └── pages/
│   ├── package.json
│   └── tsconfig.json
└── README.md

How It Works

Frontend

The frontend is a React application responsible for routing, rendering the storefront, handling forms, and calling the backend API. Authentication state is stored in local storage and exposed through a custom auth hook. The UI includes pages for:

  • Home page with product discovery
  • Product details with reviews
  • Login and registration
  • Cart and checkout
  • Order history
  • Notifications

Backend

The backend is a Flask application exposing REST endpoints under the /api prefix. It uses SQLAlchemy models for users, products, reviews, cart items, orders, order items, and notifications. Authentication-protected routes rely on JWT tokens.

Main API groups:

  • /api/auth for register, login, and current user data
  • /api/products for catalog and review handling
  • /api/cart for cart operations
  • /api/orders for checkout and order history
  • /api/notifications for notification retrieval and read status updates

Database Model

The current data model includes the following main entities:

  • User
  • Product
  • Review
  • CartItem
  • Order
  • OrderItem
  • Notification

This covers the essential relationships needed for a basic e-commerce workflow.

Getting Started

Prerequisites

Make sure you have the following installed:

  • Python 3.10+ recommended
  • Node.js 18+ recommended
  • npm

Installation and Run

1. Clone the repository

git clone https://github.com/piotrsac/Web-Store
cd PROJECT_WDAI

2. Start the backend

Open a terminal in the backend directory.

cd backend
python -m venv .venv

Activate the virtual environment:

# Windows PowerShell
.venv\Scripts\Activate.ps1

# Windows CMD
.venv\Scripts\activate.bat

Install Python dependencies:

pip install -r requirements.txt

Initialize the SQLite database tables:

python -c "from app import create_app, db; app = create_app(); app.app_context().push(); db.create_all()"

Seed the database with demo content:

python seed.py

Run the Flask server:

python run.py

The backend should be available at:

http://127.0.0.1:5000

3. Start the frontend

Open a second terminal in the frontend directory.

cd frontend
npm install
npm start

The frontend should be available at:

http://localhost:3000

Demo Accounts

If you run the seed script, the following demo users are created:

Username Password Role
admin admin123 admin
prowadzacy password125 user
student1 student123 user

Seeded Data

The seed.py script does more than create users. It also:

  • downloads products from Fake Store API,
  • stores them in the local SQLite database,
  • creates sample reviews,
  • prepares the application for a ready-to-demo state.

This makes the project much easier to present locally without manual data entry.

Note: the seeding step requires internet access because products are fetched from Fake Store API.

Example User Flow

  1. Register a new account or log in with a seeded user.
  2. Browse products on the home page.
  3. Search by name or filter by category.
  4. Open a product page and read or add reviews.
  5. Add items to the cart.
  6. Complete checkout.
  7. Review created orders in order history.
  8. Open notifications and mark them as read.

Notes

  • The project currently uses SQLite for simplicity and local development speed.
  • CORS is enabled so the React frontend can communicate with the Flask backend during development.
  • The backend configuration is currently embedded directly in code, so no .env file is required to run the project in its present form.
  • This project is well suited for academic presentation, portfolio use, or as a base for further development.

Why This Project Stands Out

This repository is not just a frontend showcase. It demonstrates how UI, API design, persistence, authentication, and user flow connect into a single working product. It is a good example of an end-to-end full-stack application that is simple enough to understand quickly, but complete enough to present as a serious development project.

About

Full-stack e-commerce web app built with React and Flask, featuring authentication, product browsing, reviews, cart management, orders, and notifications.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages