Skip to content

Commit 46c8a1b

Browse files
authored
Merge pull request #43 from akyourowngames/Error/Error
feat: integrate editor workspace into yantra app
2 parents c80c173 + c46a1f2 commit 46c8a1b

159 files changed

Lines changed: 15152 additions & 9884 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ coverage/
1111
!.env.example
1212

1313
.npm-cache/
14+
.vercel
1415
pnpm-lock.yaml
1516
note.js
1617

1718
backend/
1819
20260403070000_add_mastery_and_rooms.sql
1920

20-
2121
note.js
2222

23-
2423
package-lock.json

README.md

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
11
# Yantra
22

3-
Yantra is a Next.js 16 prototype for an AI-native learning platform. The live build currently combines:
3+
Yantra is a Next.js 16 prototype for an AI-native learning platform. The current build combines:
44

55
- a public marketing site
6-
- Supabase-backed email/password authentication
7-
- Supabase-backed Google sign-in
8-
- a public docs/help center with article pages
9-
- protected learner routes
10-
- a persisted student profile
6+
- a public learner dashboard
7+
- a locally persisted student profile
8+
- a public editor with local project storage
9+
- a public docs/help center
10+
- optional Supabase-backed auth surfaces (email/password, Google, GitHub, password reset)
1111
- persisted access requests
12-
- authenticated chat history continuity
13-
- a configurable Python Yantra AI microservice under `ai/`, targeted first by the main chat and Python Room feedback routes
14-
- a room-only Sarvam-powered voice assistant layered onto the Python Room through Next.js server routes
12+
- authenticated chat history continuity when Supabase auth is available
13+
- a Render-backed Yantra chat assistant routed through the Python AI microservice when configured
14+
- a room-only Sarvam-powered voice assistant layered onto the Python Room
15+
- a separate Python AI microservice under `ai/`
1516

16-
The app is no longer just a static marketing-plus-dashboard shell. Authentication, profile persistence, docs/help content, chat continuity, and the first real Python Room are live. Most learner-state, recommendation, and broader room logic are still seeded or presentation-led.
17+
The app is no longer just a static marketing shell. The public dashboard, student profile, editor, docs, and live Python room are real. Some learner-state, recommendation, and deeper roadmap logic are still seeded or presentation-led.
1718

1819
## Current Routes
1920

2021
### Public pages
2122

2223
- `/` marketing landing page
23-
- `/login` email/password sign-in
24-
- `/signup` account creation
24+
- `/dashboard` student dashboard
25+
- `/dashboard/student-profile` editable student profile workspace
26+
- `/dashboard/rooms/python` Python room index
27+
- `/dashboard/rooms/python/control-flow-calibration` live Python room
28+
- `/editor` public editor workspace
29+
- `/editor/projects` local project list
30+
- `/editor/share/[shareSlug]` shared project view
2531
- `/docs` docs home
2632
- `/docs/[slug]` docs article pages
33+
- `/features`
34+
- `/guide`
35+
- `/login`
36+
- `/signup`
2737
- `/privacy`
2838
- `/terms`
2939
- `/status`
30-
- `/auth/reset-password` password recovery completion
31-
- `/reset-password` mirror of the reset-password experience
32-
33-
### Auth-required pages
34-
35-
- `/onboarding` onboarding flow for authenticated accounts
36-
- `/dashboard` student dashboard
37-
- `/dashboard/student-profile` editable student profile workspace
38-
- `/dashboard/rooms/python` Python Room
40+
- `/auth/reset-password`
41+
- `/reset-password`
3942

40-
### Auth handlers
43+
### Additional app routes
4144

42-
- `/auth/confirm` email confirmation and Google OAuth callback
43-
- `/auth/signout` sign-out route
45+
- `/onboarding`
46+
- `/auth/confirm`
47+
- `/auth/signout`
4448

4549
### API routes
4650

@@ -54,32 +58,37 @@ The app is no longer just a static marketing-plus-dashboard shell. Authenticatio
5458
- `POST /api/rooms/python/feedback`
5559
- `POST /api/sarvam/stt`
5660
- `POST /api/sarvam/tts`
61+
- `GET /api/editor/projects`
62+
- `POST /api/editor/projects`
63+
- `GET /api/editor/projects/[projectId]`
64+
- `PATCH /api/editor/projects/[projectId]`
65+
- `PUT /api/editor/projects/[projectId]/files`
66+
- `POST /api/editor/projects/[projectId]/share`
67+
- `GET /api/editor/share/[shareSlug]`
5768

5869
## What Works Today
5970

