Next.js frontend application for the Devlabs project management and evaluation system. Provides an intuitive interface for administrators, faculty, and students to collaborate on project-based learning.
- Framework: Next.js 16 with App Router
- Language: TypeScript
- UI Library: React 19
- Styling: Tailwind CSS
- Components: shadcn/ui + Radix UI
- State Management: React Query (TanStack Query)
- Authentication: NextAuth.js
- HTTP Client: Axios
- Package Manager: pnpm
- Node.js 18 or higher
- pnpm (recommended)
- Docker & Docker Compose (for containerized setup)
git clone https://github.com/TharunCodes07/devlabs-frontend.git
cd devlabs-frontendCopy the example environment file and update with your values:
cp .env.example .envEdit .env and update with your backend URL and Keycloak settings.
docker-compose up -dThe application will be available at http://localhost:3000
docker-compose downgit clone https://github.com/TharunCodes07/devlabs-frontend.git
cd devlabs-frontend
pnpm installCopy .env.example to .env and configure:
NODE_ENV=development
AUTH_SECRET=your_auth_secret_key
NEXT_REDIRECT=http://localhost:3000
LOG_LEVEL=info
AUTH_KEYCLOAK_ID=devlabs-client
AUTH_KEYCLOAK_SECRET=client_secret_123
AUTH_KEYCLOAK_ISSUER=http://localhost:8060/realms/devlabs
BACKEND_API_URL=http://localhost:8090
NEXT_PUBLIC_API_URL=http://localhost:8090
FRONTEND_PORT=3000pnpm devOpen http://localhost:3000 in your browser.
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
pnpm lint:fix |
Fix ESLint issues |
pnpm format |
Format with Prettier |
pnpm format:check |
Check formatting |
Key environment variables (see .env.example for complete list):
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode | development |
AUTH_SECRET |
NextAuth secret key | - |
NEXT_REDIRECT |
Redirect URL after auth | http://localhost:3000 |
LOG_LEVEL |
Logging level (trace/debug/info/warn/error) | info |
AUTH_KEYCLOAK_ID |
Keycloak client ID | - |
AUTH_KEYCLOAK_SECRET |
Keycloak client secret | - |
AUTH_KEYCLOAK_ISSUER |
Keycloak issuer URL | - |
BACKEND_API_URL |
Backend API URL (server-side) | http://localhost:8090 |
NEXT_PUBLIC_API_URL |
Backend API URL (client-side) | http://localhost:8090 |
FRONTEND_PORT |
Port to run on | 3000 |
- Course and semester organization
- Student and faculty management
- Batch assignment and tracking
- Project lifecycle management
- Team formation and collaboration
- File upload and document management
- Status tracking (Proposed, Ongoing, Completed, Rejected)
- Course evaluations with custom criteria
- Peer and instructor assessments
- Multi-stage review process
- Individual scoring with rubrics
- Performance dashboards
- Progress tracking
- Data export capabilities
- Interactive charts and visualizations
- Responsive design for all devices
- Dark/Light mode
- Drag & drop interactions
- Real-time updates
For single instance deployment without load balancing:
Set production values in .env:
NODE_ENV=production
AUTH_SECRET=strong_random_secret_min_32_chars
NEXT_REDIRECT=https://your-domain.com
AUTH_KEYCLOAK_ISSUER=https://your-keycloak-domain.com/realms/devlabs
BACKEND_API_URL=https://your-backend-api.com
NEXT_PUBLIC_API_URL=https://your-backend-api.comdocker-compose up -ddocker-compose logs -f frontendFor production environments requiring high availability and load balancing across multiple frontend instances:
graph TB
Client[Client Requests]
Nginx[Nginx Load Balancer<br/>Port: 7000]
subgraph Frontend Instances
F1[Frontend Instance 1<br/>Internal: 3000]
F2[Frontend Instance 2<br/>Internal: 3000]
F3[Frontend Instance 3<br/>Internal: 3000]
end
Backend[Backend API<br/>Port: 8090]
KC[Keycloak<br/>Auth Server]
Client --> Nginx
Nginx -->|Round Robin| F1
Nginx -->|Round Robin| F2
Nginx -->|Round Robin| F3
F1 --> Backend
F2 --> Backend
F3 --> Backend
F1 --> KC
F2 --> KC
F3 --> KC
- Nginx Reverse Proxy: Distributes incoming requests across 3 frontend instances using round-robin algorithm
- Load Balancing: Automatic failover if an instance becomes unhealthy (max 3 fails, 30s timeout)
- Session Handling: NextAuth handles sessions via JWT tokens, no sticky sessions needed
- Health Checks: Nginx monitors root endpoint for each frontend instance
- Static Asset Caching: Nginx caches
_next/staticassets for better performance - Scalability: Add or remove instances by modifying
docker-compose.prod.yml
The nginx.conf file is already configured for load balancing. You can adjust the number of instances by modifying the upstream block:
upstream frontend_servers {
server frontend-1:3000 max_fails=3 fail_timeout=30s;
server frontend-2:3000 max_fails=3 fail_timeout=30s;
server frontend-3:3000 max_fails=3 fail_timeout=30s;
}docker-compose -f docker-compose.prod.yml up -dThis will start:
- 3 frontend instances (frontend-1, frontend-2, frontend-3)
- 1 Nginx load balancer (exposed on port 7000)
To add more instances, edit docker-compose.prod.yml and add frontend-4, frontend-5, etc., then update nginx.conf and restart:
docker-compose -f docker-compose.prod.yml up -dCheck which frontend instance is serving requests:
curl -I http://localhost:7000Look for the X-Upstream-Server header to see which instance responded.
All instances:
docker-compose -f docker-compose.prod.yml logs -fSpecific instance:
docker-compose -f docker-compose.prod.yml logs -f frontend-1Nginx logs:
docker-compose -f docker-compose.prod.yml logs -f nginx- High Availability: If one instance fails, Nginx automatically routes to healthy instances
- Load Distribution: Requests distributed evenly using round-robin
- Better Performance: Static assets cached by Nginx
- Zero Downtime Deployments: Rolling updates possible by restarting instances one at a time
- Horizontal Scaling: Easy to add more instances as traffic grows
- WebSocket Support: Properly configured for Next.js live reload and real-time features
devlabs-frontend/
├── src/
│ ├── app/ # Next.js app router pages
│ │ ├── (auth)/ # Authentication pages
│ │ ├── (devlabs)/ # Main app pages
│ │ └── api/ # API routes
│ ├── components/ # React components
│ │ ├── admin/
│ │ ├── dashboard/
│ │ ├── evaluations/
│ │ ├── projects/
│ │ ├── teams/
│ │ └── ui/ # shadcn/ui components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and configs
│ │ ├── axios/ # API client
│ │ ├── auth.ts # Auth config
│ │ ├── logger.ts # Pino logger
│ │ └── utils.ts # Helper functions
│ ├── repo/ # API query functions
│ └── types/ # TypeScript types
├── public/ # Static assets
├── docker-compose.yml
├── Dockerfile
├── next.config.ts
├── tailwind.config.ts
└── package.json
The application uses Pino for structured logging. Control log verbosity with LOG_LEVEL:
trace- Most verbosedebug- Debug informationinfo- General information (default)warn- Warningserror- Errors onlyfatal- Critical errors
Usage:
import { logger } from "@/lib/logger";
logger.info("User logged in", { userId: "123" });
logger.error("API call failed", { error, endpoint: "/api/users" });Check logs:
docker-compose logs frontendVerify Keycloak configuration in .env:
- Correct realm name
- Valid client ID and secret
- Accessible issuer URL
Ensure:
- Backend is running and accessible
- CORS is configured on backend
BACKEND_API_URLandNEXT_PUBLIC_API_URLare correct
- Create and manage academic courses
- Assign instructors and students
- Organize courses within semesters
- Track course-specific performance metrics
- Project proposal and approval workflow
- Team assignment and collaboration tools
- File upload and version management
- Multi-stage review and evaluation process
- Customizable evaluation criteria
- Peer and instructor assessments
- Real-time scoring and feedback
- Comprehensive rubric management
- Performance tracking across courses and projects
- Visual representations of progress and achievements
- Export capabilities for detailed reporting
- Trend analysis and insights
We welcome contributions! Whether it's fixing a bug, improving documentation, or suggesting new features.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use existing components from shadcn/ui
- Write meaningful commit messages
- Test your changes thoroughly
- Update documentation as needed
This project is part of the Devlabs ecosystem.
Built with ❤️ by the Devlabs team.