A modern RTL-first medical education platform built with Laravel, Vite, and a modular frontend architecture. This repository powers public (guest) pages, authentication, and the application experience for learners and admins.
- Features
- Tech Stack
- Architecture Overview
- Project Structure
- Getting Started
- Environment Configuration
- Database and Seeding
- Running and Building
- Frontend Assets
- Theming and Design System
- Layouts and Blade Components
- Internationalization (RTL/Arabic)
- Accessibility
- Testing
- Deployment
- Troubleshooting
- Common Tasks
- Contributing
- License
- RTL-first Arabic UI with full responsive design
- Modular Blade layouts: guest, auth, and app
- Reusable Blade components: navbar, sidebar, modal, table, form, card, etc.
- Material-inspired design system with modern glass/gradient treatments
- Vite-powered asset pipeline with page-specific bundles
- SEO-ready guest pages with OpenGraph/Twitter meta and structured data
- Cookie consent and newsletter subscription
- Role-ready navigation and sections for future admin features
- Test scaffolding for unit and feature tests
- Backend: Laravel 10+
- Frontend: Vite, vanilla JS (progressive), Material Icons, Google Fonts
- Styling: Custom CSS modules with theme tokens, RTL support
- Database: MySQL/MariaDB/PostgreSQL (via Laravel database configuration)
- Testing: PHPUnit
- Laravel app with a clean separation of concerns: routes, controllers, requests, models.
- Frontend organized by purpose:
layouts/,components/,pages/, with atheme.cssproviding cross-cutting variables and tokens. - Blade components encapsulate UI primitives and complex widgets with accessibility baked-in.
- Page-specific CSS/JS loaded only where needed using
@vite([...])in Blade.
app/
Http/ Controllers/ Middleware/ Requests/
Models/
resources/
css/
app.css # Entrypoint importing theme and shared styles
theme.css # Design tokens & base styles (colors, spacing, shadows, etc.)
layouts/ # Layout-specific styles (guest, auth, app)
components/ # Navbar, table, modals, etc.
pages/ # Page bundles (e.g., welcome.css)
js/
app.js # Global JS (if any) + layout initializers
layouts/ # guest.js, etc.
pages/ # Page scripts (e.g., welcome.js)
views/
layouts/guest.blade.php # Guest/public layout
welcome.blade.php # Landing page
components/ # Blade components (x-navbar, x-modal, ...)
routes/
web.php api.php
- Clone the repository and install PHP dependencies:
composer install- Install Node dependencies:
npm install- Create your environment file and app key:
cp .env.example .env
php artisan key:generate- Configure your database in
.env(see Environment Configuration). - Run migrations and seeders:
php artisan migrate --seed- Start the dev servers (PHP + Vite):
php artisan serve
npm run devOpen http://127.0.0.1:8000 in your browser.
Key .env variables:
APP_NAME="الطب العربي"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
APP_LOCALE=ar
APP_FALLBACK_LOCALE=ar
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=arabmed
DB_USERNAME=root
DB_PASSWORD=
After changing .env run:
php artisan config:clear
php artisan config:cache- Migrations live in
database/migrations/. - Seeders in
database/seeders/provide initial data (e.g., admin user, categories). - Example commands:
php artisan migrate
php artisan db:seed
php artisan migrate:fresh --seed- Development (with HMR):
npm run dev- Production build:
npm run build- Laravel server:
php artisan serveVite is configured in vite.config.js. Blade pages reference bundles with @vite([...]).
- Entry:
resources/css/app.cssimports theme and shared styles. - Page-specific CSS/JS (e.g.,
resources/css/pages/welcome.css,resources/js/pages/welcome.js) are included only on the pages that need them. - Component CSS in
resources/css/components/(e.g.,navbar.css,modals.css,table.css). - Layout CSS in
resources/css/layouts/(e.g.,guest.css). - Images:
public/images/(e.g.,logo.png,logo-white.png, favicons).
- Place your logos under
public/images/:logo.svgorlogo.png(navbar)logo-white.png(dark footer)
- Favicons:
public/favicon.ico,public/images/favicon-32x32.png,public/images/favicon-16x16.png,public/images/apple-touch-icon.png
- The navbar uses
brand-logo="{{ asset('images/logo.png') }}"and the footer referenceslogo-white.png.
- All tokens are defined in
resources/css/theme.css:- Colors:
--primary,--secondary,--success,--warning,--error,--info(+ scale 50-900) - Neutrals and surfaces:
--bg-color,--surface,--border-color,--text-color - Typography scale, spacing, radii, shadows, elevations
- RTL-aware focus, selection, scrollbar styling
- Colors:
- Modern brand gradients and glass tokens:
--brand-gradient-extended: a blue/teal gradient used for hero, CTA, and dark sections--glass-bg,--glass-border,--glass-blur,--glass-elevation: for transparent nav and panels
- Update tokens in
theme.cssto change the app look globally.
- Layouts:
resources/views/layouts/guest.blade.php– public pages, SEO meta, structured data, navbar, footer, cookie banner.- (Auth and app layouts follow the same modular approach.)
- Key Components (in
resources/views/components/):x-navbar: brand logo/text, navigation slots, transparent vs solid, auto solid on scroll.x-sidebar: collapsible, role-ready sections (if present).x-modal,x-card,x-table,x-form: reusable UI building blocks.
- Landing page:
resources/views/welcome.blade.phpuses a hero with brand gradient, animated medical SVGs, and feature badges.
- Default locale set to Arabic (RTL).
- CSS rules prefer logical properties (
margin-inline-start) and[dir="rtl"]blocks for directional tweaks. - To switch languages, implement locale routes and use the language dropdown (see
layouts/guest.blade.php).
- Keyboard and screen-reader friendly components.
- Focus outlines via theme tokens;
prefers-reduced-motionrespected to limit animations. - Semantic headings and ARIA attributes in components and layouts.
- Run tests:
php artisan test- Tests live under
tests/Featureandtests/Unitwithtests/TestCase.phpbootstrap.
- Build production assets:
npm run build- Configure web server to point to
public/as document root. - Optimize Laravel caches:
php artisan optimize:clear
php artisan optimize- Ensure APP_ENV, APP_DEBUG, APP_URL, database, cache/queue config are set appropriately.
- CSS/JS not updating:
- Clear Vite/Laravel caches, hard refresh browser (Ctrl/Cmd+Shift+R).
- Verify
@vite(['resources/css/app.css', ...])includes the correct files.
- Black/incorrect backgrounds:
- Confirm theme variables exist in
theme.cssand are loaded before page CSS. - Avoid undefined custom properties (use provided aliases like
--bg-color,--text-primary).
- Confirm theme variables exist in
- Mixed RTL/LTR spacing:
- Prefer logical properties and check
[dir="rtl"]overrides in component CSS.
- Prefer logical properties and check
- Create a new page with its own CSS/JS:
- Add
resources/views/yourpage.blade.php. - Add
resources/css/pages/yourpage.cssandresources/js/pages/yourpage.js. - In the Blade head:
@vite(['resources/css/app.css','resources/css/pages/yourpage.css','resources/js/pages/yourpage.js']).
- Add
- Add a new component style:
- Place it in
resources/css/components/yourcomponent.cssand import from your entry or page CSS.
- Place it in
- Update brand gradient globally:
- Change
--brand-gradient-extendedinresources/css/theme.css.
- Change
- Follow PSR-12 for PHP and keep Blade components accessible and RTL-ready.
- Keep CSS modular; prefer tokens from
theme.cssand logical properties. - Add tests where applicable and run
php artisan testbefore pushing.
This project is licensed. See the repository or your organization’s policy for details.