How mazfreelance/attendance-system works
This repository combines a Laravel API backend with a Next.js dashboard frontend. The evident user workflow is signing in through the frontend, sending authenticated API requests, and receiving user/session data; the backend validates credentials and issues or revokes Sanctum tokens. The tree also shows dashboard, profile, and admin screens, plus role middleware and user role checks. Their detailed routing and data flows are not established by the excerpts, so those links are omitted. The README describes Laravel generally, not additional application-specific capabilities.
Main entry points: app.php Application bootstrap · api.ts API client · api.php API routes · AuthController.php Auth controller
Components 14
Frontend
- Login screen
frontend/app/login/page.tsx - Dashboard screens
frontend/app/dashboard/page.tsx - Admin screen
frontend/app/dashboard/admin/page.tsx - Profile screen
frontend/app/dashboard/profile/page.tsx - Auth context
frontend/contexts/AuthContext.tsx - Auth service
frontend/lib/auth.ts - API client
frontend/lib/api.ts
Backend API
- API routes
routes/api.php - Auth controller
app/Http/Controllers/Api/AuthController.php - Application bootstrap
bootstrap/app.php - HTTP entry point
public/index.php
Identity and access
- User model
app/Models/User.php - Role middleware
app/Http/Middleware/EnsureUserHasRole.php
Other components
- User
Connections 8
- User → Login screen: uses
- Auth service → API client: sends requests
frontend/lib/auth.ts - API client → User: stores token
frontend/lib/api.ts - API routes → Auth controller: routes to
routes/api.php - Auth controller → User model: queries and issues tokens
app/Http/Controllers/Api/AuthController.php - HTTP entry point → Application bootstrap: loads
public/index.php - Application bootstrap → API routes: registers
bootstrap/app.php - Application bootstrap → Role middleware: aliases
bootstrap/app.php