Fa3liat is built for containerized deployment, ensuring consistency across development, staging, and production environments.
The application is orchestrated using Docker Compose with several specialized services:
app: The Node.js Express API.db: PostgreSQL with thepgvectorextension enabled.redis: High-performance cache and job queue backbone.mailhog: Local SMTP server for testing email delivery.ollama: AI engine container for generating vector embeddings.mail-worker/sms-worker: Specialized containers running background job loops.
- Bridge Network: All services communicate over an internal bridge network.
- Security: The database and redis containers are not exposed to the public internet. Only the
appcontainer (port 8000) andmailhog(port 8026 - dev only) have published ports.
To ensure data persists across container restarts:
postgres_data: Stores the relational and vector data.redis_data: Persists the job queue state and cache.ollama_data: Stores the downloaded LLM models (e.g.,nomic-embed-text).uploads: Local bind mount for storing user-uploaded banners and QR codes.
.envfiles: Used to store secrets likeJWT_KEYandSTRIPE_SECRET_KEY.- Precedence: Environment variables set in
docker-compose.ymloverride those in the local.envfile. - Validation: On startup, the app validates that all required environment variables are present before booting the HTTP server.
A typical CI pipeline for Fa3liat (e.g., GitHub Actions) performs:
- Linting: Ensures code adheres to Prettier/ESLint rules.
- Unit Tests: Runs the Jest test suite.
- Build: Verifies that the Docker images can be built without errors.
- Database Migration Check: Verifies that Prisma migrations are in sync with the schema.