Complete README.md with installation, configuration, and development guidelines
This commit is contained in:
parent
895c9ac08d
commit
0fe819749e
55
README.md
55
README.md
@ -11,14 +11,32 @@ Een PHP MVC applicatie voor het beheren van collecties van onderdelen, gebouwd m
|
|||||||
- **Locatie**: Sla locatie informatie op voor onderdelen.
|
- **Locatie**: Sla locatie informatie op voor onderdelen.
|
||||||
- **QR Codes**: Automatisch gegenereerde QR codes voor elk onderdeel, met printbare stickers.
|
- **QR Codes**: Automatisch gegenereerde QR codes voor elk onderdeel, met printbare stickers.
|
||||||
- **Meertalig**: Ondersteuning voor Nederlands en Engels.
|
- **Meertalig**: Ondersteuning voor Nederlands en Engels.
|
||||||
|
- **Real-time Updates**: Boom navigatie wordt automatisch bijgewerkt na CRUD operaties.
|
||||||
|
|
||||||
## Installatie
|
## Installatie
|
||||||
|
|
||||||
1. Zorg voor een LXC container 'www' met Apache, PHP, en Composer.
|
1. Zorg voor een LXC container 'www' met Apache, PHP, en Composer.
|
||||||
2. Clone de repository naar /var/www/localhost in de container.
|
2. Clone de repository naar `/var/www/localhost` in de container.
|
||||||
3. Run `composer install` in de container.
|
3. Run `composer install` in de container.
|
||||||
4. Stel de database in: `collections.sqlite` wordt automatisch aangemaakt.
|
4. Stel de database in: `collections.sqlite` wordt automatisch aangemaakt.
|
||||||
5. Start Apache en ga naar http://localhost.
|
5. Configureer Apache om als `ubuntu` gebruiker te draaien (zie Apache Configuratie).
|
||||||
|
6. Start Apache en ga naar http://localhost.
|
||||||
|
|
||||||
|
## Apache Configuratie
|
||||||
|
|
||||||
|
De applicatie draait met Apache als `ubuntu` gebruiker voor development:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Apache gebruiker instellen
|
||||||
|
sudo nano /etc/apache2/envvars # Wijzig APACHE_RUN_USER=ubuntu
|
||||||
|
sudo nano /etc/apache2/apache2.conf # Wijzig User/Group naar ubuntu
|
||||||
|
sudo systemctl restart apache2
|
||||||
|
|
||||||
|
# Permissions instellen
|
||||||
|
sudo chown -R ubuntu:ubuntu /var/www/localhost
|
||||||
|
sudo chmod 755 /var/www/localhost/public/js/
|
||||||
|
sudo chmod 644 /var/www/localhost/public/js/*
|
||||||
|
```
|
||||||
|
|
||||||
## Gebruik
|
## Gebruik
|
||||||
|
|
||||||
@ -29,11 +47,38 @@ Een PHP MVC applicatie voor het beheren van collecties van onderdelen, gebouwd m
|
|||||||
- **QR Printen**: Klik op 'Print QR' om een sticker te printen.
|
- **QR Printen**: Klik op 'Print QR' om een sticker te printen.
|
||||||
- **Categorieën**: Beheer categorieën via de zijbalk.
|
- **Categorieën**: Beheer categorieën via de zijbalk.
|
||||||
|
|
||||||
|
## Project Structuur
|
||||||
|
|
||||||
|
```
|
||||||
|
├── src/
|
||||||
|
│ ├── Controllers/ # MVC Controllers
|
||||||
|
│ ├── Models/ # Data Models
|
||||||
|
│ └── Services/ # Business Logic
|
||||||
|
├── templates/ # Twig templates
|
||||||
|
├── public/
|
||||||
|
│ ├── js/ # Frontend JavaScript
|
||||||
|
│ └── uploads/ # Afbeeldingen en QR codes
|
||||||
|
├── lang/ # Vertalingen (NL/EN)
|
||||||
|
└── collections.sqlite # SQLite database
|
||||||
|
```
|
||||||
|
|
||||||
## Ontwikkeling
|
## Ontwikkeling
|
||||||
|
|
||||||
- **Linting**: Geen specifieke tool, volg PSR-12.
|
- **Dependencies**: `composer install` / `update`
|
||||||
- **Testing**: Geen tests, gebruik curl voor API testing.
|
- **Linting**: Volg PSR-12 handmatig
|
||||||
- **Commits**: Elke wijziging heeft een git commit.
|
- **Testing**: `curl localhost` of `php test.php` voor individuele tests
|
||||||
|
- **Database**: Gebruik `App\Database\Database::getInstance()` (geen directe PDO)
|
||||||
|
- **I18n**: `App\Services\TranslationService` (PHP) of `{{ trans('ID') }}` (Twig)
|
||||||
|
- **Commits**: Elke wijziging heeft een git commit
|
||||||
|
|
||||||
|
## Code Conventies
|
||||||
|
|
||||||
|
- **Architecture**: MVC patroon met PSR-4 namespacing
|
||||||
|
- **Naming**: Classes `PascalCase`, methods/variables `camelCase`
|
||||||
|
- **Templating**: Alleen Twig (`.twig` files)
|
||||||
|
- **Security**: Geen secrets/keys in code of logs
|
||||||
|
- **Types**: Type hints waar mogelijk
|
||||||
|
- **Comments**: Vermijd tenzij gevraagd
|
||||||
|
|
||||||
## Licentie
|
## Licentie
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user