Skip to content

Commit f057430

Browse files
authored
Merge pull request #14 from devxoshakya/copilot/create-feature-docs
Rebuild landing Fumadocs into feature-first docs using landing/server markdown and product visuals
2 parents 91cb410 + 5b754c2 commit f057430

5 files changed

Lines changed: 274 additions & 178 deletions

File tree

Lines changed: 60 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,82 @@
11
---
2-
title: App Overview
3-
description: A practical overview of the platform, key routes, and setup.
2+
title: Platform Feature Overview
3+
description: Complete overview of Singularity product capabilities, flows, and outcomes.
44
---
55

6-
This app is a Next.js platform that combines:
6+
Singularity is an AI-first institutional platform built to reduce repetitive student support load and improve academic operations with governed, real-time intelligence.
77

8-
- Public marketing pages
9-
- Authenticated chat experience
10-
- Organization onboarding and membership workflows
11-
- Plan-based billing with Dodo Payments
12-
- MDX-powered documentation
8+
## Core Problems Solved
139

14-
## Tech Stack
10+
- Repetitive policy, exam, and course questions from students.
11+
- Slow manual support resolution loops.
12+
- Academic and institutional data that is difficult to query quickly.
13+
- Scattered knowledge documents with poor retrieval usability.
14+
- Access governance challenges at organization scale.
1515

16-
- Next.js App Router (`src/app`)
17-
- TypeScript
18-
- Clerk authentication
19-
- Prisma database access
20-
- Fumadocs for documentation (`content/docs`)
21-
- Dodo Payments for checkout and customer portal
16+
## End-to-End Product Flows
2217

23-
## Main Route Groups
18+
### 1) New User to Active Member
2419

25-
- `/` landing and marketing experience
26-
- `/login` sign-in/sign-up page
27-
- `/onboarding` organization onboarding flow
28-
- `/c/[id]` chat conversation workspace
29-
- `/pricing` pricing plans
30-
- `/docs` documentation pages
20+
1. User signs in.
21+
2. If membership is not active, onboarding starts.
22+
3. User creates an organization or requests to join one.
23+
4. Join requests stay pending until admin approval.
24+
5. On approval, user enters the chat workspace.
3125

32-
## User Flow (High Level)
26+
### 2) Institution Setup and Paid Activation
3327

34-
1. User visits landing page.
35-
2. User signs in with Clerk.
36-
3. If no active membership, user is redirected to onboarding.
37-
4. After onboarding and active org membership, user can access chat routes.
38-
5. Billing can be handled via checkout and customer portal routes.
28+
1. Admin provides organization identity and plan.
29+
2. Checkout is created through Dodo Payments.
30+
3. Webhook finalizes organization creation or upgrade.
31+
4. Plan limits and admin membership are applied.
32+
5. Clerk metadata is synchronized with org context.
3933

40-
## API Key Behavior
34+
### 3) AI Chat Experience
4135

42-
The chat UI supports a client-side backend API key value stored in browser local storage.
36+
1. User opens chat session.
37+
2. Query is sent with identity and optional key headers.
38+
3. Assistant responses stream in real time.
39+
4. Sources and context are rendered when available.
40+
5. Session is persisted to threaded history.
4341

44-
- Key is saved locally (not committed in code)
45-
- It is sent in request headers as `x-api-key`
46-
- Users can edit this key from the user menu in the app sidebar
42+
### 4) Admin Governance and Moderation
4743

48-
For Gemini key generation instructions, visit [Get a Gemini API Key](/docs/gemini-api-key).
44+
1. Admin reviews pending member requests.
45+
2. Approval/rejection enforces plan limits.
46+
3. Active members can be filtered and removed.
47+
4. Year-based deplatform action supports lifecycle cleanup.
4948

50-
## Billing Endpoints
49+
### 5) Knowledge Improvement Loop
5150

52-
- `/checkout` provides Dodo Payments checkout
53-
- `/customer-portal` redirects users to Dodo customer portal
51+
1. Admin uploads institutional files.
52+
2. Files enter ingestion and indexing flow.
53+
3. AI responses improve with refreshed organizational context.
5454

55-
These endpoints require payment-related environment variables.
55+
## User Value by Role
5656

57-
## Local Development
57+
### Students
5858

59-
Install dependencies and run the app:
59+
- Instant academic and institutional answers.
60+
- Persistent chat history and continuity.
61+
- Result-focused analysis mode for performance insights.
6062

61-
```bash
62-
pnpm install
63-
pnpm dev
64-
```
63+
### Admins
6564

66-
Then open:
65+
- Controlled onboarding and role-based governance.
66+
- Plan-limit aware approval workflows.
67+
- Dashboards for usage, requests, and membership operations.
68+
- Analytics and intervention signals for outcomes.
6769

