A modern web application for Programme.lv, a programming contest and learning platform built with Next.js 14 and NextUI.
- Interactive code editor with Monaco Editor integration
- Real-time submission updates and evaluation results
- Task difficulty visualization and filtering
- Submission scoring with detailed test results
- Markdown rendering with LaTeX support
- JWT-based authentication
- Dark/light theme support
- Responsive design for all devices
- Next.js 14 - React framework with app directory
- NextUI v2 - Modern UI components
- Monaco Editor - Code editing
- Tailwind CSS - Utility-first CSS
- TypeScript - Type safety
- Framer Motion - Animations
- next-themes - Theme management
Core UI Components:
layout.tsx- Main application layout with navigationnavbar.tsx,navbar-user.tsx- Navigation and user menusidebar.tsx- Side navigation menuauth-card-with-bg.tsx- Authentication forms
Task-related Components:
task-list-card.tsx- Task browsing interfacetask-difficulty-chip.tsx- Difficulty level displaycode-block.tsx- Code snippet displayro-monaco-code.tsx- Read-only code editor
Submission Components:
submission-table.tsx- Submission history displaysubm-list-real-time.tsx- Real-time submission updateseval-test-result-card.tsx- Test result visualizationsubm-table-score-bars.tsx- Visual score representationsubm-info-header.tsx- Submission details header
API Integration:
auth.ts- Authentication utilitiesjwt.ts- JWT token handlingtasks.ts- Task management functionssubms.ts- Submission handlingapi-response.ts- API response types
Utilities:
render-md.ts- Markdown rendering with LaTeXscore-subm.ts- Submission scoring logiclangs.ts- Programming language utilitiesconstants.ts- Application constantsconfig.ts- Environment configuration
Data Models:
task.ts- Task and test case typesexec.ts- Execution and evaluation typesproglv.ts- Core platform types
- Node.js 18.17 or later
- Programme.lv backend server running locally or accessible URL
Create a .env.local file in the root directory:
NEXT_PUBLIC_API_HOST=http://localhost:8080 # Backend API URL (default: https://api.programme.lv)- Clone the repository:
git clone https://github.com/programme-lv/website.git
cd website- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Start the development server:
npm run dev
# or
yarn dev
# or
pnpm devThe application will be available at http://localhost:3000.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run type-check- Run TypeScript compiler check
- ESLint configuration for code linting
- Prettier for code formatting
- TypeScript for type safety
- Tailwind CSS for styling
-
Authentication:
- JWT-based auth with automatic token refresh
- Protected route handling
- User session management
-
Task Management:
- Markdown rendering with LaTeX support
- Difficulty level visualization
- Test case management
- Asset handling
-
Submissions:
- Real-time execution updates
- Test result visualization
- Score calculation
- History tracking
-
Code Editing:
- Monaco Editor integration
- Syntax highlighting
- Language support
- Read-only mode
The frontend communicates with the Programme.lv backend API for:
- User authentication and session management
- Task retrieval and asset management
- Code submission and execution
- Real-time evaluation updates via SSE
- User profile and statistics