By the end of this tutorial you will have a working full-stack e-commerce application with:
A Flask REST API (products, auth, orders, admin)
A React + Vite frontend (shop, cart, account, orders, admin dashboard)
bcrypt password hashing
SQLite database (zero config, runs locally)
A cart persisted in localStorage
No prior Flask or React experience is assumed, but you should be comfortable running commands in a terminal.
Table of Contents
Project Structure
Backend — Flask
Install & bootstrap
Database setup
Auth routes
Product routes
Checkout & orders
Admin routes
Full backend code
Frontend — React + Vite
Create the project
App shell
Pages
Full frontend code
Running the app
Security checklist before going live
Project Structure
ecommerce/ ├── app.py ← entire Flask backend ├── shop.db ← SQLite DB (auto-created on first run) └── frontend/ ├── index.html └── src/ ├── api.js ├── main.jsx ├── App.jsx └── pages/ ├── Home.jsx ├── Shop.jsx ├── Cart.jsx ├── Account.jsx ├── Orders.jsx └──…