aiprs/
│
├── database/ # Database files
│ ├── schema.sql # Database schema (3NF normalized)
│ └── seed_data.sql # Sample test data
│
├── backend/ # PHP Backend (Pure PHP + MySQLi)
│ │
│ ├── api/ # REST API endpoints
│ │ ├── auth.php # Authentication (login, register, logout)
│ │ ├── courses.php # Course CRUD operations
│ │ ├── enrollments.php # Enrollment management
│ │ ├── recommendations.php # AI recommendations
│ │ └── analytics.php # Analytics and reporting
│ │
│ ├── config/ # Configuration files
│ │ ├── database.php # Database connection class
│ │ └── constants.php # Application constants
│ │
│ ├── models/ # Data models (CRUD)
│ │ ├── User.php # User management
│ │ ├── Course.php # Course operations
│ │ ├── Module.php # Module operations
│ │ ├── Lesson.php # Lesson operations
│ │ ├── Enrollment.php # Enrollment tracking
│ │ ├── Assignment.php # Assignment management
│ │ ├── Submission.php # Submission handling
│ │ ├── Quiz.php # Quiz operations
│ │ ├── Forum.php # Forum posts
│ │ ├── Notification.php # Notifications
│ │ ├── Recommendation.php # Recommendations storage
│ │ └── Analytics.php # Analytics data
│ │
│ ├── controllers/ # Business logic
│ │ ├── AuthController.php # Authentication logic
│ │ └── RecommendationEngine.php # AI recommendation algorithm
│ │
│ ├── includes/ # Shared templates (future)
│ │
│ ├── uploads/ # User uploads
│ │ ├── profiles/ # Profile images
│ │ ├── assignments/ # Assignment files
│ │ ├── courses/ # Course materials
│ │ └── lessons/ # Lesson content
│ │
│ ├── reports/ # Generated reports
│ │ └── .gitkeep
│ │
│ ├── logs/ # Error and analytics logs
│ │ └── .gitkeep
│ │
│ └── .htaccess # Apache configuration
│
├── frontend/ # React Frontend
│ │
│ ├── public/ # Static files
│ │ ├── index.html # HTML template
│ │ └── manifest.json # PWA manifest
│ │
│ ├── src/ # Source code
│ │ │
│ │ ├── components/ # Reusable components
│ │ │ └── Layout.js # Main layout with navigation
│ │ │
│ │ ├── pages/ # Page components
│ │ │ ├── Login.js # Login page
│ │ │ ├── Register.js # Registration page
│ │ │ │
│ │ │ ├── student/ # Student pages
│ │ │ │ ├── Dashboard.js # Student dashboard
│ │ │ │ ├── Courses.js # Course list
│ │ │ │ ├── CourseDetail.js # Course details
│ │ │ │ ├── Assignments.js # Assignments page
│ │ │ │ └── Quizzes.js # Quizzes page
│ │ │ │
│ │ │ ├── teacher/ # Teacher pages
│ │ │ │ └── Dashboard.js # Teacher dashboard
│ │ │ │
│ │ │ └── admin/ # Admin pages
│ │ │ └── Dashboard.js # Admin dashboard
│ │ │
│ │ ├── context/ # React Context
│ │ │ ├── AuthContext.js # Authentication state
│ │ │ ├── ThemeContext.js # Theme (dark/light)
│ │ │ └── LanguageContext.js # Multi-language support
│ │ │
│ │ ├── hooks/ # Custom hooks (future)
│ │ │
│ │ ├── utils/ # Utility functions
│ │ │ └── translations.js # Language translations
│ │ │
│ │ ├── assets/ # Images, icons (future)
│ │ │
│ │ ├── App.js # Main app component
│ │ ├── index.js # Entry point
│ │ └── index.css # Global styles
│ │
│ ├── package.json # Dependencies
│ └── package-lock.json # Lock file
│
├── .gitignore # Git ignore rules
├── README.md # Complete documentation
├── QUICKSTART.md # Quick start guide
└── PROJECT_STRUCTURE.md # This file
- Purpose: Handle database operations (CRUD)
- Pattern: Each model represents a database table
- Features: Prepared statements, input validation, error handling
- AuthController: User authentication, session management
- RecommendationEngine: AI-powered learning recommendations
- RESTful design: GET, POST, PUT, DELETE
- JSON responses: Consistent format
- CORS enabled: Cross-origin requests
- AuthContext: User authentication state
- ThemeContext: Dark/Light mode theming
- LanguageContext: Multi-language support
- Public pages: Login, Register
- Student pages: Dashboard, Courses, Assignments, Quizzes
- Teacher pages: Dashboard, Course management
- Admin pages: Dashboard, User management, Analytics
- Layout: Consistent navigation and theming
- Protected Routes: Role-based access control
- Material UI: Modern, responsive components
- users: User accounts (students, teachers, admins)
- courses: Course catalog
- modules: Course modules
- lessons: Individual lessons
- enrollments: Student-course relationships
- assignments: Assignment definitions
- submissions: Student submissions
- quizzes: Quiz definitions
- questions: Quiz questions
- quiz_attempts: Quiz attempts and scores
- forum_posts: Discussion forum
- recommendations: AI recommendations
- notifications: User notifications
- analytics_logs: Activity tracking
1. Login → AuthContext → Protected Route
2. View Courses → API → Course Model → Database
3. Enroll → Enrollment Model → Update Database
4. Complete Lesson → Lesson Model → Update Progress
5. Take Quiz → Quiz Model → Record Attempt
6. Get Recommendations → RecommendationEngine → AI Logic
1. Login → AuthContext → Teacher Dashboard
2. View Submissions → Submission Model → Database
3. Grade Assignment → Update Submission
4. Post Feedback → Notification Model → Notify Student
1. Login → AuthContext → Admin Dashboard
2. View Analytics → Analytics Model → Aggregate Data
3. Generate Report → Report Controller → CSV/PDF
4. Manage Users → User Model → CRUD Operations
- Layout: AppBar, Drawer, Toolbar
- Data Display: Card, Table, List, Chip
- Input: TextField, Button, Select, Checkbox
- Feedback: Alert, Snackbar, CircularProgress
- Navigation: Tabs, Menu, Breadcrumbs
- Charts: Recharts (LineChart, BarChart)
- xs: < 600px (mobile)
- sm: 600px - 960px (tablet)
- md: 960px - 1280px (desktop)
- lg: 1280px - 1920px (large desktop)
- Authentication: password_hash, password_verify
- Session Management: Secure session handling
- Input Validation: filter_var, htmlspecialchars
- SQL Injection Prevention: Prepared statements
- File Upload Security: MIME validation, size limits
- RBAC: Role-based access control
- Protected Routes: Route guards
- Form Validation: Client-side checks
- XSS Prevention: React auto-escaping
- HTTPS: Production deployment
- Token Storage: Secure cookie handling
- Single server architecture
- File-based uploads
- Session-based authentication
- Load balancing
- CDN for static assets
- JWT token authentication
- Microservices architecture
- Caching layer (Redis)
- Message queue (RabbitMQ)
- Containerization (Docker)
- Model functions
- Controller logic
- Utility functions
- API endpoints
- Database operations
- Authentication flow
- User workflows
- Multi-page interactions
- Role-based scenarios
- Update database credentials
- Configure production paths
- Enable error logging
- Set file permissions
- Configure CORS properly
- Enable HTTPS
- Optimize PHP settings
- Update API base URL
- Run production build
- Optimize assets
- Configure CDN
- Set up monitoring
- Enable analytics
- Test all routes
- Authentication:
backend/controllers/AuthController.php - Recommendations:
backend/controllers/RecommendationEngine.php - Student Dashboard:
frontend/src/pages/student/Dashboard.js - API Endpoints:
backend/api/*.php - Database Models:
backend/models/*.php
- Colors/Theme:
frontend/src/context/ThemeContext.js - Translations:
frontend/src/utils/translations.js - Layout:
frontend/src/components/Layout.js - Routes:
frontend/src/App.js
- Create model in
backend/models/ - Add API endpoint in
backend/api/ - Create frontend page in
frontend/src/pages/ - Add route in
App.js - Update navigation in
Layout.js
- Material UI Docs: https://mui.com
- React Router: https://reactrouter.com
- Recharts: https://recharts.org
- PHP MySQLi: https://www.php.net/manual/en/book.mysqli.php
This structure supports a modular, maintainable, and scalable learning platform.