A Next.js application that enables users to generate web applications using Claude AI.
This project is a functional prototype of an AI-powered no-code platform. Your task is to review the codebase, identify performance and scalability issues, and implement fixes.
Time Limit: 3-4 hours Focus: Production readiness, performance, and scalability
- Next.js 15 with App Router
- React 19
- tRPC for type-safe APIs
- Prisma ORM with PostgreSQL
- Anthropic Claude API for AI generation
- TypeScript
- Node.js 18+
- PostgreSQL (or Supabase account)
- Claude API key from Anthropic
npm installcp .env.example .envEdit .env and add your credentials:
DATABASE_URL="postgresql://user:password@localhost:5432/nocode_ai"
ANTHROPIC_API_KEY="sk-ant-api03-..."Important: You need both a PostgreSQL database and a Claude API key for the app to run.
npx prisma generate
npx prisma db pushPopulate with test data to see the performance issues in action:
```bash npm run seed ```
This creates:
- 3 test users with sessions
- ~20 projects with components
- ~100+ generations
- Queue jobs in various states
- Activity logs
npm run devVisit http://localhost:3000
When you first visit the app, you'll be redirected to the login page.
Test Account:
- Email:
test@example.com
Simply enter this email and click "Sign in". The authentication system will automatically create a session for the assessment environment.
Note: This is a simplified auth system for the assessment. In production, this would require proper password authentication.
- Create account at supabase.com
- Create new project
- Copy connection string from Settings → Database
- Paste into
.envasDATABASE_URL
# Install PostgreSQL
# macOS: brew install postgresql
# Ubuntu: sudo apt-get install postgresql
# Create database
createdb nocode_ai
# Update .env
DATABASE_URL="postgresql://localhost:5432/nocode_ai"├── app/ # Next.js pages and layouts
├── components/ # React components
├── server/ # tRPC routers and configuration
│ ├── context.ts # Request context
│ ├── trpc.ts # tRPC setup
│ └── routers/ # API routes
├── services/ # Business logic
│ ├── ai-service.ts # Claude integration
│ └── queue-service.ts # Background jobs
├── lib/ # Utilities
│ └── prisma.ts # Database client
└── prisma/ # Database schema
└── schema.prisma # Data models
- Review the codebase for issues that would impact production
- Fix critical problems related to performance, memory, and concurrency
- Document your findings in
SOLUTION.md - Test your changes to ensure they work
See ASSESSMENT.md for detailed instructions.
npm run dev # Start development server
npm run build # Build for production
npm run start # Run production build
npm run lint # Run ESLint
npm run seed # Seed database with test dataThe app uses session-based authentication. For this assessment:
- Login page:
/auth/login - Test email:
test@example.com - Sessions persist for 7 days
- Auth token is stored in localStorage
- Logout button is in the top-right corner of the dashboard
- Setup issues: Contact your interviewer
- Assessment questions: Work independently
- Focus on impactful fixes over minor improvements
- Prioritize your time - you won't fix everything
- Document your reasoning and trade-offs
Good luck! 🚀