An AI-powered programming assistant designed for academic research on AI-assisted learning. Features instant AI responses, smart code analysis, structured learning tasks, and progress tracking. Built with Next.js, tRPC, and OpenAI GPT to help developers learn programming concepts, debug code, and solve programming challenges.
- AI-Powered Assistance: Real-time help with programming questions using OpenAI GPT with context-aware responses and conversation history
- Smart Code Analysis: Intelligent code review, bug detection, error explanations, and performance optimization recommendations
- Structured Learning: Pre and post-assessment quizzes, programming tasks by difficulty, and personalized learning paths
- Type-Safe APIs: Full-stack TypeScript with tRPC for end-to-end type safety from frontend to database
- Progress Tracking: Comprehensive analytics dashboard with user statistics, learning metrics, and progress visualization
- Research Compliant: GDPR-compliant data collection with anonymous user identification for academic research
- Frontend: Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS 4
- Backend: tRPC 11, Node.js, Prisma 6, PostgreSQL
- AI: OpenAI GPT (via OpenAI API)
- Authentication: Clerk
- State Management: TanStack Query (React Query)
- Testing: Jest, React Testing Library
- Deployment: Vercel
-
Clone the repository:
git clone https://github.com/Bogdusik/Programming-Helper-AI.git cd Programming-Helper-AI -
Install dependencies:
npm install
-
Configure environment variables: Create
.env.localfile:DATABASE_URL="postgresql://user:password@localhost:5432/programming_helper_ai" OPENAI_API_KEY="your-openai-api-key" NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="your-clerk-publishable-key" CLERK_SECRET_KEY="your-clerk-secret-key" NEXT_PUBLIC_APP_URL="http://localhost:3000" -
Set up the database:
npm run db:generate npm run db:push npm run db:init-rate-limits
-
Start the development server:
npm run dev
Application will be available at
http://localhost:3000
Important: Never hardcode secrets. Always use
.env.localfile for sensitive data.
- @trpc/server and all
@trpc/*packages are kept at 11.8.0+ to fix the Prototype Pollution vulnerability (Snyk). - Next.js 16 upgrade from Snyk should not be merged until
@clerk/nextjssupports Next.js 16 (Clerk is not yet compatible; build would fail). The project stays on Next.js 15.x. The Next.js “Allocation of Resources” finding is ignored in.snykwith an expiry; re-scan or remove the ignore once Clerk supports Next 16.
Programming-Helper-AI/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ └── trpc/ # tRPC API endpoint
│ ├── chat/ # Chat interface page
│ ├── admin/ # Admin dashboard
│ ├── stats/ # Statistics page
│ └── [other pages]
│
├── components/ # React Components
│ ├── ChatBox.tsx # Main chat interface
│ ├── ChatSidebar.tsx # Chat sessions sidebar
│ ├── Navbar.tsx # Navigation bar
│ └── [other components]
│
├── docs/ # Documentation
│ ├── API_DOCUMENTATION.md # REST & tRPC API, usage
│ └── RESEARCH_ETHICS.md # Research ethics, GDPR
│
├── lib/ # Core Libraries
│ ├── trpc.ts # tRPC router & procedures
│ ├── openai.ts # OpenAI integration
│ ├── db.ts # Prisma client
│ ├── auth.ts # Authentication utilities
│ └── [other utilities]
│
├── prisma/ # Database
│ ├── schema.prisma # Prisma schema
│ └── migrations/ # Database migrations
│
├── hooks/ # Custom React Hooks
│ └── [custom hooks]
│
├── __tests__/ # Test Files
│ ├── components/ # Component tests
│ ├── lib/ # Library tests
│ └── api/ # API tests
│
├── scripts/ # Utility Scripts
│ └── [script files]
│
├── postman/ # Postman collections
│
└── [config files] # Root config (next, ts, jest, etc.)
├── next.config.ts
├── tsconfig.json
└── jest.config.js
Documentation: API and research ethics — see docs/.
- Full-Stack TypeScript: Built complete type-safe application with tRPC, ensuring type safety from frontend to database
- AI Integration: Integrated OpenAI GPT API for intelligent code analysis, debugging assistance, and conversational AI
- Next.js App Router: Leveraged Next.js 15 App Router for modern React patterns, server components, and API routes
- Database Design: Designed relational schema with Prisma for users, conversations, tasks, assessments, and analytics
- Research Ethics: Implemented GDPR-compliant data collection with anonymous user identification and research consent mechanisms
- Testing Strategies: Wrote comprehensive tests for React components, API endpoints, and business logic using Jest and React Testing Library
Fork it, use it, improve it - open to PRs!



