Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevTrack AI β€” Smart Learning Tracker for Developers

DevTrack AI Next.js TypeScript PostgreSQL Tailwind CSS

A full-stack AI-powered learning tracker built for developers. Create topics, write or generate notes with AI, take quizzes, and track your progress β€” all in one place.


πŸ“Έ Features

  • πŸ‘€ Authentication β€” Secure signup/login with better-auth
  • πŸ“š Topics System β€” Create, manage, and delete learning topics
  • πŸ“ Notes β€” Add notes manually or generate them using AI
  • πŸ“Š Progress Tracking β€” Mark topics as Not Started / In Progress / Completed with a progress slider
  • πŸ€– AI Integration β€” Generate structured notes and quizzes powered by Groq (LLaMA 3.3)
  • 🎯 Interactive Quizzes β€” Test your knowledge with AI-generated multiple choice questions

πŸ›  Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript
Styling Tailwind CSS + shadcn/ui
Database PostgreSQL
ORM Drizzle ORM
Auth better-auth
AI Groq API (LLaMA 3.3 70B) via Vercel AI SDK
Package Manager pnpm

πŸ“ Project Structure

devtrack-ai/
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/                   # Login & Signup pages
β”‚   β”‚   β”œβ”€β”€ login/page.tsx
β”‚   β”‚   └── signup/page.tsx
β”‚   β”œβ”€β”€ (dashboard)/              # Protected dashboard routes
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Sidebar + header shell
β”‚   β”‚   β”œβ”€β”€ dashboard/page.tsx    # Overview with stats
β”‚   β”‚   β”œβ”€β”€ topics/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx          # All topics list
β”‚   β”‚   β”‚   └── [topicId]/page.tsx # Topic detail + notes
β”‚   β”‚   └── settings/page.tsx
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ auth/[...all]/        # better-auth handler
β”‚   β”‚   β”œβ”€β”€ topics/               # Topics CRUD
β”‚   β”‚   β”‚   └── [topicId]/
β”‚   β”‚   β”‚       └── notes/        # Notes CRUD
β”‚   β”‚   └── ai/
β”‚   β”‚       β”œβ”€β”€ generate-notes/   # AI note generation
β”‚   β”‚       └── generate-quiz/    # AI quiz generation
β”‚   β”œβ”€β”€ layout.tsx
β”‚   └── page.tsx                  # Landing page
β”‚
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                       # shadcn components
β”‚   β”œβ”€β”€ topics/                   # TopicCard, CreateTopicDialog, ProgressControl
β”‚   β”œβ”€β”€ notes/                    # NoteCard, AddNoteForm, GenerateNotesButton
β”‚   β”œβ”€β”€ ai/                       # QuizModal
β”‚   └── shared/                   # Sidebar, Header
β”‚
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ db/
β”‚   β”‚   β”œβ”€β”€ index.ts              # Drizzle client
β”‚   β”‚   └── schema.ts             # Database schema
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ index.ts              # better-auth server config
β”‚   β”‚   └── client.ts             # Auth client helpers
β”‚   └── ai/
β”‚       └── index.ts              # Groq AI client
β”‚
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useTopics.ts
β”‚   └── useNotes.ts
β”‚
β”œβ”€β”€ types/index.ts
β”œβ”€β”€ middleware.ts                  # Route protection
└── drizzle.config.ts

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm
  • PostgreSQL database (local or Neon β€” free cloud option)
  • Groq API key β€” free, no credit card needed

1. Clone the repository

git clone https://github.com/yourusername/devtrack-ai.git
cd devtrack-ai

2. Install dependencies

pnpm install

3. Set up environment variables

Create a .env.local file in the root:

# Database
DATABASE_URL="postgresql://postgres:yourpassword@localhost:5432/devtrack_ai"

# Better Auth
BETTER_AUTH_SECRET="your-random-secret-here"
BETTER_AUTH_URL="http://localhost:3000"
NEXT_PUBLIC_BETTER_AUTH_URL="http://localhost:3000"

# AI β€” Groq (free at console.groq.com)
GROQ_API_KEY="your-groq-key-here"

To generate a BETTER_AUTH_SECRET:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

4. Set up the database

Option A β€” Local PostgreSQL:

psql -U postgres
CREATE DATABASE devtrack_ai;
\q

Option B β€” Neon (recommended, free cloud DB): Go to neon.tech β†’ create a project β†’ copy the connection string into DATABASE_URL.

5. Push the database schema

pnpm db:push

6. Run the development server

pnpm dev

Open http://localhost:3000 β€” you should see the landing page.


πŸ—„ Database Scripts

Command Description
pnpm db:push Push schema changes directly to the database
pnpm db:generate Generate migration files
pnpm db:migrate Run migrations
pnpm db:studio Open Drizzle Studio (visual DB browser)

πŸ€– AI Features

DevTrack AI uses Groq with the LLaMA 3.3 70B model for:

Generate Notes

  • Click Generate with AI on any topic page
  • Optionally specify a subtopic (e.g. useState, JWT, indexes)
  • AI generates structured markdown notes with code examples
  • Notes are saved with an AI badge indicator

Generate Quiz

  • Click Take Quiz on any topic page
  • AI generates 5 multiple choice questions based on your notes
  • Get instant feedback and explanations for each answer
  • See your final score with a performance rating

πŸ“Š Database Schema

users
  └── topics (userId β†’ users.id)
        └── notes (topicId β†’ topics.id, userId β†’ users.id)

sessions, accounts, verifications (managed by better-auth)

Topic status: not_started | in_progress | completed
Topic progress: 0–100 (integer)
Note isAiGenerated: "true" | "false" (string)


πŸ” Authentication Flow

  • Signup/Login handled by better-auth with email + password
  • Sessions stored in PostgreSQL via Drizzle adapter
  • Protected routes (/dashboard, /topics, /settings) redirect to /login if no session cookie
  • Auth routes (/login, /signup) redirect to /dashboard if already logged in

🌐 Deployment

Deploy to Vercel

  1. Push your code to GitHub
  2. Go to vercel.com β†’ Import project
  3. Add all environment variables from .env.local
  4. Change BETTER_AUTH_URL and NEXT_PUBLIC_BETTER_AUTH_URL to your production domain
  5. Deploy

Make sure to use a cloud database like Neon for production β€” local PostgreSQL won't work on Vercel.


πŸ“¦ Key Dependencies

{
  "better-auth": "^1.x",
  "drizzle-orm": "^0.31.x",
  "ai": "^4.x",
  "@ai-sdk/groq": "^1.x",
  "pg": "^8.x",
  "zod": "^3.x",
  "lucide-react": "^0.x",
  "date-fns": "^4.x",
  "sonner": "^1.x"
}

πŸ›£ Roadmap

  • Search across notes
  • Export notes as PDF
  • Quiz history and scoring trends
  • Dark/light mode toggle
  • AI chat assistant per topic
  • Public topic sharing

πŸ“„ License

MIT License β€” feel free to use this project for learning or as a base for your own apps.


πŸ™Œ Acknowledgements

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages