Overview
RALQ is built as a traditional server-rendered web application using PHP and MySQL, with modern frontend enhancements for 3D visualization and augmented reality capabilities.Technology Stack
Backend
Server-side scripting language handling business logic, authentication, and database operations
Relational database storing user accounts, authentication data, and application state
HTTP server with mod_rewrite enabled for URL handling
Frontend
Server-side rendered pages with embedded PHP for dynamic content
Utility-first CSS framework for responsive styling
Client-side interactivity and form validation
WebGL-based 3D model rendering with AR support
Application Architecture
Frontend Architecture
The application follows a traditional multi-page architecture (MPA) where each user action results in a full page reload from the server.Page Rendering Flow
- Index Page (
index.php) - Landing page with hero section and 3D models - Authentication - User redirected to
registro.phporiniciosesion.php - Session Creation - PHP session started upon successful login
- Main Menu (
menu.php) - Protected page requiring active session - Feature Pages - Molecular structures, lab instruments, periodic table
3D Rendering
RALQ uses the Google Model Viewer library for rendering 3D models with AR capabilities:index.php:182-190):
All 3D models are in GLB format (binary glTF), optimized for web delivery and AR viewing
File Structure
Root Directory Structure
Key Directories
- php/
- modelos/
- instrumentos3D/
- css/
- js/
Backend PHP scripts handling business logic:
validar.php- Database connection configurationlog.php- Authentication logicalerta-registro.php- User registration handleralerta-inicioSecion.php- Login error displaylogout.php- Session termination
Request Flow
User Registration Flow
Authentication Flow
Protected Page Access
All pages in the application start with:menu.php page (lines 1-3) initializes the session and displays the user email:
Tailwind CSS Configuration
Custom color palette and fonts defined intailwind.config.js:
Build Process
The application uses both the compiled Tailwind CSS (
build/output.css) and the CDN version (https://cdn.tailwindcss.com) for development conveniencePerformance Considerations
3D Model Loading
- GLB files are loaded on-demand when pages render
- Models support progressive loading for faster initial page display
- AR mode requires device camera permissions
Session Management
- PHP sessions stored server-side (default:
/tmpdirectory) - Session cookies sent to browser for authentication
- No session timeout configured (uses PHP defaults)
Static Assets
- Images, CSS, and JS served directly by Apache
- No CDN or caching headers configured
- Consider implementing browser caching for production
Security Architecture
Password Security
Passwords are hashed using PHP’spassword_hash() function (from alerta-registro.php:40):
password_verify() (from log.php:46):
SQL Injection Prevention
Prepared statements used throughout (fromlog.php:36):