FastAPI Backend Setup & Integration Guide
FastAPI Backend Setup & Integration Guide
Guide
For: MERN/Next.js Developer
Backend file: try.py (FastAPI)
Frontend: Next.js
Project Structure
college-recommender-backend/
│
├── try.py ← FastAPI backend
└── (optional) .env or README.md
👉
Now open this:
http://localhost:8000/docs ← Interactive API Explorer
next.config.js
module.exports = {
async rewrites() {
return [
{
source: "/api/chat",
destination: "http://localhost:8000/chat",
},
{
source: "/api/init_session",
destination: "http://localhost:8000/init_session",
},
// Add others as needed
];
},
};