Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
a45fa06
added feature: Export Chat Transcript (Download as Markdown / JSON)
akash3911 May 15, 2026
ae55ada
fix: correct typo myPlaground → myPlayground in Prisma schema
algojogacor May 16, 2026
7607b72
Added shortcut modal and header button
aparna24bce11388 May 17, 2026
3a30a7c
Fixed auth secret issue and added Shortcut Modal
aparna24bce11388 May 17, 2026
b79b7a9
Merge branch 'main' into feature/shortcut-modal
aparna24bce11388 May 17, 2026
5a46ca0
Fix: add aria-label to menu button for accessibility
aparna24bce11388 May 17, 2026
c904a61
feat: improved ux of template modal card
sidhacks May 20, 2026
6c8278d
added all requested changes
sidhacks May 21, 2026
0d87947
fix: correct ShortcutModal integration with Shadcn Dialog
aparna24bce11388 May 23, 2026
f0373cc
fix: remove missing animated shader background import
aparna24bce11388 May 23, 2026
4373e74
Merge branch 'main' into feature/shortcut-modal
aparna24bce11388 May 23, 2026
cfbcb47
fix: resolve widespread TypeScript errors in template data structures
Srushti-Kamble14 May 23, 2026
e0ea92d
refactor: address CodeRabbit review comments on type safety and JSON …
Srushti-Kamble14 May 23, 2026
6f8927f
Merge branch 'main' into main
piyushdotcomm May 24, 2026
c34c919
fix: reuse shared template types and preserve JSON typing
Srushti-Kamble14 May 24, 2026
8ecad4e
defined interface for collaborator
chetisha28 May 26, 2026
dce82bc
fix: add empty alt attribute to empty state illustration
rutul2006 May 26, 2026
1a2eb45
refactor(icon): replace hex gradient with Tailwind classes in app/ico…
rutul2006 May 26, 2026
002e64a
Merge branch 'piyushdotcomm:main' into main
Srushti-Kamble14 May 26, 2026
fdbe08a
fix: add descriptive fallback alt text to Image in template-card.tsx
pooja-0206 May 26, 2026
a640d28
fix(dashboard): replace any types with proper project data interfaces
angelina-2206 May 26, 2026
5ae7c51
perf(modules): replace index-based keys with stable identifiers in li…
angelina-2206 May 26, 2026
4c9c777
fix: add aria-label to icon-only buttons in RunningEnvironments
MaitrayeeK May 26, 2026
efba2d2
fix: load time on low end devices
sidhacks May 26, 2026
502e102
fix: Replaced Promise<any> with Promise<Project>
swarnimbandekar May 27, 2026
1d1bd42
feat: add isLoading prop to Button component with spinner
palak170306-design May 27, 2026
dc0285b
fix(types): replace any types in dashboard profile page
Nightkilller May 27, 2026
9cb1dc8
fix: ensure isLoading always disables button by placing disabled afte…
palak170306-design May 27, 2026
6ec6808
feat: add error boundary component for dashboard route
Srushti-Kamble14 May 27, 2026
92afeca
fix(playground): add type annotations for AI state and provider funct…
Srushti-Kamble14 May 27, 2026
e3745d3
fix(profile): replace any type with StatCardProps interface in KPIStats
Srushti-Kamble14 May 27, 2026
a686a82
Replaced generic string type with KpiColor union type
Srushti-Kamble14 May 27, 2026
4e67166
fix(download): replace 'any' with 'unknown' in schema catch (fixes #290)
sanudking May 27, 2026
ef6e588
fix: remove unused TemplateFolder import in useAI.test.ts
RavindiFernando May 27, 2026
9571671
fix: replace any type with DeployFile interface in netlify route
RavindiFernando May 27, 2026
aa494ca
feat: implement inline AI ghost text completions
jainsomil714-debug May 27, 2026
57ddaf2
feat: implement real-time collaboration using Yjs CRDTs
jainsomil714-debug May 27, 2026
5eedd56
placeholder
sanudking May 27, 2026
5d6d7b8
placeholder
sanudking May 27, 2026
1b0b497
placeholder
sanudking May 27, 2026
edfe85d
placeholder
sanudking May 27, 2026
2df4f00
placeholder
sanudking May 27, 2026
df485ca
placeholder
sanudking May 27, 2026
319544a
placeholder
sanudking May 27, 2026
93566bf
placeholder
sanudking May 27, 2026
8e67c41
fix(profile): remove unused theme variable in UsageAnalytics (fixes #…
sanudking May 27, 2026
b6ce879
security: implement rate limiting for AI API endpoints
jainsomil714-debug May 27, 2026
ac89a54
feat: add integrated Git source control UI
jainsomil714-debug May 27, 2026
d7ac6d8
fix: resolve Monaco editor model memory leaks
jainsomil714-debug May 27, 2026
6e7bb56
feat: add offline PWA support
jainsomil714-debug May 27, 2026
d56399c
feat: add secure environment variable secrets manager
jainsomil714-debug May 27, 2026
ae84df7
feat: add editor split view and tab management
jainsomil714-debug May 27, 2026
94e4eba
fix: optimize xterm rendering for heavy output
jainsomil714-debug May 27, 2026
48fe4d2
feat: add customizable themes and font ligature support
jainsomil714-debug May 27, 2026
71a3029
feat: implement Yjs collaboration utilities and remove obsolete envir…
STRANGENIKHIL May 27, 2026
e5bbc4f
feat: add runtime activity panel for webcontainer events
Bhagy-Yelleti May 28, 2026
185fde7
Added validation improvements on playloads messages
KaranUnique May 28, 2026
8c0cb79
Merge pull request #350 from Somil450/feature-theme-ligature-support
piyushdotcomm May 28, 2026
f17f256
Merge pull request #349 from Somil450/fix-xterm-heavy-output-freeze
piyushdotcomm May 28, 2026
e2982f0
Merge pull request #348 from Somil450/feature-editor-split-view
piyushdotcomm May 28, 2026
c3e8ce7
Merge pull request #347 from Somil450/enhancement-secrets-manager
piyushdotcomm May 28, 2026
abc4e49
Merge pull request #346 from Somil450/feature-offline-pwa-support
piyushdotcomm May 28, 2026
5a05aa8
Merge pull request #345 from Somil450/fix-monaco-model-memory-leaks
piyushdotcomm May 28, 2026
20d8101
Merge pull request #344 from Somil450/feature-git-source-control-ui
piyushdotcomm May 28, 2026
dd164a5
Merge pull request #343 from Somil450/security-rate-limit-ai-endpoints
piyushdotcomm May 28, 2026
cfe9356
Merge pull request #341 from Somil450/enhancement-live-collaboration-…
piyushdotcomm May 28, 2026
acd479a
Merge pull request #340 from Somil450/feature-inline-ai-completions
piyushdotcomm May 28, 2026
4d80f64
feat(playground): add split view editor support
Bhagy-Yelleti May 28, 2026
807dd2e
fix(playground): address review feedback for split editor
Bhagy-Yelleti May 28, 2026
6582a6c
fix(playground): improve inline completion debounce handling
Bhagy-Yelleti May 28, 2026
b924e1c
fix(profile): replace any type in KPIStats component props #369
jainsomil714-debug May 28, 2026
5239ed1
fix(yjs): remove room tracking logs #368
jainsomil714-debug May 28, 2026
a55b61d
fix(api-utils): replace any with Duration type for slidingWindow limi…
swarnimbandekar May 28, 2026
b75ba84
fix(lib): use console.error in user-data #367
jainsomil714-debug May 28, 2026
73dc591
fix(dashboard): use console.error for actions #366
jainsomil714-debug May 28, 2026
87476c8
fix(home): remove test log in hero-code #365
jainsomil714-debug May 28, 2026
3181155
fix(playground): remove verbose logging in path-to-json #363
jainsomil714-debug May 28, 2026
671e862
fix(playground): remove AI Chat Panel execution logs #362
jainsomil714-debug May 28, 2026
5841337
fix(playground): remove verbose logging in path-to-json #361
jainsomil714-debug May 28, 2026
7d2e10f
fix(webcontainers): clean up WebContainer debug logs #360
jainsomil714-debug May 28, 2026
284c6a7
fix(collab): remove leftover console logs #359
jainsomil714-debug May 28, 2026
1d3e3cf
fix: use isLoading variable in preview refresh button
notSoumya May 28, 2026
7ddacb1
fix: remove unused tools variable from chat test
CodesWithSubham May 28, 2026
b33e84a
Implemented transactions in the authentication system to prevent inco…
KaranUnique May 29, 2026
7563195
Implemented transactions in the authentication system to prevent inco…
KaranUnique May 29, 2026
65d2031
fixed the suggested changes and issues
KaranUnique May 29, 2026
380cf1b
Merge pull request #380 from Somil450/fix/server-logs
piyushdotcomm May 29, 2026
8f569d0
Merge pull request #379 from Somil450/fix/webcontainer-logs
piyushdotcomm May 29, 2026
2da9d03
Merge pull request #378 from Somil450/fix/path-to-json-logs-361
piyushdotcomm May 29, 2026
f729b34
Merge pull request #377 from Somil450/fix/ai-chat-logs
piyushdotcomm May 29, 2026
9a3df1c
Merge pull request #376 from Somil450/fix/path-to-json-logs
piyushdotcomm May 29, 2026
c4b7624
Merge pull request #375 from Somil450/fix/hero-test-log
piyushdotcomm May 29, 2026
8572d14
Merge pull request #374 from Somil450/fix/dashboard-console-error
piyushdotcomm May 29, 2026
81cbe13
Merge pull request #372 from Somil450/fix/use-console-error
piyushdotcomm May 29, 2026
31fbc70
Merge pull request #371 from Somil450/fix/remove-yjs-logs
piyushdotcomm May 29, 2026
1eb4dca
Merge pull request #370 from Somil450/fix/kpistats-any-type
piyushdotcomm May 29, 2026
3943af9
Merge pull request #385 from KaranUnique/authentication
piyushdotcomm May 29, 2026
62904ad
Merge pull request #384 from CodesWithSubham/fix/remove-unused-tools-…
piyushdotcomm May 29, 2026
22706c5
Merge pull request #381 from notSoumya/main
piyushdotcomm May 29, 2026
e451119
Merge pull request #373 from swarnimbandekar/fix/api-utils-replace-an…
piyushdotcomm May 29, 2026
4dc4b90
Merge pull request #342 from sanudking/fix/issue-271-unused-theme
piyushdotcomm May 29, 2026
c8113f6
Merge pull request #331 from RavindiFernando/fix/netlify-any-type
piyushdotcomm May 29, 2026
992f748
Merge pull request #328 from RavindiFernando/fix/remove-unused-templa…
piyushdotcomm May 29, 2026
d4dfd92
Merge pull request #327 from sanudking/fix/issue-290-typing
piyushdotcomm May 29, 2026
76e7f38
Merge pull request #324 from Srushti-Kamble14/error-boundary
piyushdotcomm May 29, 2026
ecd2c78
Merge pull request #321 from Nightkilller/fix/profile-any-types
piyushdotcomm May 29, 2026
7958d21
Merge pull request #320 from palak170306-design/feature/button-loadin…
piyushdotcomm May 29, 2026
85280a7
Merge pull request #316 from swarnimbandekar/fix/replace-any-type-com…
piyushdotcomm May 29, 2026
3929138
Merge pull request #315 from sidhacks/fix/load-time-improved
piyushdotcomm May 29, 2026
36054e7
Merge pull request #314 from MaitrayeeK/fix/aria-labels-icon-buttons
piyushdotcomm May 29, 2026
9e75f63
Merge pull request #311 from pooja-0206/main
piyushdotcomm May 29, 2026
5cc126d
Merge pull request #310 from rutul2006/refactor/icon-tailwind-colors
piyushdotcomm May 29, 2026
4dbd72f
Merge pull request #309 from rutul2006/issue-287-empty-state-alt
piyushdotcomm May 29, 2026
f31c30e
Merge branch 'develop' into feat/runtime-activity-panel
Bhagy-Yelleti May 29, 2026
e577328
Merge branch 'develop' into feat/split-view-editor
Bhagy-Yelleti May 29, 2026
c055190
Merge branch 'upstream/develop' into fix/project-table-types
angelina-2206 May 29, 2026
0816d52
fix(playground): remove leftover console.log statements in actions
swarnimbandekar May 29, 2026
5a827c7
fix(deploy): add rate limiting to Vercel deploy endpoint
anshul23102 May 29, 2026
5f7bccf
Merge branch 'upstream/develop' into fix/stable-key-props
angelina-2206 May 29, 2026
3fdd020
Merge branch 'develop' into ai-hook
Srushti-Kamble14 May 29, 2026
be571e1
Merge branch 'develop' into kpi-statistics
Srushti-Kamble14 May 29, 2026
27e7e39
fix: added aria-labels to package manager icon buttons
harshiyasaxena May 29, 2026
06ea184
fix: distinguish dev dependency aria-labels
harshiyasaxena May 29, 2026
f69ad35
Merge branch 'develop' into main
STRANGENIKHIL May 29, 2026
238e621
feat: enable LogoutButton customization and mobile sidebar logout
CodesWithSubham May 29, 2026
5043e0f
fix(profile): replace any[] with Prisma Playground type #399
jainsomil714-debug May 29, 2026
b7c5e54
fix(qwik): strongly type Promise opts in hero component #400
jainsomil714-debug May 29, 2026
1e5f5fa
fix(api): strongly type catch error in upload-zip route #401
jainsomil714-debug May 29, 2026
56d2c52
fix(api): strongly type catch error in download route #402
jainsomil714-debug May 29, 2026
d3c3534
fix(api): type the Netlify deployment files parameter #403
jainsomil714-debug May 29, 2026
d4b88f2
fix(profile): remove any from playground filtering #404
jainsomil714-debug May 29, 2026
d36e745
fix(playground): resolve @ts-ignore in playground actions #405
jainsomil714-debug May 29, 2026
3d54260
fix(api): resolve @ts-expect-error in upload-zip route #406
jainsomil714-debug May 29, 2026
704c8c4
fix(terminal): correct missing React hooks dependencies #407
jainsomil714-debug May 29, 2026
c9999ab
fix(playground): correct missing React hooks dependencies in playgrou…
jainsomil714-debug May 29, 2026
4357395
fix: add DATABASE_URL validation for collaboration server
May 30, 2026
84e4105
chore: improve DATABASE_URL validation message
May 30, 2026
47f41ca
fix: add aria labels to env manager icon buttons
pragya0129 May 30, 2026
22ef997
Merge branch 'develop' into validation
KaranUnique May 30, 2026
eef3667
fix: handle non-json responses gracefully in github import dialog
AQUA1310 May 30, 2026
91effe7
fix: stabilize useEffect dependencies in webcontainer preview
pari-28 May 30, 2026
efae2cd
Merge pull request #418 from Somil450/fix/editor-hooks-deps
piyushdotcomm May 30, 2026
8e9c256
Merge pull request #417 from Somil450/fix/terminal-hooks-deps
piyushdotcomm May 30, 2026
8163d0f
Merge pull request #416 from Somil450/fix/upload-zip-ts-expect-error
piyushdotcomm May 30, 2026
ef128b4
Merge pull request #415 from Somil450/fix/playground-actions-ts-ignore
piyushdotcomm May 30, 2026
e469156
Merge pull request #413 from Somil450/fix/netlify-deploy-files-type
piyushdotcomm May 30, 2026
48240d6
Merge pull request #411 from Somil450/fix/upload-zip-catch-type
piyushdotcomm May 30, 2026
82eb2dc
Merge pull request #410 from Somil450/fix/qwik-hero-promise-type
piyushdotcomm May 30, 2026
d9ffca5
Merge pull request #409 from Somil450/fix/profile-actions-type
piyushdotcomm May 30, 2026
6968632
Merge pull request #358 from Bhagy-Yelleti/feat/split-view-editor
piyushdotcomm May 30, 2026
5c82012
Merge pull request #354 from KaranUnique/validation
piyushdotcomm May 30, 2026
69ab5c8
Merge pull request #351 from STRANGENIKHIL/main
piyushdotcomm May 30, 2026
f87f90e
Merge pull request #326 from Srushti-Kamble14/kpi-statistics
piyushdotcomm May 30, 2026
954f76e
Merge pull request #313 from angelina-2206/fix/stable-key-props
piyushdotcomm May 30, 2026
e435745
Merge pull request #312 from angelina-2206/fix/project-table-types
piyushdotcomm May 30, 2026
d34ca7c
Merge branch 'develop' into fix/profile-page-filter-type
Somil450 May 30, 2026
d478df9
Merge branch 'develop' into fix/download-route-catch-type
Somil450 May 30, 2026
c422728
Merge branch 'develop' into ai-hook
Srushti-Kamble14 May 30, 2026
b86d13d
Merge branch 'develop' into feat/runtime-activity-panel
Bhagy-Yelleti May 30, 2026
0fa286a
Merge pull request #414 from Somil450/fix/profile-page-filter-type
piyushdotcomm May 30, 2026
8e29f95
Merge pull request #412 from Somil450/fix/download-route-catch-type
piyushdotcomm May 30, 2026
aa4e405
Merge pull request #353 from Bhagy-Yelleti/feat/runtime-activity-panel
piyushdotcomm May 30, 2026
847efaf
Merge pull request #325 from Srushti-Kamble14/ai-hook
piyushdotcomm May 30, 2026
3837769
fix(security): prevent ip spoofing rate limit bypass
Vedhant26 May 30, 2026
497116c
fix(security): resolve coderabbit review comments for getClientIp
Vedhant26 May 30, 2026
9ead8e9
feat: add Code Time Travel feature with AI explanations (#357)
sivaangayarkanni May 31, 2026
6f8040a
added moving popular templates section
ruhuRaj May 31, 2026
cbd4d64
fix: correct theme toggle icon active state
nishitha011 Jun 1, 2026
5096f53
fix: address marquee accessibility review comments
ruhuRaj Jun 1, 2026
09f49bf
Perf/lighthouse v2 (#356)
YASHcode-IIITV Jun 1, 2026
a982e6d
refactor(react): address missing hook dependencies to remove exhausti…
Exodus2004 Jun 1, 2026
08062ea
chore(profile): improve type safety by replacing 'any' types
Exodus2004 Jun 1, 2026
03a2ff7
fix(react): add missing useCallback import
Exodus2004 Jun 1, 2026
d5bbfb9
chore(profile): improve type safety by replacing 'any' types
Exodus2004 Jun 1, 2026
e72fd60
Merge pull request #444 from Exodus2004/fix-profile-any-types
piyushdotcomm Jun 1, 2026
e19817a
Merge pull request #437 from ruhuRaj/bug_fix
piyushdotcomm Jun 1, 2026
70c40aa
Merge pull request #445 from Exodus2004/fix-exhaustive-deps
piyushdotcomm Jun 1, 2026
d8764f1
Merge pull request #439 from nishitha011/fix-theme-toggle-icon-395
piyushdotcomm Jun 1, 2026
6278c8a
Merge pull request #432 from Vedhant26/fix/ip-spoofing-rate-limit
piyushdotcomm Jun 1, 2026
7802eaf
Merge pull request #424 from pari-28/fix-273-useeffect-dependency
piyushdotcomm Jun 1, 2026
9cc6df9
Merge pull request #422 from AQUA1310/fix/github-import-json-error
piyushdotcomm Jun 1, 2026
f207854
Merge pull request #419 from harshavardhani22/fix-production-deployment
piyushdotcomm Jun 1, 2026
cd91860
Merge pull request #398 from CodesWithSubham/feat/mobile-dashboard-si…
piyushdotcomm Jun 1, 2026
095b1fc
Merge pull request #393 from swarnimbandekar/fix/remove-console-logs-…
piyushdotcomm Jun 1, 2026
ab85820
Merge pull request #391 from harshiyasaxena/fix/package-manager-aria-…
piyushdotcomm Jun 1, 2026
23c0954
Merge pull request #389 from anshul23102/fix/382-vercel-rate-limit
piyushdotcomm Jun 1, 2026
6239073
Merge pull request #308 from chetisha28/main
piyushdotcomm Jun 1, 2026
f811c1b
Merge pull request #166 from aparna24bce11388/feature/shortcut-modal
piyushdotcomm Jun 1, 2026
55f2421
Merge pull request #153 from algojogacor/fix/typo-myplayground-schema
piyushdotcomm Jun 1, 2026
6976199
Merge pull request #114 from akash3911/export-feature
piyushdotcomm Jun 1, 2026
5f3d851
Merge branch 'develop' into fix/add-aria-label-env-manager-buttons
pragya0129 Jun 1, 2026
45dcb6d
feat(playground): add ai-powered readme generator (#268)
AdityaM-IITH Jun 1, 2026
5042fb1
fix(security): prevent OAuth account takeover via improper linking (#…
Vedhant26 Jun 1, 2026
02d7e6a
Merge pull request #421 from pragya0129/fix/add-aria-label-env-manage…
piyushdotcomm Jun 2, 2026
5ee79a5
fix: improve Yjs reconnect recovery after file rename (#255)
YASHcode-IIITV Jun 3, 2026
45f9eb3
Fix/logout button hydration error (#425)
prasangeet Jun 6, 2026
6781da4
fix: remove redundant variable assignment in code-line.tsx
narutamaaurum Jun 8, 2026
f5a704a
fix: add word boundaries to code highlighting regex
narutamaaurum Jun 9, 2026
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
29 changes: 0 additions & 29 deletions .env.example

This file was deleted.

2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
87 changes: 84 additions & 3 deletions app/(root)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import { getPopularTemplateSummaries } from "@/lib/templates/actions";
import { HomePageClient } from "@/components/marketing/home-page-client";

import { useState, useEffect } from "react";
import { Button } from "@/components/ui/button";
import { ArrowRight } from "lucide-react";
import Link from "next/link";
import { Features } from "@/modules/home/features";
import { HeroCodeDemo } from "@/modules/home/hero-code";
import dynamic from "next/dynamic";


import { CommitsGrid } from "@/components/ui/commits-grid";
import { cn } from "@/lib/utils";
import { templates } from "@/lib/constants/templates";
import { TemplateCard } from "@/components/marketing/template-card";

export default function Home() {
const [isLoading, setIsLoading] = useState(true);
export default async function Home() {
const popularTemplates = await getPopularTemplateSummaries(4);

// Schema Markup for AI SEO (Organization & SoftwareApplication)
const schemaMarkup = {
Comment on lines +18 to 23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Default export declarations:"
rg -n '^\s*export\s+default' 'app/(root)/page.tsx'

echo
echo "Hook usage + client directive presence:"
rg -n 'useState|useEffect|^"use client";' 'app/(root)/page.tsx'

echo
echo "Tail of file to confirm orphaned JSX:"
nl -ba 'app/(root)/page.tsx' | sed -n '108,132p'

Repository: piyushdotcomm/Editron

Length of output: 439


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='app/(root)/page.tsx'

echo "=== File head (1-80) with line numbers ==="
awk 'NR>=1 && NR<=80 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== File middle (80-140) with line numbers ==="
awk 'NR>=80 && NR<=160 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== Presence of use client directive ==="
rg -n '["'\'']use client["'\''];|^"use client"$' "$FILE" || true

echo
echo "=== Quick syntax hints: default exports + JSX end ==="
rg -n '^\s*export\s+default' "$FILE"

Repository: piyushdotcomm/Editron

Length of output: 4598


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='app/(root)/page.tsx'

echo "=== File head (1-80) with line numbers ==="
awk 'NR>=1 && NR<=80 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== File middle (80-140) with line numbers ==="
awk 'NR>=80 && NR<=160 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== Presence of use client directive ==="
rg -n '["'\'']use client["'\''];|^"use client"$' "$FILE" || true

echo
echo "=== Quick syntax hints: default exports + JSX end ==="
rg -n '^\s*export\s+default' "$FILE"

Repository: piyushdotcomm/Editron

Length of output: 4598


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='app/(root)/page.tsx'

echo "=== File head (1-80) with line numbers ==="
awk 'NR>=1 && NR<=80 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== File middle (80-140) with line numbers ==="
awk 'NR>=80 && NR<=160 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== Presence of use client directive ==="
rg -n '["'\'']use client["'\''];|^"use client"$' "$FILE" || true

echo
echo "=== Quick syntax hints: default exports + JSX end ==="
rg -n '^\s*export\s+default' "$FILE"

Repository: piyushdotcomm/Editron

Length of output: 4598


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='app/(root)/page.tsx'

echo "=== File head (1-80) with line numbers ==="
awk 'NR>=1 && NR<=80 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== File middle (80-160) with line numbers ==="
awk 'NR>=80 && NR<=160 {printf "%5d:%s\n", NR, $0}' "$FILE"

echo
echo "=== Presence of use client directive ==="
rg -n '["'\'']use client["'\''];|^"use client"$' "$FILE" || true

echo
echo "=== Default export declarations ==="
rg -n '^\s*export\s+default' "$FILE"

Repository: piyushdotcomm/Editron

Length of output: 4580


Resolve merged Home conflict (this file is currently non-compilable).

  • app/(root)/page.tsx has two export default Home declarations (export default function Home() at line 18 and export default async function Home() at line 20).
  • There’s stray/out-of-scope JSX after the function closes (<HomePageClient popularTemplates={popularTemplates} /> around lines 120-123), leaving mismatched closing braces/tags.
  • The file uses useState/useEffect but contains no "use client" directive; keep hooks inside HomePageClient (or make a proper client component) and keep the server getPopularTemplateSummaries fetch in the server Home.
🧰 Tools
🪛 Biome (2.4.16)

[error] 18-123: Illegal duplicate default export declarations

(parse)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`(root)/page.tsx around lines 18 - 23, You have two conflicting Home
exports and client hooks in a server component; keep only the async server
component Home that calls getPopularTemplateSummaries(4) and returns the JSX
which renders the client component HomePageClient, then move any
useState/useEffect logic into the HomePageClient component (or make
HomePageClient a separate file) and add the "use client" directive at the top of
that client component; remove the duplicate export default function Home() and
stray/mismatched JSX so Home returns a single valid element <HomePageClient
popularTemplates={popularTemplates} /> and ensure HomePageClient accepts
popularTemplates prop and contains the hooks and client-only logic.

"@context": "https://schema.org",
"@graph": [
Expand All @@ -24,18 +39,84 @@ export default async function Home() {
{
"@type": "Organization",
name: "Editron",
url: "https://editron.vercel.app", // Replace with your domain once active
url: "https://editron.vercel.app",
logo: "https://editron.vercel.app/logo.svg",
},
],
};

useEffect(() => {
const timer = setTimeout(() => {
setIsLoading(false);
}, 3200);
return () => clearTimeout(timer);
}, []);

return (
<div className="relative min-h-screen bg-background selection:bg-primary/20 overflow-hidden font-sans">
<div className="relative min-h-screen bg-background overflow-hidden">
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaMarkup) }}
/>

{/* Loading */}
<div
className={cn(
"fixed inset-0 z-[9999] flex items-center justify-center bg-background transition-opacity",
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
)}
>
<CommitsGrid text="EDITRON" />
</div>



<main className="pt-20 px-4 max-w-7xl mx-auto space-y-20">

{/* HERO */}
<section className="text-center space-y-6">
<h1 className="text-5xl font-bold">
Code with Intelligence & Speed
</h1>

{/* ✅ FIXED BUTTON */}
<Button asChild size="lg">
<Link href="/dashboard">
Start Coding for Free
<ArrowRight className="ml-2 h-4 w-4" />
</Link>
</Button>

{/* ✅ FIXED BUTTON */}
<Button asChild variant="outline" size="lg">
<Link href="#features">
Explore Features
</Link>
</Button>
</section>

{/* DEMO */}
<HeroCodeDemo />

{/* TEMPLATES */}
<section>
<h2 className="text-2xl font-bold mb-4">Popular Templates</h2>
<div className="grid grid-cols-2 gap-4">
{templates.slice(0, 4).map((t) => (
<TemplateCard key={t.id} template={t} />
))}
</div>
</section>

{/* FEATURES */}
<section id="features">
<Features />
</section>

</main>
</div>
);
}
<HomePageClient popularTemplates={popularTemplates} />
</div>
);
Expand Down
206 changes: 206 additions & 0 deletions app/api/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vi.mock("next/server", () => ({
}));

import { tools, MAX_FILE_CONTENT_CHARS, schemas } from "./chat/tools";
import { schemas as chatSchemas } from "./chat/route";

describe("AI tool payload validation", () => {
const MAX = MAX_FILE_CONTENT_CHARS;
Expand Down Expand Up @@ -42,3 +43,208 @@ describe("AI tool payload validation", () => {
expect(parsed.success).toBe(false);
});
});

// Chat API Endpoint Validation Tests
describe("/api/chat - Payload Size Validation", () => {
const SIZE_LIMITS = {
MAX_MESSAGE_CONTENT: 100_000,
MAX_PART_TEXT: 50_000,
MAX_TOTAL_PAYLOAD: 1_000_000,
MAX_MESSAGE_COUNT: 100,
};

describe("Single message content validation", () => {
it("accepts message at max content limit", () => {
const content = "a".repeat(SIZE_LIMITS.MAX_MESSAGE_CONTENT);
const payload = {
messages: [{ role: "user", content }],
provider: "gemini"
};
const parsed = chatSchemas.RequestBodySchema.safeParse(payload);
expect(parsed.success).toBe(true);
});

it("should reject message content exceeding limit", () => {
const content = "a".repeat(SIZE_LIMITS.MAX_MESSAGE_CONTENT + 1);
const payload = {
messages: [{ role: "user", content }],
provider: "gemini"
};
const parsed = chatSchemas.RequestBodySchema.safeParse(payload);
expect(parsed.success).toBe(false);
});
});

describe("Message parts validation", () => {
it("accepts part.text at max limit", () => {
const text = "a".repeat(SIZE_LIMITS.MAX_PART_TEXT);
const payload = {
messages: [{
role: "user",
parts: [{ type: "text", text }]
}],
provider: "gemini"
};
expect(text.length).toBe(SIZE_LIMITS.MAX_PART_TEXT);
});

it("should reject part.text exceeding limit", () => {
const text = "a".repeat(SIZE_LIMITS.MAX_PART_TEXT + 1);
const payload = {
messages: [{
role: "user",
parts: [{ type: "text", text }]
}],
provider: "gemini"
};
expect(text.length).toBeGreaterThan(SIZE_LIMITS.MAX_PART_TEXT);
});

it("accepts multiple small parts", () => {
const payload = {
messages: [{
role: "user",
parts: [
{ type: "text", text: "a".repeat(10000) },
{ type: "text", text: "b".repeat(10000) },
{ type: "text", text: "c".repeat(10000) },
]
}],
provider: "gemini"
};
const totalSize = JSON.stringify(payload).length;
expect(totalSize).toBeLessThanOrEqual(SIZE_LIMITS.MAX_TOTAL_PAYLOAD);
});
});

describe("Total payload size validation", () => {
it("accepts payload at total size limit", () => {
// Create payload close to but under 1MB
const messageCount = 10;
const contentPerMessage = Math.floor((SIZE_LIMITS.MAX_TOTAL_PAYLOAD - 5000) / messageCount);
const payload = {
messages: Array(messageCount).fill(null).map(() => ({
role: "user",
content: "a".repeat(contentPerMessage)
})),
provider: "gemini"
};
const totalSize = JSON.stringify(payload).length;
expect(totalSize).toBeLessThanOrEqual(SIZE_LIMITS.MAX_TOTAL_PAYLOAD);
});

it("should calculate total payload size correctly", () => {
const oversizedContent = "x".repeat(SIZE_LIMITS.MAX_TOTAL_PAYLOAD + 10000);
const payload = {
messages: [{ role: "user", content: oversizedContent }],
provider: "gemini"
};
const totalSize = JSON.stringify(payload).length;
expect(totalSize).toBeGreaterThan(SIZE_LIMITS.MAX_TOTAL_PAYLOAD);
});
});

describe("Message count validation", () => {
it("accepts max message count", () => {
const payload = {
messages: Array(SIZE_LIMITS.MAX_MESSAGE_COUNT).fill(null).map(() => ({
role: "user",
content: "short message"
})),
provider: "gemini"
};
expect(payload.messages.length).toBe(SIZE_LIMITS.MAX_MESSAGE_COUNT);
});

it("should reject exceeding message count", () => {
const payload = {
messages: Array(SIZE_LIMITS.MAX_MESSAGE_COUNT + 1).fill(null).map(() => ({
role: "user",
content: "short message"
})),
provider: "gemini"
};
expect(payload.messages.length).toBeGreaterThan(SIZE_LIMITS.MAX_MESSAGE_COUNT);
});
});

describe("Message structure validation", () => {
it("rejects message without role", () => {
const payload = {
messages: [{ content: "test" }],
provider: "gemini"
};
// Missing required 'role' field
expect((payload.messages[0] as any).role).toBeUndefined();
});

it("rejects message with invalid role", () => {
const payload = {
messages: [{ role: "invalid", content: "test" }],
provider: "gemini"
};
const validRoles = ["system", "user", "assistant", "data", "tool"];
expect(validRoles).not.toContain(payload.messages[0].role);
});

it("rejects message without content or parts", () => {
const payload = {
messages: [{ role: "user" }],
provider: "gemini"
};
// Missing both content and parts
expect((payload.messages[0] as any).content).toBeUndefined();
expect((payload.messages[0] as any).parts).toBeUndefined();
});

it("rejects message with empty parts and no content", () => {
const payload = {
messages: [{ role: "user", parts: [] }],
provider: "gemini"
};
const parsed = chatSchemas.RequestBodySchema.safeParse(payload);
expect(parsed.success).toBe(false);
});
});

describe("Edge cases", () => {
it("handles very deeply nested large payloads", () => {
const payload = {
messages: [{
role: "user",
parts: Array(50).fill(null).map(() => ({
type: "text",
text: "a".repeat(10000)
}))
}],
provider: "gemini"
};
const totalSize = JSON.stringify(payload).length;
// 50 parts * 10000 chars each = 500KB, well under 1MB
expect(totalSize).toBeLessThan(SIZE_LIMITS.MAX_TOTAL_PAYLOAD);
});

it("handles unicode and special characters in size calculation", () => {
// Unicode characters can take multiple bytes
const payload = {
messages: [{
role: "user",
content: "🎉".repeat(50000) // Each emoji is ~4 bytes in UTF-8
}],
provider: "gemini"
};
const totalSize = JSON.stringify(payload).length;
expect(totalSize).toBeGreaterThan(0);
});

it("fileTree is limited to 50KB", () => {
const largeTree = "a".repeat(50_001);
const payload = {
messages: [{ role: "user", content: "test" }],
provider: "gemini",
fileTree: largeTree
};
expect(largeTree.length).toBeGreaterThan(50_000);
});
});
});
Loading