DevPath is a modern SaaS learning platform where developers can explore curated roadmaps, track their progress, and master new skills. Built with Next.js 14 App Router, MongoDB, Prisma, and NextAuth.
| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Database | MongoDB Atlas |
| ORM | Prisma |
| Auth | NextAuth.js v4 (JWT + OAuth) |
| UI | Tailwind CSS + shadcn/ui |
| Roadmap Visualization | ReactFlow |
| Animations | Framer Motion |
| Validation | Zod |
| Caching | In-memory (Redis optional) |
git clone https://github.com/dipanshurdev/devpath.git
npm installCopy .env.example to .env and fill in the required values:
cp .env.example .envRequired variables:
DATABASE_URL=mongodb+srv://...
NEXTAUTH_SECRET=your-secret-here
NEXTAUTH_URL=http://localhost:3000Optional (for OAuth):
GITHUB_ID=...
GITHUB_SECRET=...
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...# Push schema to MongoDB and generate Prisma client
npm run setup:prisma
# Seed with sample roadmaps and an admin user
npm run db:seedDefault admin credentials (override via env):
- Email:
admin@devpath.dev - Password:
Admin@123456
npm run devOpen http://localhost:3000.
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run lint:fix |
Run ESLint and auto-fix |
npm run type-check |
Run TypeScript type checking |
npm run prisma:generate |
Regenerate Prisma client |
npm run prisma:push |
Push schema changes to DB |
npm run prisma:studio |
Open Prisma Studio (DB GUI) |
npm run setup:prisma |
Generate + push schema |
npm run db:seed |
Seed database with sample data |
npm run db:reset |
Reset DB and re-seed |
npm run db:import |
Import roadmaps from JSON file |
devpath/
βββ app/ # Next.js App Router pages and API routes
β βββ api/ # API route handlers
β β βββ admin/stats/ # Admin stats endpoint
β β βββ auth/ # NextAuth + registration
β β βββ dashboard/ # Dashboard data
β β βββ roadmaps/ # Roadmap CRUD, likes, bookmarks, progress
β β βββ subscriptions/me/ # Current user subscription
β β βββ users/ # User profile endpoints
β βββ admin/ # Admin dashboard pages
β βββ dashboard/ # User dashboard
β βββ roadmaps/ # Roadmap list and detail pages
β βββ login/ register/ # Auth pages
β βββ pricing/ # Pricing page
β βββ error.tsx # Global error boundary
β βββ not-found.tsx # 404 page
β
βββ components/ # Shared UI components
β βββ roadmaps/ # Roadmap-specific components (RoadmapFlow, etc.)
β βββ navbar/ # Navigation components
β βββ ui/ # shadcn/ui primitives
β βββ ...
β
βββ lib/ # Shared utilities and configuration
β βββ auth.ts # NextAuth configuration
β βββ auth-utils.ts # requireAuth / requireAdmin helpers
β βββ api-handler.ts # withErrorHandler wrapper + ApiError class
β βββ cache.ts # In-memory / Redis cache abstraction
β βββ config.ts # Central app config (pagination, TTLs, feature gates)
β βββ env.ts # Zod-validated environment variables
β βββ feature-gates.ts # checkFeatureAccess + subscription tier logic
β βββ logger.ts # Structured JSON logger
β βββ prisma/
β βββ client.ts # Prisma client singleton
β βββ queries.ts # All database query functions
β
βββ features/ # Feature barrel exports
β βββ auth/ # Auth feature re-exports
β βββ roadmaps/ # Roadmap feature re-exports
β
βββ prisma/
β βββ schema.prisma # Database schema (MongoDB + Prisma)
β
βββ scripts/
β βββ seed-sample-data.ts # Idempotent database seed script
β
βββ tests/
β βββ data-isolation.test.ts # Integration tests for multi-user data isolation
β
βββ types/
β βββ index.ts # Shared TypeScript types
β
βββ middleware.ts # NextAuth route protection middleware
βββ .env.example # Environment variable template
βββ .eslintrc.json # ESLint configuration
- Authentication β Email/password + Google/GitHub OAuth via NextAuth
- Roadmaps β Browse, filter, search, and track progress through learning roadmaps
- Dashboard β Personal learning stats, weekly activity, in-progress and saved roadmaps
- Admin Panel β Create and manage roadmaps, view real-time platform stats
- Subscriptions β FREE/PRO/TEAM tier architecture with feature gating
- Caching β In-memory cache (Redis-ready) for roadmap list and detail endpoints
- Data Isolation β All user data (progress, bookmarks, likes) is scoped per user
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Open a pull request
See CONTRIBUTING.md for detailed guidelines.
MIT β see LICENSE for details.