https://github.com/shahidmalik4/fastapi-react-blog
A full-stack blog application built with React and FastAPI, featuring CRUD functionality, RESTful API integration, and modern UI using Bootstrap
https://github.com/shahidmalik4/fastapi-react-blog
blog bootstrap fastapi javascript python reactjs rest-api sqlalchemy sqlite3
Last synced: 3 months ago
JSON representation
A full-stack blog application built with React and FastAPI, featuring CRUD functionality, RESTful API integration, and modern UI using Bootstrap
- Host: GitHub
- URL: https://github.com/shahidmalik4/fastapi-react-blog
- Owner: shahidmalik4
- Created: 2025-07-24T09:16:17.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-24T09:24:04.000Z (11 months ago)
- Last Synced: 2025-07-24T13:23:25.462Z (11 months ago)
- Topics: blog, bootstrap, fastapi, javascript, python, reactjs, rest-api, sqlalchemy, sqlite3
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Blog App โ React + FastAPI
A **full-stack blog application** built with **React (Vite)** and **FastAPI**, supporting full **CRUD operations**, responsive UI with **Bootstrap**, and **SQLite** for persistent data storage. Clean architecture and RESTful design.
---
## ๐ Project Structure
```
project-root/
โ
โโโ backend/ # FastAPI backend
โ โโโ alembic/ # Alembic migrations
โ โโโ app/ # Core FastAPI application
โ โ โโโ crud.py # DB operations
โ โ โโโ database.py # DB setup
โ โ โโโ main.py # FastAPI app entry point
โ โ โโโ models.py # SQLAlchemy models
โ โ โโโ routes.py # API routes
โ โ โโโ schemas.py # Pydantic schemas
โ โ โโโ seed.py # Optional DB seed script
โ โโโ blog.db # SQLite database
โ โโโ requirements.txt # Python dependencies
โ
โโโ frontend/ # React frontend (Vite)
โ โโโ public/ # Static files
โ โโโ src/
โ โ โโโ assets/ # Images & styling
โ โ โโโ components/ # Reusable components (Navbar, BlogList)
โ โ โโโ pages/ # Page views (CreatePost, BlogDetail)
โ โ โโโ App.jsx # Main app component
โ โ โโโ main.jsx # React entry point
โ โโโ index.html # Base HTML file
โ โโโ package.json # JS dependencies
โ โโโ vite.config.js # Vite config
โ
โโโ .gitignore # Ignored files for Git
```
---
## ๐ Features
- โ
Create, Read, Update, Delete (CRUD) blog posts
- โ
RESTful API with FastAPI
- โ
React frontend built with Vite
- โ
Responsive UI using Bootstrap
- โ
SQLite for lightweight storage
- โ
Clean separation of frontend and backend
---
## ๐ฆ Tech Stack
| Frontend | Backend | Database | Styling | Others |
|----------------|----------------|----------|-----------|--------------|
| React (Vite) | FastAPI | SQLite | Bootstrap | Axios, Alembic |
---
## โ๏ธ Getting Started
### 1. ๐ฅ Backend Setup
```bash
cd backend
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload
```
### 2. โก Frontend Setup
```bash
cd frontend
npm install
npm run dev
```
- Frontend runs on: `http://localhost:5173`
- Backend runs on: `http://localhost:8000`
---
## ๐งช Example Routes (FastAPI)
| Method | Endpoint | Description |
|--------|------------------|------------------------|
| GET | `/blogs` | Fetch all blog posts |
| GET | `/blogs/{id}` | Get a single post |
| POST | `/blogs` | Create a blog post |
| PUT | `/blogs/{id}` | Update a blog post |
| DELETE | `/blogs/{id}` | Delete a blog post |
---