6071
- Next.js App Router runtime on a Vercel-compatible setup
61-
- Supabase SSR auth with cookie refresh handled through `proxy.ts`
62-
- automatic profile seeding in `public.profiles` for first-time signed-in users
63-
- onboarding shown after new account creation, with returning login going to the dashboard
72+
- public dashboard access with no required sign-in
6473
- profile persistence from `/dashboard/student-profile`
65-
- auth-required dashboard and Python Room redirects for signed-out visitors
66-
- password reset email flow and reset page
67-
- Google OAuth sign-in through Supabase
74+
- local editor projects and shared-project remix flows
75+
- Supabase-backed auth pages and recovery flows
6876
- reusable chat widget on the marketing site and dashboard
6977
- main Yantra chat routed through the Python AI service target resolved by `src/lib/yantra-ai-service.ts`
7078
- docs-only Support Desk answers powered by Gemini through `/api/docs-support`
71-
- authenticated chat history restore across sessions
79+
- authenticated chat history restore across sessions when Supabase auth is available
7280
- Python Room execution in-browser through Pyodide, with runtime-error line highlighting
7381
- Python Room feedback through `/api/rooms/python/feedback`, which targets the Python AI service first and can fall back to Gemini
7482
- room-only push-to-talk voice assistant using Sarvam STT/TTS plus `/api/chat`
75-
- automated coverage for the room-feedback route, Pyodide error parsing, and the Python service test suite
83+
- access-request form validation, persistence, and server handling
7684

7785
## What Is Still Seeded Or Limited
7886

7987
- dashboard skills, progress cards, curriculum nodes, and recommendations are still starter data
80-
- most room cards outside the Python Room are still presentation-led
88+
- some room cards and roadmap visuals outside the live Python room remain presentation-led
8189
- Python Room correctness checking is still exception-only; successful-but-wrong output is not evaluated yet
8290
- chat moderation, analytics, and tool use are not built yet
91+
- cross-device sync for public-mode profiles and editor projects is still future work
8392
- adaptive roadmap logic and deeper learner memory are still future work
8493

8594
## Project Structure
@@ -169,7 +178,7 @@ Notes:
169178

170179
### Database setup
171180

172-
Run the SQL in `supabase/schema.sql` against your Supabase project. It creates:
181+
Run the SQL in `supabase/schema.sql` against your Supabase project. That creates `public.profiles`, `public.access_requests`, `public.chat_histories`, plus the update triggers and row-level security policies used by access requests and any Supabase-backed legacy profile/chat persistence that is still enabled.
173182

174183
- `public.profiles`
175184
- `public.access_requests`

app/api/chat/history/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export async function GET() {
1111
const result = await getAuthenticatedChatHistory();
1212

1313
if (!result) {
14-
return NextResponse.json({ error: 'Unauthorized.' }, { status: 401 });
14+
return NextResponse.json({ messages: [] });
1515
}
1616

1717
return NextResponse.json({ messages: result.messages });

app/api/editor/assist/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const runtime = 'nodejs';
2+
3+
export { POST } from '@/editor/api/assist';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { PUT } from '@/editor/api/project-files';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { GET, PATCH } from '@/editor/api/project';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { POST } from '@/editor/api/project-share';

app/api/editor/projects/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { GET, POST } from '@/editor/api/projects';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { GET } from '@/editor/api/shared-project';

app/auth/confirm/route.ts

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,5 @@
11
import { redirect } from 'next/navigation';
2-
import { type EmailOtpType } from '@supabase/supabase-js';
3-
import { hasSupabaseEnv } from '@/src/lib/supabase/env';
4-
import { createClient } from '@/src/lib/supabase/server';
52

6-
export async function GET(request: Request) {
7-
const { searchParams } = new URL(request.url);
8-
const code = searchParams.get('code');
9-
const tokenHash = searchParams.get('token_hash');
10-
const next = searchParams.get('next') || '/onboarding';
11-
const type = searchParams.get('type') as EmailOtpType | null;
12-
13-
if (!hasSupabaseEnv()) {
14-
redirect('/login?message=Configure%20Supabase%20first.&kind=error');
15-
}
16-
17-
const supabase = await createClient();
18-
19-
if (code) {
20-
const { error } = await supabase.auth.exchangeCodeForSession(code);
21-
22-
if (error) {
23-
redirect('/login?message=We%20could%20not%20finish%20that%20sign-in.%20Please%20try%20again.&kind=error');
24-
}
25-
26-
redirect(next);
27-
}
28-
29-
if (!tokenHash || !type) {
30-
redirect('/login?message=The%20confirmation%20link%20is%20invalid.&kind=error');
31-
}
32-
33-
const { error } = await supabase.auth.verifyOtp({
34-
type,
35-
token_hash: tokenHash,
36-
});
37-
38-
if (error) {
39-
redirect('/login?message=We%20could%20not%20verify%20that%20email%20link.%20Please%20try%20again.&kind=error');
40-
}
41-
42-
redirect(next);
3+
export async function GET() {
4+
redirect('/dashboard');
435
}

0 commit comments

Comments
 (0)