2.8 KiB
2.8 KiB
Example Data Structure for Axia4
This directory contains example data files that demonstrate the structure needed for the Axia4 application.
Directory Structure
DATA/
├── Usuarios.json # Main application users
└── entreaulas/
├── Usuarios/ # EntreAulas user files
│ ├── user1.json
│ └── user2.json
└── Centros/ # Centro data
├── centro1/
│ └── Aularios/
│ ├── aulario_abc123.json
│ └── aulario_xyz456.json
└── centro2/
└── Aularios/
└── aulario_def789.json
File Examples
Main Users (DATA/Usuarios.json)
{
"username1": {
"password_hash": "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi"
},
"username2": {
"password_hash": "$2y$10$example_hash_here"
}
}
EntreAulas User (DATA/entreaulas/Usuarios/username.json)
{
"password_hash": "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi",
"display_name": "John Doe",
"centro": "centro1",
"aulas": [
"aulario_abc123",
"aulario_xyz456"
]
}
Aulario Configuration (DATA/entreaulas/Centros/{centro_id}/Aularios/{aulario_id}.json)
{
"name": "Aulario Principal",
"icon": "/static/logo-entreaulas.png"
}
Aulario Student Names (DATA/entreaulas/Centros/{centro_id}/Aularios/{aulario_id}/Alumnos/)
The Alumnos directory contains subdirectories for each student, where each student has:
- A unique folder name (student identifier)
- A
photo.jpgfile with the student's photo/pictogram
Example structure:
DATA/entreaulas/Centros/centro1/Aularios/aulario_abc123/Alumnos/
├── Juan/
│ └── photo.jpg
├── Maria/
│ └── photo.jpg
└── Pedro/
└── photo.jpg
This structure is used by the "¿Quién soy?" (Who am I?) feature in Panel Diario, where students can identify themselves by selecting their photo.
Generating Password Hashes
To create password hashes for your users, use one of these methods:
Using Docker:
docker exec -it axia4-app php -r "echo password_hash('your_password', PASSWORD_DEFAULT);"
Using PHP CLI directly:
php -r "echo password_hash('your_password', PASSWORD_DEFAULT);"
Using a PHP script:
<?php
echo password_hash('your_password', PASSWORD_DEFAULT);
?>
Security Notes
- NEVER commit the actual DATA directory with real user credentials to version control
- The DATA directory should only exist on your production/development servers
- Use strong, unique passwords for all accounts
- Regularly backup the DATA directory
- Set appropriate file permissions (755 for directories, 644 for files)