AI-Powered Lab Record Generator for Engineering Students
Generate perfect lab documentation with a single click. No more manual formatting!
| Feature | Description |
|---|---|
| 🤖 AI Generation | Automatically generates code, output, and theory using advanced AI models |
| 📄 DOCX Export | Download print-ready Word documents instantly |
| 🎨 Smart Formatter | Already have code? Paste it with screenshots to create formatted lab records |
| ☁️ Cloud Save | Save experiments to your dashboard for easy access |
| 🖨️ Ink Saver | Optimized output formatting to save printer ink |
| ⚡ Instant Generation | Get your complete lab record in under 30 seconds |
| 🆓 Freemium Model | Try 5 generations free as a guest, 20 credits on signup |
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- Database: MongoDB with Prisma ORM
- Authentication: Clerk
- AI Provider: Novita AI (MiMo-V2-Flash model)
- Document Generation: docx library
- UI Components: Radix UI + Lucide Icons
labsnap/
├── prisma/
│ └── schema.prisma # Database schema (User, Experiment, GuestUsage)
├── public/ # Static assets
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ ├── generate/ # AI generation endpoint
│ │ │ └── experiments/# Experiment CRUD operations
│ │ ├── dashboard/ # User dashboard (protected)
│ │ ├── format/ # Smart Formatter page
│ │ ├── generate/ # Main generation page
│ │ └── page.tsx # Landing page
│ ├── components/
│ │ ├── ui/ # Reusable UI components
│ │ ├── LabForm.tsx # Main experiment form
│ │ ├── FakeTerminal.tsx # Terminal output preview
│ │ └── ...
│ ├── lib/
│ │ ├── db.ts # Prisma client
│ │ ├── generateDoc.ts # DOCX generation logic
│ │ └── utils.ts # Utility functions
│ └── middleware.ts # Auth & route protection
├── .env.local # Environment variables
└── package.json
- Node.js 18.x or higher
- MongoDB database (local or Atlas)
- Clerk account for authentication
- Novita AI API key for AI generation
-
Clone the repository
git clone https://github.com/yourusername/labsnap.git cd labsnap -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# Database DATABASE_URL="mongodb+srv://<username>:<password>@<cluster>.mongodb.net/labsnap" # Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx CLERK_SECRET_KEY=sk_test_xxxxx NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up # AI Provider NOVITA_API_KEY=your_novita_api_key
-
Generate Prisma client
npx prisma generate
-
Push database schema
npx prisma db push
-
Start the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
- Go to the Generate page
- Fill in the experiment details:
- Experiment Number
- Date
- Subject (C++, Java, Python, DBMS, etc.)
- Aim of the experiment
- Name and Roll Number (optional)
- Click Generate
- Preview the code and terminal output
- Download as a formatted DOCX file
Already have your own code? Use the Smart Formatter:
- Paste your code
- Upload output screenshots
- Get a perfectly formatted lab record document
Sign in to access:
- Saved experiments
- Credit balance
- Re-download previous records
| Subject | Features |
|---|---|
| C++ | Code + Console Output |
| Java | Code + Console Output |
| Python | Code + Console Output |
| DSA | Code + Console Output |
| DBMS/SQL | Theory + Syntax + Code + ASCII Table Output |
Generate lab record content using AI.
Request Body:
{
"aim": "Write a program to implement bubble sort",
"subject": "C++",
"name": "John Doe",
"rollNo": "21CS101",
"mode": "full"
}Response:
{
"type": "coding",
"code": "// Source code here...",
"output_text": "// Console output here..."
}LabSnap uses Clerk for authentication:
- Guest Users: 5 free generations (tracked by IP)
- Signed-in Users: 20 credits on signup
- Protected Routes:
/dashboard,/api/experiments/*
- Next.js for the amazing framework
- Novita AI for AI inference
- Clerk for seamless authentication
- Tailwind CSS for beautiful styling
Made with ❤️ for Engineering Students