https://github.com/pfischer1687/vite-fastapi-starter
Full-stack web app template using Python, FastAPI, SQLAlchemy, Typescript, React, Vite, Tailwind, and PostgreSQL!
https://github.com/pfischer1687/vite-fastapi-starter
fastapi full-stack postgresql pyright python react ruff sqlalchemy starter tailwindcss template typescript uv vite
Last synced: 2 months ago
JSON representation
Full-stack web app template using Python, FastAPI, SQLAlchemy, Typescript, React, Vite, Tailwind, and PostgreSQL!
- Host: GitHub
- URL: https://github.com/pfischer1687/vite-fastapi-starter
- Owner: pfischer1687
- License: mit
- Created: 2025-09-17T06:23:46.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-04T19:28:16.000Z (9 months ago)
- Last Synced: 2025-10-19T07:51:13.815Z (8 months ago)
- Topics: fastapi, full-stack, postgresql, pyright, python, react, ruff, sqlalchemy, starter, tailwindcss, template, typescript, uv, vite
- Language: Python
- Homepage:
- Size: 297 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-fastapi-starter
A full-stack todo app you can use as a template for projects using Python, FastAPI, SQLAlchemy, Typescript, React, Vite,
Tailwind, and PostgreSQL!
---
## Table of Contents
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Running via Docker](#running-via-docker)
- [Running in Development](#running-in-development)
- [Linting and Testing](#linting-and-testing)
- [License](#license)
---
## Getting Started
### Prerequisites
- [Docker](https://www.docker.com/) for containerization
- [PostgreSQL](https://www.postgresql.org/) (running locally or via Docker)
- [uv](https://docs.astral.sh/uv/) for managing virtual environments, dependencies, and server builds
- [Python 3.13](https://www.python.org/downloads/) for development
- [Alembic](https://alembic.sqlalchemy.org/en/latest/index.html) for running database migrations
---
### Running via Docker
1. Clone the repo
```bash
git clone git@github.com:pfischer1687/vite-fastapi-starter.git
cd vite-fastapi-starter
```
2. Start the Docker containers (DB, server, and client)
```bash
docker compose up
```
3. Enter `localhost:3000` in your browser
---
### Running in Development
1. Compose the Postgres DB
```bash
docker compose up db
```
2. Set up Python virtual environment
```bash
cd server
uv venv --python 3.13
source .venv/bin/activate
pip install -r pyproject.toml --all-extras
```
3. Run the database migration via Alembic
```bash
cd server/src/todo
uv run alembic upgrade head
```
If you want to generate your own migrations after updating the DB models:
```bash
alembic revision --autogenerate -m ""
```
4. Start the server
```bash
uv run fastapi dev src/todo/main.py
```
5. Set up the client
```bash
cd client
npm install
npm run dev
```
6. Open `localhost:3000` in a browser
---
## Linting and Testing
You can lint the client with:
```bash
npx prettier . --write
```
and you can lint, format, and type check the server with:
```bash
uv run pre-commit run --all-files
```
and you can run the server's suite of unit tests with:
```bash
uv run pytest -s -vvv
```
---
## License
MIT License