Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1.15 KB

File metadata and controls

56 lines (41 loc) · 1.15 KB

Python + React

A full-stack app where a Flask backend serves a Vite-built React frontend — one process, one port.

Quick Start

# Install dependencies
pip install -r requirements.txt
cd frontend && npm install && npm run build && cd ..

# Run
python app.py

Open http://localhost:5000.

Project Structure

├── app.py              # Flask backend (serves React + API)
├── requirements.txt    # Python dependencies
└── frontend/
    ├── package.json    # React/Vite dependencies
    ├── vite.config.js  # Dev proxy config
    ├── index.html
    └── src/
        ├── main.jsx
        ├── App.jsx
        ├── App.css
        └── index.css

API

Endpoint Description
GET /api/hello Returns a JSON greeting

Development

For hot-reload during frontend development:

# Terminal 1 — Flask API
python app.py

# Terminal 2 — Vite dev server (proxies /api to Flask)
cd frontend && npm run dev

Rebuild before running in production mode:

cd frontend && npm run build