AI-powered quiz and lesson generator for last-minute revision - completely free! 🚀
- Inspiration
- File Structure
- What it does
- How I built it
- Setup Instructions
- Prerequisites
- Installation
- Getting API Keys
- Tech Stack
- Contributing
- What's next for Learningo
As a high school student, One of my struggles is last minute revision. Thinking about this Problem, I developed a solution for it.
I've noticed similar apps, but I've noticed they're like $5-10/mo, which is a lot in India considering I'm a student. I realized if I develop the app myself, it would cost me <$1 in AI Costs(For my personal use), if I exceed the free tier.
learningo/
├── src/
│ ├── actions/
│ │ ├── generate.ts
│ │ ├── lessons.ts
│ ├── app/
│ │ ├── auth/
│ │ │ └── sign-in/
│ │ ├── api/
│ │ │ ├──auth/
│ │ │ │ └── all/
│ │ │ └── sentry-example-api/
│ │ ├── course/
│ │ │ └──id/
│ │ ├── dashboard/
│ │ ├── generate/
│ │ │ ├── id/
│ │ ├── lesson/
│ │ │ └── id/
│ ├── components/
│ │ ├── home/
│ │ ├── lesson/
│ │ └── ui/
│ ├── db/
│ ├── emails/
│ ├── lib/
│ └── styles/
├── .gitignore
├── auth-schema.ts
├── components.json
└── CONTRIBUTING.md
├── drizzle.config.ts
├── eslint.config.mjs
├── LICENSE
├── next.config.ts
├── package.json
├── pnpm-lock.yaml
├── postcss.config.mjs
├── README.md
├── sentry.edge.config.ts
├── sentry.server.config.ts
└── tsconfig.json
The Web App, Powered by Gemini Generates Lessons & Questions based on your topic, and helps you revise with MCQ Questions.
I Used Next.js, which is a React.js framework to build it. How it works is when you go to sign-in route, It is using Magic links for authentication, powered by better-auth0, and uses resend1 to send the email. After verification, you'll be signed in, where you can generate a lesson. When you generate a lesson, it is using the Vercel's AI SDK2 to generate Lessons with Gemini API3 which'll then display in the Home Page. You can click any lesson on Home page, and once you click, It'll generate Questions using the same way, and then you can practice.
- Node.js 18+ installed
- pnpm package manager (
npm install -g pnpm) - A PostgreSQL database (or use a service like Neon, Supabase, etc.)
- Google Gemini API key
- Resend API key for email authentication
-
Clone the repository
git clone https://github.com/anay-208/learningo.git cd learningo -
Install dependencies
pnpm install
-
Set up environment variables
Create a
.env.localfile in the root directory with the following variables:# Database DATABASE_URL="your_postgresql_connection_string" # Better Auth BETTER_AUTH_SECRET="your_secret_key_here" BETTER_AUTH_URL="http://localhost:3000" # Resend (for magic link emails) RESEND_API_KEY="your_resend_api_key" # Google Gemini AI GOOGLE_GENERATIVE_AI_API_KEY="your_gemini_api_key" # Sentry (optional - only needed if you want error tracking) # Leave this unset for local development to prevent sending alerts NEXT_PUBLIC_SENTRY_DSN="your_sentry_dsn_url"
-
In the production, Vertex AI is used, which most of the people likely won't use, so feel free to change the code in your local system to use it
-
Set up the database
pnpm db:push
-
Run the development server
pnpm dev
-
Open your browser
Navigate to http://localhost:3000
- Gemini API: Get your free API key from Google AI Studio
- Resend API: Sign up at Resend for email services
- Database: You can use Neon, Supabase, or any PostgreSQL provider
- Framework: Next.js 15
- Language: TypeScript
- Database: PostgreSQL with Drizzle ORM
- Authentication: Better Auth with Magic Links
- AI: Google Gemini API via Vercel AI SDK
- Email: Resend
- Styling: Tailwind CSS
- UI Components: shadcn/ui
We welcome contributions for Hacktoberfest and beyond! Please read CONTRIBUTING.md for guidelines on how to contribute to this project.
As of now, the app will remain completely free.