Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion index.html

This file was deleted.

23 changes: 23 additions & 0 deletions learnflow/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
pull_request:
push:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm i
- run: pnpm prisma:generate
- run: pnpm lint
- run: pnpm test -- --ci
43 changes: 43 additions & 0 deletions learnflow/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

/src/generated/prisma
20 changes: 20 additions & 0 deletions learnflow/DEPLOY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## LearnFlow Deployment Checklist (Vercel + Supabase)

- Create a new Supabase project (free plan is fine to start)
- Copy `Project URL` and `anon` and `service_role` keys
- Create a bucket `projects` (public)
- In Vercel:
- Create a new project from this repo
- Set Environment Variables:
- `DATABASE_URL`
- `NEXTAUTH_URL`
- `NEXTAUTH_SECRET`
- `EMAIL_SERVER` (optional) and `EMAIL_FROM`
- `SUPABASE_URL`
- `SUPABASE_ANON_KEY`
- `SUPABASE_SERVICE_ROLE_KEY`
- `AI_API_KEY` (optional)
- Add a Vercel Postgres or Supabase connection string to `DATABASE_URL`
- Set build command `pnpm build` and install `pnpm i`
- Run Prisma migration on deploy: Vercel runs `prisma generate` during build; also add a one-time migration step or use a GitHub Action workflow to apply migrations.
- After deploy, run `pnpm prisma:deploy` and `pnpm db:seed` once (locally pointing to prod DB) if needed.
57 changes: 57 additions & 0 deletions learnflow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# LearnFlow

Deployable learning platform with structured roadmaps, gamification, project-based unlocking, and community feedback.

## Tech Stack
- Next.js (App Router), React, TypeScript
- Tailwind CSS
- NextAuth (Email, GitHub)
- Prisma ORM (Postgres / Supabase)
- Supabase Storage (for project uploads)
- Jest + Testing Library + Playwright

## Getting Started (Local)
1. Install deps:
```bash
pnpm i
```
2. Copy env and edit:
```bash
cp .env.example .env
```
3. Provision a Postgres DB (Supabase recommended) and set `DATABASE_URL`.
4. Run Prisma migrations and seed:
```bash
pnpm prisma:generate
pnpm prisma:migrate
pnpm db:seed
```
5. Start dev server:
```bash
pnpm dev
```

## Seeded Accounts
- admin@example.com
- mentor1@example.com
- mentor2@example.com
- learner1@example.com
- learner2@example.com

Use Email sign-in; in dev, magic links are logged to console.

## Key Routes
- `/` Landing
- `/create-roadmap` Generate and save a roadmap (mock AI)
- `/dashboard` User dashboard with XP/badges
- `/roadmaps/[id]` Roadmap viewer
- `/modules/[moduleId]` Module page
- `/leaderboard` XP leaderboard
- `/admin` Mentor/Admin dashboard (API exists; UI minimal)

## Tests
- Run unit tests: `pnpm test`
- Run e2e: `pnpm e2e`

## Deployment
See `DEPLOY.md` for Vercel + Supabase checklist.
25 changes: 25 additions & 0 deletions learnflow/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
],
},
];

export default eslintConfig;
10 changes: 10 additions & 0 deletions learnflow/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import('jest').Config} */
const config = {
testEnvironment: "jsdom",
setupFilesAfterEnv: ["@testing-library/jest-dom"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
},
};

module.exports = config;
7 changes: 7 additions & 0 deletions learnflow/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
};

export default nextConfig;
54 changes: 54 additions & 0 deletions learnflow/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "learnflow",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint",
"prisma:generate": "prisma generate",
"prisma:migrate": "prisma migrate dev",
"prisma:deploy": "prisma migrate deploy",
"db:seed": "tsx prisma/seed.ts",
"test": "jest",
"e2e": "playwright test"
},
"dependencies": {
"@prisma/client": "^6.17.1",
"@supabase/auth-helpers-nextjs": "^0.10.0",
"@supabase/supabase-js": "^2.75.1",
"@uploadcare/blocks": "^0.50.4",
"date-fns": "^4.1.0",
"jose": "^6.1.0",
"next": "15.5.6",
"next-auth": "^4.24.11",
"react": "19.1.0",
"react-dom": "19.1.0",
"sanitize-html": "^2.17.0",
"swr": "^2.3.6",
"uuid": "^13.0.0",
"zod": "^4.1.12"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@playwright/test": "^1.56.1",
"@tailwindcss/postcss": "^4",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.5.6",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"prisma": "^6.17.1",
"tailwindcss": "^4",
"ts-node": "^10.9.2",
"tsx": "^4.20.6",
"typescript": "^5"
}
}
Loading