68-
- App: `http://localhost:3000`
69-
- Docs: `http://localhost:3000/docs`
70+
### Institutions
71+
72+
- Reduced support overhead.
73+
- Faster policy and result communication.
74+
- Better use of existing documents and academic datasets.
75+
- Scalable digital interaction layer for students and staff.
76+
77+
## Product Visuals
78+
79+
![Singularity landing page hero with brand identity](/landing/Sentra.png)
80+
![Product interface showing AI assistant and analytics features](/landing/api.jpg)
81+
![Student performance analysis dashboard with outcome metrics](/landing/miet-results.png)
82+
![Desktop workspace layout with navigation and chat interface](/landing/desktop.png)
Lines changed: 95 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,114 @@
11
---
2-
title: Developer Endpoints
3-
description: Technical documentation for Singularity API routes and integrations.
2+
title: Analytics and API-Driven Features
3+
description: Feature documentation for student lookup, analytics intelligence, and dashboard data capabilities.
44
---
55

6-
Singularity provides a robust set of API endpoints for programmatic access and internal workflows. This guide covers the main routes used for analytics, organization management, and user verification.
7-
8-
## Analytics Endpoints 📊
9-
10-
### 1. Student Status Distribution
11-
Returns a breakdown of students by academic standing.
12-
- **Endpoint**: `GET /api/analytics/student-status-distribution`
13-
- **Query Params**:
14-
- `year` (optional): Filter by student year.
15-
- `branch` (optional): Filter by department (e.g., CSE, ECE).
16-
- **Response**:
17-
```json
18-
{
19-
"success": true,
20-
"data": {
21-
"total": 1500,
22-
"distribution": [
23-
{ "status": "Pass", "count": 1200, "percentage": 80 },
24-
{ "status": "PCP", "count": 250, "percentage": 16.67 },
25-
{ "status": "Fail", "count": 50, "percentage": 3.33 }
26-
]
27-
}
28-
}
29-
```
30-
31-
### 2. Branch Status Breakdown
32-
Returns department-specific performance metrics.
33-
- **Endpoint**: `GET /api/analytics/branch-status-breakdown`
34-
- **Query Params**:
35-
- `year` (optional): Filter by year.
36-
37-
### 3. Performance Metrics Comparison
38-
Compares metrics between two academic years.
39-
- **Endpoint**: `GET /api/analytics/performance-metrics`
40-
- **Query Params**:
41-
- `years` (required): Comma-separated years (e.g., `years=2,1`).
42-
- **Response**: Includes average SGPA, pass rates, and percentage comparisons.
6+
This page documents the feature capabilities enabled by the server APIs that power the authenticated analytics dashboard and intelligence workflows.
437

44-
---
8+
## Student Lookup Features
459

46-
## Organization Management 🏢
10+
### Student Profile by Roll Number
4711

48-
### 1. Create Organization
49-
Initializes a new institution with a selected plan.
50-
- **Endpoint**: `POST /api/orgs/create`
51-
- **Body**:
52-
```json
53-
{
54-
"orgName": "string",
55-
"orgSlug": "string",
56-
"plan": "BASIC | PRO | ENTERPRISE"
57-
}
58-
```
12+
- Endpoint: `GET /api/result/by-rollno`
13+
- Supports `sem=1..8`, `latest`, and `all`.
14+
- Enables instant student profile retrieval with semester context.
15+
- Powers profile cards, semester snapshots, and subject drill-down views.
5916

60-
### 2. List Organizations
61-
Retrieves a list of organizations the authenticated user belongs to.
62-
- **Endpoint**: `GET /api/orgs/list`
17+
### Student Collections by Year
6318

64-
### 3. Membership Requests
65-
Allows students to request to join an organization.
66-
- **Endpoint**: `POST /api/orgs/[orgId]/request`
19+
- Endpoint: `GET /api/result/by-year`
20+
- Supports cohort-wide year exploration and filtering.
21+
- `sem=latest` behavior improves comparison quality by excluding incomplete progressions.
22+
- Powers year tabs, cohort summaries, and cohort search flows.
6723

68-
---
24+
## Shared Analytics Status Logic
6925

70-
## User Verification 👤
26+
Across analytics endpoints:
7127

72-
### 1. Student Verification
73-
Updates student profile with academic details.
74-
- **Endpoint**: `POST /api/orguser/verify`
75-
- **Body**:
76-
```json
77-
{
78-
"rollNo": "string",
79-
"dob": "YYYY-MM-DD",
80-
"year": "number"
81-
}
82-
```
28+
- **Pass**: `0` carry-overs
29+
- **PCP**: `1-2` carry-overs
30+
- **Fail**: `>=3` carry-overs
8331

