A full-stack school academic system with Laravel 12 (backend), React (frontend), and MySQL.
- Login – Email/password authentication (admin, teacher, student roles)
- Lessons – Add and manage subjects (code, name, teacher)
- Teachers – Add and manage teachers (NIP, name, email, password)
- Students – Add and manage students (NIS, name, class, email, password)
- Online assignments – Create assignments per lesson; students submit; teachers grade
| Layer | Stack |
|---|---|
| Backend | Laravel 12, PHP 8.2+, Laravel Sanctum |
| Frontend | React 19, Vite, React Router, Axios |
| Database | MySQL 8+ |
sysacad/
├── backend/ # Laravel 12 API (custom code; see backend/README.md for full setup)
├── frontend/ # React SPA (Vite)
└── README.md # This file
Requirements: PHP 8.2+, Composer, MySQL.
-
Create a new Laravel 12 project and install Sanctum:
composer create-project laravel/laravel backend-temp cd backend-temp composer require laravel/sanctum -
Copy the contents of this repo’s
backendfolder intobackend-temp(overwrite when asked). If you prefer, remove the originalbackendfolder and renamebackend-temptobackend. -
In
bootstrap/app.php, ensure API routes are registered (they are if you used thebackendfiles as above):->withRouting( web: __DIR__.'/../routes/web.php', api: __DIR__.'/../routes/api.php', commands: __DIR__.'/../routes/console.php', health: '/up', apiPrefix: 'api', )
-
Environment and database:
cp .env.example .env php artisan key:generate
Edit
.env: setDB_DATABASE,DB_USERNAME,DB_PASSWORDfor MySQL. Optionally setFRONTEND_URL(e.g.http://localhost:5173). -
Migrate and seed:
php artisan migrate php artisan db:seed
-
Run the API:
php artisan serve
API base:
http://localhost:8000(routes under/api).
Requirements: Node.js 18+.
cd frontend
npm install
npm run devOpen http://localhost:5173. The dev server proxies /api to http://localhost:8000, so the backend must be running.
After seeding the backend:
| Role | Password | |
|---|---|---|
| Admin | admin@siakad.test | password |
| Teacher | teacher@siakad.test | password |
| Student | student@siakad.test | password |
POST /api/login– Login (email, password) → returns token and user.POST /api/logout– Logout (Bearer token).GET /api/user– Current user (Bearer token).- Lessons:
GET/POST /api/lessons,GET/PUT/DELETE /api/lessons/{id}. - Teachers:
GET/POST /api/teachers,GET/PUT/DELETE /api/teachers/{id}. - Students:
GET/POST /api/students,GET/PUT/DELETE /api/students/{id}. - Assignments:
GET/POST /api/assignments,GET/PUT/DELETE /api/assignments/{id}. POST /api/assignments/{id}/submit– Student submit (body:content).POST /api/assignments/{id}/submissions/{submissionId}/grade– Teacher grade (body:score).
Protected routes require header: Authorization: Bearer <token>.
MIT.