A lightweight REST API built with Node.js, Express and TypeScript to access 42 School resources (user profile, level, modules, clusters, exams, attendance, activities, position, etc.).
The API is hosted at: https://42.zwuiix.dev/
- Node.js
- Express 5
- TypeScript
- Playwright (session handling)
- Axios
src/
├── app.ts # Express application setup
├── server.ts # Server entry point
├── auth/ # Session and cookie management
├── controllers/ # Route controllers
├── routes/ # API routes
├── services/ # Business logic / 42 API calls
├── scripts/ # Auth scripts
└── utils/ # Helpers (cache, etc.)
- Node.js 18+
- npm
npm installCreate a .env file at the root with the required credentials (42 intra credentials and any session-related variables used by auth/session.ts).
npm run devnpm run build
npm startAll endpoints are exposed under /api.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/user | Get user profile |
| GET | /api/level | Get user level |
| GET | /api/modules | Get user modules |
| GET | /api/clusters | Get user clusters |
| GET | /api/exams | Get user exams |
| GET | /api/attendance | Get user attendance |
| GET | /api/activities | Get user activities |
| GET | /api/position | Get user position |
| GET | /health | Health check |
- The service handles its own session and cookies for the 42 intranet.
- CORS is restricted to
http://localhost:4321andhttps://portfolio.zwuiix.dev. - This project is not affiliated with 42 School.
ISC