8432
---
8533

86-
## Knowledge Base 📚
34+
## Analytics Features
35+
36+
### 1) Student Status Distribution
37+
38+
- Endpoint: `GET /api/analytics/student-status-distribution`
39+
- Filters: `year`, `branch`
40+
- Feature impact: cohort health pulse (Pass/PCP/Fail).
41+
42+
### 2) Branch Status Breakdown
43+
44+
- Endpoint: `GET /api/analytics/branch-status-breakdown`
45+
- Filter: `year`
46+
- Feature impact: branch-level academic strength/risk comparison.
47+
48+
### 3) Year-Branch Comparison
49+
50+
- Endpoint: `GET /api/analytics/year-branch-comparison`
51+
- Filters: `years`, `branches`, `metric`
52+
- Feature impact: multi-year trend storytelling across departments.
53+
54+
### 4) Performance Metrics (Two-Year KPI Compare)
55+
56+
- Endpoint: `GET /api/analytics/performance-metrics`
57+
- Filters: `years=Y1,Y2` (required for new behavior), optional `branch`
58+
- Feature impact: executive KPI cards with trend direction and percent movement.
59+
60+
### 5) Semester Progression
61+
62+
- Endpoint: `GET /api/analytics/semester-progression`
63+
- Filters: `year`, `branch`
64+
- Feature impact: semester growth/decline trajectories.
65+
66+
### 6) SGPA Range Distribution
67+
68+
- Endpoint: `GET /api/analytics/sgpa-range-distribution`
69+
- Filters: `year`, `branch`, `semester`
70+
- Feature impact: quality band distribution and concentration analysis.
71+
72+
### 7) Backlog Analysis
73+
74+
- Endpoint: `GET /api/analytics/backlog-analysis`
75+
- Filters: `year` (required), `branch`, `groupBy`
76+
- Feature impact: active vs cleared backlog intelligence and intervention guidance.
77+
78+
### 8) Branch Performance Radar
79+
80+
- Endpoint: `GET /api/analytics/branch-performance-radar`
81+
- Filter: `year`
82+
- Feature impact: multi-dimensional branch benchmarking.
83+
84+
### 9) Top Performers
85+
86+
- Endpoint: `GET /api/analytics/top-performers`
87+
- Filters: `limit`, `year`, `branch`, `metric`
88+
- Feature impact: achiever spotlight and leaderboard modules.
89+
90+
## Analytics Visual Gallery
91+
92+
Analytics chart screenshots use the public URL path `/assets/graphs/*`, backed by files stored in `apps/landing/public/assets/graphs`.
93+
These are example visualizations generated from the analytics features documented above.
94+
95+
![Bar chart showing student status distribution across Pass, PCP, and Fail categories](/assets/graphs/1.png)
96+
![Grouped comparison chart showing pass and risk status across academic branches](/assets/graphs/2.png)
97+
![Multi-year trend chart comparing branch performance metrics by selected academic years](/assets/graphs/3.png)
98+
![KPI dashboard chart comparing SGPA, marks, and pass-rate movement between two years](/assets/graphs/4.png)
99+
![Semester progression line chart showing academic performance trend over consecutive semesters](/assets/graphs/5.png)
100+
![Backlog and branch benchmark visualization showing active versus cleared backlog patterns](/assets/graphs/6.png)
101+
![Leaderboard-oriented analytics chart showing top performers and SGPA range concentration](/assets/graphs/7.png)
102+
103+
## Playground Intelligence Contract
87104

88-
### 1. Document Submission
89-
Uploads institutional files for AI indexing.
90-
- **Endpoint**: `POST /api/knowledge/submit`
91-
- **Body**: `FormData` containing `documents` (File[]), `orgId`, and `orgName`.
105+
- `POST /api/playground/optimize` transforms natural language into structured analytics intent.
106+
- `GET /api/playground/query?text=...` resolves intent to analytics data payloads.
107+
- Enables admin experimentation workflows for chart-first data exploration.
92108

93109
---
94110

95-
## Authentication & Security 🔒
111+
## Product Snapshots Connected to Analytics Experience
96112

97-
- **Auth Provider**: Clerk (Next.js Clerk Middleware).
98-
- **API Keys**: Client-side Gemini API keys are sent via the `x-api-key` header.
99-
- **Authorization**: Protected routes require a valid session cookie from Clerk.
113+
![API-driven chat assistant interface integrated with analytics dashboard](/landing/api.jpg)
114+
![Student outcome analysis interface showing performance visualization](/landing/miet-results.png)

0 commit comments

Comments
 (0)