PDP School Platform
My most modern codebase. A Next.js 14 app with TypeScript, Tailwind and Zustand, where the foundation comes first: typed models, one API layer with token handling, and stores for the session and courses. Screens are being built on top of it.
Technologies
- Next.js 14
- TypeScript
- Tailwind CSS
- Zustand
- Axios
- React Hook Form
- Zod
Dashboard
Students
412
Courses
18
Teachers
38
Groups
24
Today's timetable
- 08:30Frontend basicsFE-7
- 09:20JavaScriptFE-7
- 10:10AlgorithmsCS-3
- 11:00EnglishEN-2
Attendance this week
Problem
Managing students, teachers and courses needs more than pages. It needs typed data, an authentication flow, and one place where every API call lives.
Solution
An axios client attaches the access token to each request and deals with expired ones, Zustand stores keep the session and course state across reloads, and TypeScript types describe users and courses for the whole app.
Architecture
Where a request goes, and where the token is attached along the way.
Next.js app
React 18 + TypeScript + Tailwind
- /auth
- /dashboard
- /courses
- /schedule
Stores
Zustand, persisted
- authStore
- courseStore
API client
Axios with interceptors
- Bearer token
- 401 refresh
- error handling
Services
One module per domain
- authService
- courseService
REST API
Backend endpoints
- /auth/login
- /auth/refresh
- /courses
The auth flow
Logging in is the easy part. Staying logged in without re-typing a password is the interesting one.
Log in
Credentials are posted to the API
Tokens stored
Access and refresh tokens in the persisted store
Request
The interceptor attaches the access token
401 expired
The client refreshes once, then retries
Refresh fails
The store logs the user out
Admin
- Manage users and roles
- Create courses and groups
- Build the timetable
Teacher
- Manage own courses
- Mark attendance and results
- View own schedule
Student
- Browse and join courses
- See results and attendance
- View the timetable
Planned routes
| Route | Page | Purpose |
|---|---|---|
| /auth | Auth | Login and register; stores the access and refresh tokens. |
| /dashboard | Dashboard | Role-aware overview of courses and progress. |
| /courses | Courses | Course list, details and enrolment. |
| /students | Students | Student records for admins and teachers. |
| /teachers | Teachers | Teacher profiles and their courses. |
| /schedule | Schedule | Weekly timetable per group and per teacher. |
Key features
- Typed data models for users and courses
- Axios API client with request and response interceptors
- JWT access token and refresh token handling
- Auth store persisted across reloads
- Course service and store
- Tailwind design tokens and shared navigation constants
What I learned
- Interceptors keep authentication logic out of every component
- What belongs in a persisted store — and what definitely doesn't
- Designing types and services before building screens saves rewrites