TUTORIAL 10 · ADVANCED

Deploy a RAIQL Application

Generate Docker, Compose, Kubernetes and AWS ECS/Fargate deployment artifacts for the completed ServiceDesk application.

RAIQL 1.030 minProject: ServiceDesk
By the end of this tutorial
  • Generate deployment adapters
  • Build a production image
  • Prepare Kubernetes manifests
  • Prepare a non-secret AWS ECS deployment plan

Complete production-oriented ServiceDesk source

This final tutorial combines the capabilities introduced throughout the series. RAIQL 1.0 remains explicit: deployment declarations generate artifacts and plans; they do not silently modify your cloud account.

app.raiql
CREATE APPLICATION "RAIQL ServiceDesk";
TYPE WEB;

USE STACK
  FRONTEND NEXTJS,
  BACKEND NEXTJS,
  DATABASE POSTGRESQL,
  CLOUD AWS;

CREATE TENANT ENTITY Tenant;
CREATE USER ENTITY User;

CREATE ENTITY Ticket (
  id UUID PRIMARY,
  title STRING REQUIRED,
  description STRING,
  status STRING REQUIRED,
  priority STRING REQUIRED,
  ownerId UUID REQUIRED,
  tenantId UUID REQUIRED
);

CREATE CRUD Tenant;
CREATE API Tenant;
CREATE CRUD Ticket;
CREATE API Ticket;

ADD AUTHENTICATION EMAIL_PASSWORD, JWT;
ADD ROLE ADMIN, AGENT, USER;
DEFAULT ROLE USER;

RELATE Ticket.ownerId TO User.id;
RELATE Ticket.tenantId TO Tenant.id;
OWN Ticket BY ownerId;
TENANT Ticket BY tenantId;

ALLOW ADMIN CREATE Ticket, READ Ticket, UPDATE Ticket, DELETE Ticket, CREATE Tenant, READ Tenant, UPDATE Tenant, DELETE Tenant;
ALLOW AGENT READ Ticket, UPDATE Ticket;
ALLOW USER CREATE OWN Ticket, READ OWN Ticket, UPDATE OWN Ticket;

EVENT TicketCreated FROM Ticket;
JOB ProcessTicket ON TicketCreated;

GENERATE OPENAPI;
GENERATE SDK TYPESCRIPT;
GENERATE TESTS;

ADD OBSERVABILITY HEALTH, LOGS, METRICS, TRACES;

ENVIRONMENT development, staging, production;
SECRET DATABASE_URL;
SECRET RAIQL_JWT_SECRET;

BUILD;
DEPLOY DOCKER;
DEPLOY DOCKER_COMPOSE;
DEPLOY KUBERNETES;
DEPLOY AWS ECS;

Generate and verify

terminal
raiql validate
raiql compatibility
raiql generate
raiql lock
raiql audit
raiql test --env development
raiql build --env production

Inspect generated deployment targets

terminal
find generated/deploy -maxdepth 4 -type f | sort
ls generated/Dockerfile
ls generated/compose.yaml

Prepare the AWS ECS production plan

The ECS adapter uses placeholders and secret mappings so credentials never need to be embedded in generated source.

terminal
raiql deploy --env production --target aws-ecs

Operational surfaces

The final source also requests health, logs, metrics and trace correlation so deployments have generated operational endpoints/runtime hooks.

HTTP
GET /api/health
GET /api/metrics

You now have a complete path

  • Requirements in app.raiql
  • Validated domain/security/tenancy model
  • PostgreSQL persistence
  • OpenAPI + typed SDK
  • Events + worker
  • Generated tests
  • Environment/secrets contract
  • Container/Kubernetes/AWS deployment artifacts