This is a Next.js 15.4.8 application built with React 18 and TypeScript for managing student presence and schedules at ENI (École Nationale d'Informatique). The application provides comprehensive tools for room management, teacher management, schedule creation, and presence tracking with dashboard analytics.
- Room Management: Full CRUD operations with PDF export functionality
- Teacher Management: Manage professor information and assignments
- Schedule Management (EDT): Create and manage "Emploi du Temps" (timetables)
- Level Management: Configure and manage student levels/grades
- Teaching Unit Management: Organize teaching units and courses
- Presence Tracking: Track and monitor student attendance
- Import/Export: Bulk data operations for efficient management
- Dashboard Analytics: Visual charts and statistics for presence monitoring
- Authentication: Role-based access control with secure login
- Responsive Design: Mobile-friendly UI built with Tailwind CSS and Radix UI
Before running the application, ensure you have the following installed:
- Node.js: 18.x (LTS) - REQUIRED
- npm: 8.x or 9.x (comes bundled with Node.js 18.x)
- Clone the repository:
git clone https://github.com/2RK-dev/Pointeur-Front.git
cd Pointeur-Front- Install dependencies:
npm installNote: Installation takes approximately 35 seconds. Do not cancel the process.
- Set up environment variables:
cp .env.example .env.localEdit .env.local with your specific configuration values (see Environment Variables section below).
Start the development server:
npm run devThe application will be available at http://localhost:3000 (starts in approximately 1.4 seconds).
Build the application for production:
npm run buildStart the production server:
npm startOr specify a custom port:
npm start -- -p 8080Run ESLint to check code quality:
npm run lintRun Jest tests:
npm run testThis application uses environment variables for configuration. Copy .env.example to .env.local and configure the following variables:
API_BASE_URL: Base URL for API requests- Example:
API_BASE_URL=http://localhost:8888/api - Used by the axios HTTP client for all API calls
- Example:
NEXT_PUBLIC_DEV_MODE: Skip authentication and block API calls (for UI development only)- Example:
NEXT_PUBLIC_DEV_MODE=true - Default:
false - When enabled, bypasses authentication and uses mock user credentials
- Example:
-
Copy the example environment file:
cp .env.example .env.local
-
Edit
.env.localwith your specific configuration values -
Restart the development server if running:
npm run dev
The application follows Next.js 15 App Router conventions:
src/
├── app/ # Next.js App Router pages
│ ├── (Main)/ # Main application routes (protected)
│ │ ├── EDT/ # Schedule (Emploi du Temps) management
│ │ ├── Level/ # Level/Grade management
│ │ ├── Teacher/ # Teacher (Professor) management
│ │ ├── Room/ # Room management
│ │ ├── TeachingUnit/ # Teaching unit management
│ │ ├── import-export/ # Import/Export functionality
│ │ ├── page.tsx # Dashboard page
│ │ ├── layout.tsx # Main layout with sidebar
│ │ └── loading.tsx # Loading state component
│ ├── auth/ # Authentication routes (public)
│ │ ├── login/ # Login page
│ │ └── layout.tsx # Auth layout
│ ├── layout.tsx # Root layout
│ └── globals.css # Global styles
├── components/ # Reusable UI components
│ ├── ui/ # Shadcn/UI component library (Radix UI based)
│ │ ├── button.tsx
│ │ ├── table.tsx
│ │ ├── dialog.tsx
│ │ └── ...
│ ├── sidebar-comp/ # Sidebar navigation components
│ │ ├── app-sidebar.tsx
│ │ ├── nav-main.tsx
│ │ └── nav-user.tsx
│ ├── auth-provider.tsx # Authentication context provider
│ └── ... # Other custom components
├── hooks/ # Custom React hooks
│ ├── use-auth-actions.ts
│ ├── use-mobile.tsx
│ └── use-toast.ts
├── lib/ # Utility functions and helpers
│ ├── utils.ts
│ ├── file-parser.ts
│ └── import-utils.ts
├── services/ # API service layer
│ ├── Auth.ts
│ ├── Room.ts
│ ├── Teacher.ts
│ ├── ScheduleItem.ts
│ ├── Level.ts
│ ├── TeachingUnit.ts
│ ├── DataTransfer.ts
│ └── mapper.ts
├── Stores/ # State management (Zustand stores)
│ ├── Auth.ts
│ ├── Room.ts
│ ├── Teacher.ts
│ ├── ScheduleItem.ts
│ ├── Level.ts
│ └── TeachingUnit.ts
├── Tools/ # Development tools and utilities
│ ├── PDF.ts
│ ├── import.tsx
│ └── ScheduleItem.ts
├── Types/ # TypeScript type definitions
│ ├── auth.ts
│ ├── Room.ts
│ ├── Teacher.ts
│ ├── ScheduleItem.ts
│ ├── LevelDTO.ts
│ ├── TeachingUnit.ts
│ └── GroupDTO.ts
└── api/ # API layer
├── http/ # HTTP request handlers (Axios)
│ ├── auth.ts
│ ├── room.ts
│ ├── teacher.ts
│ ├── schedule-item.ts
│ ├── level.ts
│ ├── teaching-unit.ts
│ ├── group.ts
│ └── data-transfer.ts
├── schemas/ # Zod validation schemas
│ ├── auth.ts
│ ├── room.ts
│ ├── teacher.ts
│ ├── schedule-item.ts
│ ├── level.ts
│ ├── teaching-unit.ts
│ ├── group.ts
│ └── import.ts
└── types.ts # API type definitions
- Next.js 15.4.8: React framework with App Router
- React 18: UI library with Server Components support
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
- Radix UI: Accessible component primitives
- Lucide React: Icon library
- Framer Motion: Animation library
- next-themes: Dark mode support
- Zustand: Lightweight state management
- Axios: HTTP client for API requests
- Zod: Schema validation
- React Hook Form: Form management
- TanStack React Table: Powerful table component
- date-fns: Date manipulation and formatting
- jsPDF: PDF document generation
- jsPDF AutoTable: Table generation for PDFs
- html2canvas: HTML to canvas conversion
- ESLint: Code linting
- Jest: Testing framework
- TypeScript: Static type checking
Build the Docker image:
docker build -t pointeur-front .Run the container:
docker run -p 3000:3000 pointeur-frontNote: The Dockerfile uses Node.js 18 (LTS) as the base image.
Start the application with Docker Compose:
docker compose upStart in detached mode:
docker compose up -dStop the application:
docker compose downView logs:
docker compose logs -f-
Create a new branch for your feature:
git checkout -b feature/your-feature-name
-
Make your changes following the existing code patterns
-
Run linting to check code quality:
npm run lint
-
Test your changes with the development server:
npm run dev
-
Run tests to ensure nothing breaks:
npm run test -
Build the application to verify production readiness:
npm run build
-
Commit your changes with a descriptive message:
git commit -m "feat: add new feature description" -
Push your branch and create a pull request
- Use TypeScript for all new code
- Follow existing naming conventions
- Use functional components with hooks
- Implement proper error handling with try/catch blocks
- Add type definitions in
src/Types/for new data models - Use existing UI components from
src/components/ui/ - Write unit tests for utility functions
- Document complex logic with comments
- Create a new directory under
src/app/(Main)/YourFeature/ - Add
page.tsxwith your page component - Update the sidebar navigation in
src/components/sidebar-comp/app-sidebar.tsx - Add necessary types in
src/Types/YourFeature.ts - Create API service in
src/services/YourFeature.ts - Create HTTP handlers in
src/api/http/your-feature.ts - Add Zod schemas in
src/api/schemas/your-feature.ts - Create Zustand store in
src/Stores/YourFeature.tsif needed
- Create component in
src/components/YourComponent.tsx - Use TypeScript for props typing
- Follow existing component patterns
- Import and use UI components from
src/components/ui/ - Add to the appropriate export in the component directory
- Define types in
src/Types/ - Create Zod schemas in
src/api/schemas/ - Implement HTTP handlers in
src/api/http/ - Create service layer in
src/services/with mapper functions - Use the service in your components
The application uses a custom authentication system with the following features:
- JWT-based authentication
- Role-based access control (admin, user roles)
- Protected routes with
AuthProvider - Public routes (login page)
- Automatic redirect to login for unauthenticated users
- Session persistence
For UI development without backend API, enable development mode:
# In .env.local
NEXT_PUBLIC_DEV_MODE=trueThis will:
- Bypass authentication checks
- Use a mock user (username: "dev_user", role: "admin")
- Allow testing UI components without API connection
If npm install fails:
- Ensure Node.js 18.x is installed:
node --version - Clear npm cache:
npm cache clean --force - Delete
node_modulesandpackage-lock.json - Run
npm installagain
If the dev server fails to start:
- Check if port 3000 is already in use
- Try a different port:
npm run dev -- -p 3001 - Clear Next.js cache:
rm -rf .next - Restart your terminal/IDE
If the build fails:
- Check for TypeScript errors:
npm run lint - Ensure all environment variables are set
- Verify all imports are correct
- Clear
.nextdirectory and rebuild
If Docker build fails:
- Ensure Docker is running
- Check available disk space
- Try building without cache:
docker build --no-cache -t pointeur-front . - Verify network connectivity for package downloads
If login doesn't work:
- Verify
API_BASE_URLis correctly set in.env.local - Check if backend API is running
- Verify credentials are correct
- Check browser console for errors
- Clear browser cookies and local storage
The application implements several performance optimizations:
- Server Components for improved initial load
- Dynamic imports for code splitting
- Image optimization with Next.js Image component
- CSS optimization with Tailwind CSS purging
- API response caching where appropriate
- Lazy loading for heavy components
The application supports:
- Chrome (latest 2 versions)
- Firefox (latest 2 versions)
- Safari (latest 2 versions)
- Edge (latest 2 versions)
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Follow the code style guidelines
- Write or update tests as needed
- Ensure all tests pass
- Submit a pull request with a clear description
- Update the README if you change functionality
- Ensure code passes linting:
npm run lint - Add/update tests for new features
- Update documentation for API changes
- Request review from maintainers
[Specify your license here - e.g., MIT, Apache 2.0, Proprietary]
For issues, questions, or contributions:
- Open an issue in the repository
- Contact the development team
- Check existing documentation
Future enhancements planned:
- Real-time presence updates with WebSockets
- Advanced analytics and reporting
- Mobile application
- Email notifications
- Export to multiple formats (Excel, CSV, PDF)
- Multi-language support
- Dark mode improvements
Built with:
- Next.js team for the amazing framework
- Radix UI for accessible components
- Vercel for hosting and deployment tools
- The ENI development team
Last updated: 2026-02-16