Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Knight Hacks — Full-Stack Starter (Next.js + Python)

For teams that want a React frontend + a Python AI backend together. Best for projects with a UI and serious backend logic (ML models, APIs, data processing).

Architecture

frontend/   ← Next.js + Tailwind (your UI)
backend/    ← Python FastAPI (your AI/logic)

Quick Start

Terminal 1 — Backend:

cd backend
python -m venv venv
source venv/bin/activate      # Mac/Linux
venv\Scripts\activate         # Windows
pip install -r requirements.txt
cp .env.example .env          # add your API keys
python main.py

Terminal 2 — Frontend:

cd frontend
npm install
npm run dev

How They Talk

The frontend calls the backend via fetch:

const res = await fetch("http://localhost:8000/chat", {
  method: "POST",
  body: JSON.stringify({ prompt: "hello" })
});

Deploying

  • FrontendVercel (free, instant)
  • BackendRailway (free tier)
  • Update NEXT_PUBLIC_API_URL in frontend .env.local to point to your Railway URL

Tips

  • Keep API keys only in the backend .env — never in the frontend
  • Use the /api routes in Next.js if you want to proxy backend calls and hide your backend URL