The core layers
A practical platform usually contains a frontend, backend, database, identity service, external integrations, infrastructure and monitoring. AI is one integration inside that system—not the entire architecture.
Frontend
The website or mobile app that users interact with. It should never contain private API keys or direct database credentials.
Backend
The trusted application layer. It applies business rules, authorises actions, stores data and calls external services.
Database
The system of record. It should be private, backed up and reachable only by services that genuinely require access.
What happens when a user asks a question?
- The frontend sends an authenticated request to the backend.
- The backend verifies permissions and gathers the required context.
- The backend calls the AI provider using a protected secret.
- The response is validated and returned to the user.
- Relevant logs and usage metrics are recorded.
Use separate environments
Development, testing and production should use different credentials and data. Direct experimentation in production is not a strategy; it is a future incident report.
Create explicit security boundaries
- Keep databases off the public internet.
- Restrict origin access behind the edge where practical.
- Store secrets in platform-managed environment variables.
- Apply least-privilege permissions.
- Log important actions and failures.
Document architecture decisions
Use the Architecture Decision Record in the resource library to capture why each major technology was selected, what alternatives were rejected and what risks remain.
Open the toolkit →