BrainLeaf is an AI-powered SaaS that transforms PRD (Product Requirement Documents) into structured learning materials:
- 📄 Smart summaries\
- 🧠 Revision sheets\
- ❓ Auto-generated quizzes
Built with a modern fullstack architecture using React (Vite), Fastify, and Prisma.
- React
- Vite
- TypeScript
- Fastify
- Prisma ORM
- PostgreSQL (recommended) or SQLite (dev)
- OpenAI API (or compatible LLM provider)
brainleaf/ │ ├── backend/ │ ├── prisma/ │ │ ├── schema.prisma │ │ └── migrations/ │ ├── src/ │ ├── package.json │ └── .env.example │ ├── frontend/ │ ├── src/ │ ├── package.json │ └── .env.example │ └── README.md
git clone https://github.com/your-username/brainleaf.git cd brainleaf
cd backend npm install
Create environment file:
cp .env.example .env
Fill in:
DATABASE_URL= OPENAI_API_KEY= JWT_SECRET=
Run Prisma:
npx prisma migrate dev npx prisma generate
Start backend:
npm run dev
Backend runs on: http://localhost:3000
cd ../frontend npm install
Create environment file:
cp .env.example .env
Fill in:
VITE_API_URL=http://localhost:3000
Start development server:
npm run dev
Frontend runs on: http://localhost:5173
- PRD file upload
- AI-generated summaries
- Revision sheet generation
- Quiz generation
- Structured content output
- Modular backend architecture
- Clean React UI with Vite
Variable Description
DATABASE_URL Database connection string OPENAI_API_KEY AI provider API key JWT_SECRET Secret key for authentication
Variable Description
VITE_API_URL Backend API URL
npm run build npm start
npm run build
Deploy the generated dist/ folder.
.envfiles are ignored by Git- Never commit API keys
- Use strong JWT secrets
- Enable HTTPS in production
- Use a managed database in production
- Authentication system
- File storage (S3 / cloud storage)
- Stripe subscription integration
- Dashboard analytics
- Multi-document workspace
- Role-based access control
MIT License