Component | Choice | Rationale |
---|---|---|
Auth | Firebase Auth (Google) | Fast setup, works great with React |
Frontend | React + TypeScript | Vite + Router + Tailwind |
Backend | FastAPI | Async, clean, Python-native |
Infra | GCP + Cloud Run | Scalable, cheap to start, full-stack-ready |
DB | AlloyDB (Postgres) | GCP-native Postgres |
Vector Store | Qdrant (Docker) | Simple, robust, local or hosted |
Monitoring | Prometheus + Grafana | Battle-tested observability stack |
Feature Flags | Statsig | Modern, integrates well across stack |
npm create vite@latest frontend -- --template react-ts
cd frontend
npm install
npm install react-router-dom
npm install firebase
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Set up:
tailwind.config.js
- Add Tailwind to
index.css
- Configure
firebase.ts
withinitializeApp(...)
-
Go to Firebase Console
-
Create a new project
-
Enable Authentication → Sign-in method → Google
-
Go to Project Settings → get
apiKey
,authDomain
, etc. -
Create
src/firebase.ts
:import { initializeApp } from "firebase/app"; import { getAuth, GoogleAuthProvider } from "firebase/auth"; const firebaseConfig = { apiKey: "xxx", authDomain: "xxx.firebaseapp.com", projectId: "xxx", }; const app = initializeApp(firebaseConfig); export const auth = getAuth(app); export const provider = new GoogleAuthProvider();
mkdir app && cd app
python -m venv venv && source venv/bin/activate # Use `venv\Scripts\activate` on Windows
pip install fastapi[all] uvicorn psycopg2-binary
Create main.py
:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def root():
return {"msg": "Hello world"}
You’ll run:
- FastAPI backend
- React frontend
- Postgres DB
- Optional: Qdrant vector store
Let me know and I’ll generate:
docker-compose.yml
Dockerfile
for React + FastAPI
In docker-compose.yml
:
vector-db:
image: qdrant/qdrant
ports:
- "6333:6333"
In FastAPI:
pip install qdrant-client sentence-transformers
Create services/embedding.py
with Qdrant wrapper class.
Use GCP services:
- Cloud Run: container deploy for API & optionally frontend
- Cloud SQL (AlloyDB): managed PostgreSQL
- Artifact Registry: store container builds
- Cloud Build or GitHub Actions: CI/CD
Use Docker locally:
-
prometheus.yml
config -
Mount metrics from FastAPI using:
pip install prometheus-fastapi-instrumentator
Expose metrics at /metrics
.
-
Use:
statsig.checkGate("new-feature")
Choose what you want dropped in next:
docker-compose.yml
Dockerfile.api
/Dockerfile.frontend
firebase.ts
auth handler- Qdrant integration
- Prometheus starter config
Let’s build it.