Consolidate documentation and update backend services

- Reorganize docs into 'Core deployment guides' and 'Setup and configuration' subdirectories
- Consolidate redundant documentation files (ACR, pipelines, deployment guides)
- Add documentation consolidation plan
- Update backend database factory and logger services
- Update migration script and docker-compose configurations
- Add PostgreSQL setup script
This commit is contained in:
2026-01-22 22:45:54 +01:00
parent 18aec4ad80
commit f4399a8e4e
49 changed files with 1320 additions and 7243 deletions

View File

@@ -47,22 +47,23 @@ docker-compose ps
docker-compose exec postgres pg_isready -U cmdb
```
### Stap 5: Maak Databases Aan (Optioneel)
### Stap 5: Maak Database Aan (Optioneel)
De applicatie maakt databases automatisch aan, maar je kunt ze ook handmatig aanmaken:
De applicatie maakt de database automatisch aan, maar je kunt het ook handmatig doen:
```bash
docker-compose exec postgres psql -U cmdb -c "CREATE DATABASE cmdb_cache;"
docker-compose exec postgres psql -U cmdb -c "CREATE DATABASE cmdb_classifications;"
docker-compose exec postgres psql -U cmdb -c "CREATE DATABASE cmdb_insight;"
```
**Note:** The application uses a single database for all data. All tables (CMDB cache, classification history, and session state) are stored in the same database.
## Verificatie
Na reset, check of alles werkt:
```bash
# Connect to database
docker-compose exec postgres psql -U cmdb -d cmdb_cache
docker-compose exec postgres psql -U cmdb -d cmdb_insight
# Check tables (zou leeg moeten zijn)
\dt
@@ -120,8 +121,8 @@ docker volume ls | grep postgres
Als je een fout krijgt dat de database al bestaat:
```bash
# Drop en recreate
docker-compose exec postgres psql -U cmdb -c "DROP DATABASE IF EXISTS cmdb_cache;"
docker-compose exec postgres psql -U cmdb -c "CREATE DATABASE cmdb_cache;"
docker-compose exec postgres psql -U cmdb -c "DROP DATABASE IF EXISTS cmdb_insight;"
docker-compose exec postgres psql -U cmdb -c "CREATE DATABASE cmdb_insight;"
```
### Connection Issues
@@ -145,7 +146,7 @@ Zorg dat je `.env` bestand correct is:
DATABASE_TYPE=postgres
DATABASE_HOST=postgres
DATABASE_PORT=5432
DATABASE_NAME=cmdb_cache
DATABASE_NAME=cmdb_insight
DATABASE_USER=cmdb
DATABASE_PASSWORD=cmdb-dev
```
@@ -154,7 +155,7 @@ Of gebruik connection string:
```env
DATABASE_TYPE=postgres
DATABASE_URL=postgresql://cmdb:cmdb-dev@postgres:5432/cmdb_cache
DATABASE_URL=postgresql://cmdb:cmdb-dev@postgres:5432/cmdb_insight
```
## Snelle Commando's
@@ -168,16 +169,16 @@ sleep 5 && \
docker-compose exec postgres pg_isready -U cmdb
# Check database size (na sync)
docker-compose exec postgres psql -U cmdb -d cmdb_cache -c "
docker-compose exec postgres psql -U cmdb -d cmdb_insight -c "
SELECT
pg_size_pretty(pg_database_size('cmdb_cache')) as size;
pg_size_pretty(pg_database_size('cmdb_insight')) as size;
"
# List all tables
docker-compose exec postgres psql -U cmdb -d cmdb_cache -c "\dt"
docker-compose exec postgres psql -U cmdb -d cmdb_insight -c "\dt"
# Count objects
docker-compose exec postgres psql -U cmdb -d cmdb_cache -c "
docker-compose exec postgres psql -U cmdb -d cmdb_insight -c "
SELECT object_type_name, COUNT(*)
FROM objects
GROUP BY object_type_name;