This is a comprehensive web application featuring user authentication, dynamic theming, and permission-based module access. The system demonstrates a full-stack implementation using Laravel 12 (backend), React 18 (frontend), and PostgreSQL (database), all containerized with Docker.
- ✅ Authentication: Laravel Sanctum-based token authentication with bcrypt password hashing
- ✅ Dynamic Theming: Company-specific color schemes applied on login
- ✅ Permission System: Role-based module access with user-submodule assignments
- ✅ Hierarchical Navigation: System → Module → Submodule tree structure
- ✅ Search Functionality: Real-time filtering of modules and submodules
- ✅ Responsive UI: Clean, professional interface with smooth interactions
- ✅ Dockerized: Complete docker-compose setup for easy deployment
- Framework: Laravel 12
- Language: PHP 8.3
- Authentication: Laravel Sanctum
- Database: PostgreSQL 15
- API: RESTful API with JSON responses
- Framework: React 18
- Routing: React Router v6
- HTTP Client: Axios
- Styling: Custom CSS with CSS Variables for theming
- State Management: React Context API and Hooks
- Containerization: Docker & Docker Compose
- Services: 3 containers (backend, frontend, database)
- Networking: Bridge network for inter-container communication
Before running this project, ensure you have the following installed:
- Docker Desktop (latest version)
- Docker Compose (v3.8 or higher)
- Git (for cloning the repository)
- At least 4GB RAM available for Docker
- Ports 3000, 5432, and 8000 available on your machine
git clone <your-repository-url>
cd "IAS_individual (official)/Module-Management-System"IMPORTANT: This step must be done BEFORE starting Docker containers to avoid missing vendor directory issues.
# Navigate to backend directory
cd backend
# Install dependencies using Docker (recommended)
docker run --rm -v "$(pwd):/app" -w /app composer:latest install --no-interaction
# Return to project root
cd ..Alternative for Windows PowerShell:
cd backend
docker run --rm -v "${PWD}:/app" -w /app composer:latest install --no-interaction
cd ..docker-compose up -d --buildThis command will:
- Build the backend (Laravel) container
- Build the frontend (React) container
- Pull and start PostgreSQL container
- Set up networking between containers
Note: The first build may take 5-10 minutes as it downloads dependencies.
Open a terminal and run:
# Access the backend container
docker exec -it backend_app sh
# Inside the container, run these commands:
php artisan key:generate
php artisan migrate --seed
# Exit the container
exitThis will:
- Generate Laravel application key
- Create all database tables
- Populate database with sample data:
- 3 companies with different color schemes
- 8 users with various permission levels
- 2 systems (Administration, Human Resources)
- 6 modules with 17 submodules
- User-submodule permission assignments
Once all containers are running:
- Frontend (React): http://localhost:3000
- Backend API (Laravel): http://localhost:8000/api
- Database (PostgreSQL): localhost:5432
Use these credentials to test different permission levels:
| Username | Password | Company | Access Level |
|---|---|---|---|
| alice | Passw0rd! | ACME | Full access (all modules) |
| bob | Passw0rd! | BETA | Admin system only |
| charlie | Passw0rd! | GAMMA | HR system only |
| diana | Passw0rd! | ACME | User Management module only |
| edward | Passw0rd! | BETA | Employee Management only |
| frank | Passw0rd! | GAMMA | Payroll & Attendance only |
| grace | Passw0rd! | ACME | Company Settings only |
- ACME: Blue theme (#3490dc)
- BETA: Green theme (#38c172)
- GAMMA: Red theme (#e3342f)
id: Primary keyname: Company namecode: Unique company codeprimary_color: Hex color codeaccent_color: Optional accent colorlogo_url: Optional logo URL
id: Primary keyusername: Unique usernameemail: Optional emailpassword: Bcrypt hashed passwordfull_name: User's full namecompany_id: Foreign key to companiesis_active: Boolean status flag
- Hierarchical structure: System → Module → Submodule
- Each has
id,name,code - Foreign keys maintain relationships
user_id: Foreign key to userssubmodule_id: Foreign key to submodulesgranted_at: Timestamp of permission grantcreated_by: Optional admin who granted access
-
POST /api/login- Authenticate user- Body:
{ username, password, company_code } - Returns:
{ token, user, company }
- Body:
-
GET /api/companies- Get list of all companies
POST /api/logout- Invalidate current tokenGET /api/user- Get current user profileGET /api/validate- Validate token (health check)GET /api/modules- Get hierarchical modules for logged-in user
# Login
curl -X POST http://localhost:8000/api/login \
-H "Content-Type: application/json" \
-d '{"username":"alice","password":"Passw0rd!","company_code":"ACME"}'
# Get modules (with token)
curl -X GET http://localhost:8000/api/modules \
-H "Authorization: Bearer YOUR_TOKEN_HERE"Individual/
├── backend/ # Laravel backend
│ ├── app/
│ │ ├── Http/
│ │ │ └── Controllers/ # API controllers
│ │ └── Models/ # Eloquent models
│ ├── config/ # Configuration files
│ ├── database/
│ │ ├── migrations/ # Database migrations
│ │ └── seeders/ # Database seeders
│ ├── routes/
│ │ └── api.php # API routes
│ ├── Dockerfile
│ └── composer.json
├── frontend/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── utils/ # Helper functions
│ │ ├── App.js
│ │ └── index.js
│ ├── Dockerfile
│ └── package.json
└── docker-compose.yml # Docker orchestration
- Navigate to http://localhost:3000
- Select a company from dropdown
- Enter username and password
- System validates credentials and returns JWT token
- Token stored in localStorage for subsequent requests
- Upon successful login, company's primary color applies to header and UI elements
- Theme persists across navigation
- Different companies show different color schemes
- Left sidebar displays hierarchical tree of accessible modules
- Expandable/collapsible systems and modules
- Only shows modules user has permission to access
- Click on submodule to view placeholder content
- Search box at top of left sidebar
- Real-time filtering of systems, modules, and submodules
- Case-insensitive substring matching
- Shows only matching branches
- Each user sees only their assigned modules
- Backend enforces permission checks
- Different users see different navigation trees
# Enter backend container
docker exec -it backend_app sh
# Run migrations
php artisan migrate
# Run seeders
php artisan db:seed
# Fresh migration with seed
php artisan migrate:fresh --seed
# Clear cache
php artisan cache:clear
php artisan config:clear
# Create new migration
php artisan make:migration create_table_name
# Create new model
php artisan make:model ModelName
# Create new controller
php artisan make:controller ControllerName# Enter frontend container
docker exec -it frontend_app sh
# Install new package
npm install package-name
# Build for production
npm run buildSolution:
docker compose down
docker compose up --buildSolution: Wait 30 seconds for PostgreSQL to fully initialize, then run migrations again.
Solution: Stop services using ports 3000, 5432, or 8000:
# Windows PowerShell
netstat -ano | findstr :3000
taskkill /PID <PID> /FSolution: Ensure backend CORS configuration includes http://localhost:3000 in allowed origins.
Solution:
- Clear browser localStorage
- Login again to get fresh token
- Verify token is being sent in Authorization header
Solution:
# Ensure seeders ran successfully
docker exec -it backend_app php artisan db:seed --class=UserSubmoduleSeeder- Login with each sample user
- Verify theme changes per company
- Check different permission levels
- Test search functionality
- Expand/collapse module tree
- Click on submodules
- Test logout functionality
- Verify token persistence
- Test invalid login credentials
- Verify inactive user cannot login (henry)
# Stop all containers
docker compose down
# Stop and remove volumes (clears database)
docker compose down -v-
Presenter 1 - Project Overview (2 minutes)
- Introduce IAS2 system purpose and objectives
- Explain use case and business value
- Overview of technology stack
-
Presenter 2 - Backend Architecture (2 minutes)
- Laravel structure and models
- Database schema explanation
- Demo: Show migrations and seeders
- Explain authentication flow with Sanctum
-
Presenter 3 - Frontend & Features (2 minutes)
- React component structure
- Demo: Login process with different companies
- Show theming in action
- Demonstrate module search and navigation
-
Presenter 4 - Docker & DevOps (1.5 minutes)
- Docker compose architecture
- Show running containers
- Explain networking and volumes
- Demo: Quick start from scratch
-
Presenter 5 - Q&A & Lessons Learned (0.5 minutes + Q&A)
- Key challenges and solutions
- What we learned
- Future enhancements
- Handle questions from instructors
- Completeness: All requirements met (authentication, theming, permissions, Docker)
- Code Quality: Clean separation of concerns, reusable components
- Security: Password hashing, token authentication, SQL injection prevention
- User Experience: Smooth interactions, responsive design
- Scalability: Modular architecture, easy to extend
- Start with docker compose up
- Show database seeders running
- Login as alice (full access)
- Show all modules, test search
- Logout and login as bob (limited access)
- Show filtered modules
- Switch to charlie with different company (theme change)
- Highlight permission filtering
- Lightweight token-based authentication
- Perfect for SPA applications
- Built into Laravel 12
- Easy token management
- Robust relational database
- Excellent for complex queries
- Good Docker image support
- Industry standard
- Component-based architecture
- Large ecosystem
- Easy state management with hooks
- Fast virtual DOM rendering
- Dynamic runtime color changes
- No CSS recompilation needed
- Browser-native support
- Easy to implement
- ✅ Token-based authentication
- ✅ Dynamic theming
- ✅ Hierarchical navigation
- ✅ Search filtering
- ✅ Docker containerization
- 🔄 Role-based access control (roles table)
- 🔄 Remember selected company in database
- 🔄 Logout from all devices
- 🔄 Token refresh mechanism
- 🔄 Animations for expand/collapse
- 🔄 Unit tests for API endpoints
- 🔄 PHPUnit backend tests
- 🔄 Jest frontend tests
- 🔄 Server-side caching for modules
- 🔄 Real-time notifications
- 🔄 Audit logging
- 🔄 Two-factor authentication
- ✅ Login and authentication (10/10)
- ✅ Company theming (10/10)
- ✅ Modules tree and search (15/15)
- ✅ Permission filtering (10/10)
- ✅ Clean architecture
- ✅ Separation of concerns
- ✅ Reusable components
- ✅ Proper error handling
- ✅ Comments and documentation
- ✅ Complete docker-compose.yml
- ✅ All services containerized
- ✅ Easy setup process
- ✅ Clear documentation
- ✅ Professional appearance
- ✅ Intuitive navigation
- ✅ Responsive layout
- ✅ Good color scheme
- ✅ Comprehensive README
- ✅ API documentation
- ✅ Sample credentials
- ✅ Presentation notes
This project is created for educational purposes as part of the IAS2 course.
[List your 5 team members here with their presentation roles]
- [Name] - Project Overview & Introduction
- [Name] - Backend Architecture & Demo
- [Name] - Frontend Features & Demo
- [Name] - Docker & DevOps
- [Name] - Q&A & Lessons Learned
For questions or issues, please contact: [Your contact information]
Project Completion Date: October 16, 2025
Presentation Date: October 17, 2025
Course: IAS2 - Individual Assessment
Institution: [Your Institution Name]