@useatlas/create 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -18
- package/index.ts +191 -31
- package/package.json +1 -1
- package/templates/docker/.env.example +3 -3
- package/templates/docker/Dockerfile.sidecar +28 -0
- package/templates/docker/bin/__tests__/plugin-cli.test.ts +11 -11
- package/templates/docker/bin/atlas.ts +120 -56
- package/templates/docker/data/demo-semantic/catalog.yml +51 -27
- package/templates/docker/data/demo-semantic/entities/accounts.yml +95 -103
- package/templates/docker/data/demo-semantic/entities/companies.yml +88 -152
- package/templates/docker/data/demo-semantic/entities/people.yml +82 -95
- package/templates/docker/data/demo-semantic/glossary.yml +104 -8
- package/templates/docker/data/demo-semantic/metrics/accounts.yml +62 -23
- package/templates/docker/data/demo-semantic/metrics/companies.yml +52 -78
- package/templates/docker/docker-compose.yml +1 -1
- package/templates/docker/docs/deploy.md +4 -41
- package/templates/docker/package.json +17 -1
- package/templates/docker/semantic/catalog.yml +62 -3
- package/templates/docker/semantic/entities/accounts.yml +162 -0
- package/templates/docker/semantic/entities/companies.yml +143 -0
- package/templates/docker/semantic/entities/people.yml +132 -0
- package/templates/docker/semantic/glossary.yml +116 -4
- package/templates/docker/semantic/metrics/accounts.yml +77 -0
- package/templates/docker/semantic/metrics/companies.yml +63 -0
- package/templates/docker/sidecar/Dockerfile +5 -6
- package/templates/docker/sidecar/railway.json +1 -2
- package/templates/docker/src/api/__tests__/admin.test.ts +7 -7
- package/templates/docker/src/api/__tests__/health-plugin.test.ts +7 -0
- package/templates/docker/src/api/__tests__/health.test.ts +30 -8
- package/templates/docker/src/api/routes/admin.ts +549 -8
- package/templates/docker/src/api/routes/chat.ts +5 -20
- package/templates/docker/src/api/routes/health.ts +39 -27
- package/templates/docker/src/api/routes/openapi.ts +1329 -74
- package/templates/docker/src/api/routes/query.ts +2 -1
- package/templates/docker/src/api/server.ts +27 -0
- package/templates/docker/src/app/api/[...route]/route.ts +2 -2
- package/templates/docker/src/app/globals.css +13 -12
- package/templates/docker/src/app/layout.tsx +9 -2
- package/templates/docker/src/components/ui/alert-dialog.tsx +196 -0
- package/templates/docker/src/components/ui/badge.tsx +48 -0
- package/templates/docker/src/components/ui/button.tsx +64 -0
- package/templates/docker/src/components/ui/card.tsx +92 -0
- package/templates/docker/src/components/ui/collapsible.tsx +33 -0
- package/templates/docker/src/components/ui/command.tsx +184 -0
- package/templates/docker/src/components/ui/dialog.tsx +158 -0
- package/templates/docker/src/components/ui/dropdown-menu.tsx +257 -0
- package/templates/docker/src/components/ui/input.tsx +21 -0
- package/templates/docker/src/components/ui/scroll-area.tsx +58 -0
- package/templates/docker/src/components/ui/select.tsx +190 -0
- package/templates/docker/src/components/ui/separator.tsx +28 -0
- package/templates/docker/src/components/ui/sheet.tsx +143 -0
- package/templates/docker/src/components/ui/sidebar.tsx +726 -0
- package/templates/docker/src/components/ui/skeleton.tsx +13 -0
- package/templates/docker/src/components/ui/table.tsx +116 -0
- package/templates/docker/src/components/ui/tabs.tsx +91 -0
- package/templates/docker/src/components/ui/toggle-group.tsx +83 -0
- package/templates/docker/src/components/ui/toggle.tsx +47 -0
- package/templates/docker/src/components/ui/tooltip.tsx +57 -0
- package/templates/docker/src/hooks/use-mobile.ts +19 -0
- package/templates/docker/src/lib/__tests__/agent-cache.test.ts +2 -0
- package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +17 -0
- package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +2 -0
- package/templates/docker/src/lib/__tests__/agent-integration.test.ts +2 -0
- package/templates/docker/src/lib/__tests__/config.test.ts +69 -19
- package/templates/docker/src/lib/__tests__/plugin-aware-validation.test.ts +321 -0
- package/templates/docker/src/lib/__tests__/providers.test.ts +32 -1
- package/templates/docker/src/lib/__tests__/startup-actions.test.ts +9 -0
- package/templates/docker/src/lib/__tests__/startup-first-run.test.ts +429 -0
- package/templates/docker/src/lib/__tests__/startup.test.ts +5 -0
- package/templates/docker/src/lib/agent-query.ts +5 -23
- package/templates/docker/src/lib/agent.ts +32 -112
- package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +5 -3
- package/templates/docker/src/lib/auth/middleware.ts +30 -4
- package/templates/docker/src/lib/auth/migrate.ts +97 -0
- package/templates/docker/src/lib/auth/server.ts +12 -1
- package/templates/docker/src/lib/config.ts +38 -40
- package/templates/docker/src/lib/db/__tests__/connection.test.ts +89 -14
- package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +1 -18
- package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -19
- package/templates/docker/src/lib/db/__tests__/registry.test.ts +11 -208
- package/templates/docker/src/lib/db/connection.ts +87 -265
- package/templates/docker/src/lib/db/internal.ts +6 -1
- package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +3 -1
- package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +2 -2
- package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +355 -1
- package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +32 -5
- package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +228 -14
- package/templates/docker/src/lib/plugins/index.ts +4 -1
- package/templates/docker/src/lib/plugins/migrate.ts +104 -1
- package/templates/docker/src/lib/plugins/registry.ts +14 -8
- package/templates/docker/src/lib/plugins/wiring.ts +113 -4
- package/templates/docker/src/lib/providers.ts +6 -1
- package/templates/docker/src/lib/security.ts +24 -0
- package/templates/docker/src/lib/semantic.ts +2 -0
- package/templates/docker/src/lib/sidecar-types.ts +12 -1
- package/templates/docker/src/lib/startup.ts +71 -101
- package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +32 -18
- package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +14 -14
- package/templates/docker/src/lib/tools/__tests__/explore-sdk-compat.test.ts +1 -1
- package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +5 -3
- package/templates/docker/src/lib/tools/__tests__/python-nsjail.test.ts +515 -0
- package/templates/docker/src/lib/tools/__tests__/python-sandbox.test.ts +397 -0
- package/templates/docker/src/lib/tools/__tests__/python-sidecar.test.ts +365 -0
- package/templates/docker/src/lib/tools/__tests__/python.test.ts +331 -0
- package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +1 -13
- package/templates/docker/src/lib/tools/__tests__/registry.test.ts +38 -31
- package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +2 -0
- package/templates/docker/src/lib/tools/__tests__/sql.test.ts +5 -308
- package/templates/docker/src/lib/tools/explore-nsjail.ts +17 -12
- package/templates/docker/src/lib/tools/explore-sidecar.ts +25 -0
- package/templates/docker/src/lib/tools/explore.ts +28 -32
- package/templates/docker/src/lib/tools/python-nsjail.ts +396 -0
- package/templates/docker/src/lib/tools/python-sandbox.ts +476 -0
- package/templates/docker/src/lib/tools/python-sidecar.ts +150 -0
- package/templates/docker/src/lib/tools/python.ts +367 -0
- package/templates/docker/src/lib/tools/registry.ts +49 -22
- package/templates/docker/src/lib/tools/sql.ts +88 -88
- package/templates/docker/src/types/vercel-sandbox.d.ts +7 -0
- package/templates/docker/src/ui/components/admin/admin-layout.tsx +77 -8
- package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +25 -17
- package/templates/docker/src/ui/components/admin/change-password-dialog.tsx +128 -0
- package/templates/docker/src/ui/components/admin/entity-detail.tsx +3 -3
- package/templates/docker/src/ui/components/admin/semantic-file-tree.tsx +159 -0
- package/templates/docker/src/ui/components/atlas-chat.tsx +64 -12
- package/templates/docker/src/ui/components/chart/result-chart.tsx +25 -15
- package/templates/docker/src/ui/components/chat/markdown.tsx +88 -42
- package/templates/docker/src/ui/components/chat/python-result-card.tsx +244 -0
- package/templates/docker/src/ui/components/chat/sql-block.tsx +39 -15
- package/templates/docker/src/ui/components/chat/sql-result-card.tsx +6 -1
- package/templates/docker/src/ui/components/chat/tool-part.tsx +12 -3
- package/templates/docker/src/ui/components/chat/typing-indicator.tsx +5 -2
- package/templates/docker/src/ui/components/conversations/conversation-item.tsx +25 -20
- package/templates/docker/src/ui/context.tsx +1 -1
- package/templates/docker/src/ui/hooks/use-conversations.ts +3 -3
- package/templates/docker/src/ui/hooks/use-dark-mode.ts +17 -10
- package/templates/docker/tsconfig.json +2 -2
- package/templates/nextjs-standalone/.env.example +1 -1
- package/templates/nextjs-standalone/bin/__tests__/plugin-cli.test.ts +11 -11
- package/templates/nextjs-standalone/bin/atlas.ts +120 -56
- package/templates/nextjs-standalone/data/demo-semantic/catalog.yml +51 -27
- package/templates/nextjs-standalone/data/demo-semantic/entities/accounts.yml +95 -103
- package/templates/nextjs-standalone/data/demo-semantic/entities/companies.yml +88 -152
- package/templates/nextjs-standalone/data/demo-semantic/entities/people.yml +82 -95
- package/templates/nextjs-standalone/data/demo-semantic/glossary.yml +104 -8
- package/templates/nextjs-standalone/data/demo-semantic/metrics/accounts.yml +62 -23
- package/templates/nextjs-standalone/data/demo-semantic/metrics/companies.yml +52 -78
- package/templates/nextjs-standalone/docs/deploy.md +4 -41
- package/templates/nextjs-standalone/package.json +11 -2
- package/templates/nextjs-standalone/scripts/migrate-auth.ts +25 -0
- package/templates/nextjs-standalone/scripts/seed-demo.ts +94 -0
- package/templates/nextjs-standalone/semantic/catalog.yml +62 -3
- package/templates/nextjs-standalone/semantic/entities/accounts.yml +162 -0
- package/templates/nextjs-standalone/semantic/entities/companies.yml +143 -0
- package/templates/nextjs-standalone/semantic/entities/people.yml +132 -0
- package/templates/nextjs-standalone/semantic/glossary.yml +116 -4
- package/templates/nextjs-standalone/semantic/metrics/accounts.yml +77 -0
- package/templates/nextjs-standalone/semantic/metrics/companies.yml +63 -0
- package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +7 -7
- package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +7 -0
- package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +30 -8
- package/templates/nextjs-standalone/src/api/routes/admin.ts +549 -8
- package/templates/nextjs-standalone/src/api/routes/chat.ts +5 -20
- package/templates/nextjs-standalone/src/api/routes/health.ts +39 -27
- package/templates/nextjs-standalone/src/api/routes/openapi.ts +1329 -74
- package/templates/nextjs-standalone/src/api/routes/query.ts +2 -1
- package/templates/nextjs-standalone/src/api/server.ts +27 -0
- package/templates/nextjs-standalone/src/app/api/[...route]/route.ts +2 -2
- package/templates/nextjs-standalone/src/app/globals.css +13 -12
- package/templates/nextjs-standalone/src/app/layout.tsx +9 -2
- package/templates/nextjs-standalone/src/components/ui/alert-dialog.tsx +196 -0
- package/templates/nextjs-standalone/src/components/ui/badge.tsx +48 -0
- package/templates/nextjs-standalone/src/components/ui/button.tsx +64 -0
- package/templates/nextjs-standalone/src/components/ui/card.tsx +92 -0
- package/templates/nextjs-standalone/src/components/ui/collapsible.tsx +33 -0
- package/templates/nextjs-standalone/src/components/ui/command.tsx +184 -0
- package/templates/nextjs-standalone/src/components/ui/dialog.tsx +158 -0
- package/templates/nextjs-standalone/src/components/ui/dropdown-menu.tsx +257 -0
- package/templates/nextjs-standalone/src/components/ui/input.tsx +21 -0
- package/templates/nextjs-standalone/src/components/ui/scroll-area.tsx +58 -0
- package/templates/nextjs-standalone/src/components/ui/select.tsx +190 -0
- package/templates/nextjs-standalone/src/components/ui/separator.tsx +28 -0
- package/templates/nextjs-standalone/src/components/ui/sheet.tsx +143 -0
- package/templates/nextjs-standalone/src/components/ui/sidebar.tsx +726 -0
- package/templates/nextjs-standalone/src/components/ui/skeleton.tsx +13 -0
- package/templates/nextjs-standalone/src/components/ui/table.tsx +116 -0
- package/templates/nextjs-standalone/src/components/ui/tabs.tsx +91 -0
- package/templates/nextjs-standalone/src/components/ui/toggle-group.tsx +83 -0
- package/templates/nextjs-standalone/src/components/ui/toggle.tsx +47 -0
- package/templates/nextjs-standalone/src/components/ui/tooltip.tsx +57 -0
- package/templates/nextjs-standalone/src/hooks/use-mobile.ts +19 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +17 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +69 -19
- package/templates/nextjs-standalone/src/lib/__tests__/plugin-aware-validation.test.ts +321 -0
- package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +32 -1
- package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +9 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup-first-run.test.ts +429 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +5 -0
- package/templates/nextjs-standalone/src/lib/agent-query.ts +5 -23
- package/templates/nextjs-standalone/src/lib/agent.ts +32 -112
- package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +5 -3
- package/templates/nextjs-standalone/src/lib/auth/middleware.ts +30 -4
- package/templates/nextjs-standalone/src/lib/auth/migrate.ts +97 -0
- package/templates/nextjs-standalone/src/lib/auth/server.ts +12 -1
- package/templates/nextjs-standalone/src/lib/config.ts +38 -40
- package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +89 -14
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +1 -18
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -19
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +11 -208
- package/templates/nextjs-standalone/src/lib/db/connection.ts +87 -265
- package/templates/nextjs-standalone/src/lib/db/internal.ts +6 -1
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +3 -1
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +2 -2
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +355 -1
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +32 -5
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +228 -14
- package/templates/nextjs-standalone/src/lib/plugins/index.ts +4 -1
- package/templates/nextjs-standalone/src/lib/plugins/migrate.ts +104 -1
- package/templates/nextjs-standalone/src/lib/plugins/registry.ts +14 -8
- package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +113 -4
- package/templates/nextjs-standalone/src/lib/providers.ts +6 -1
- package/templates/nextjs-standalone/src/lib/security.ts +24 -0
- package/templates/nextjs-standalone/src/lib/semantic.ts +2 -0
- package/templates/nextjs-standalone/src/lib/sidecar-types.ts +12 -1
- package/templates/nextjs-standalone/src/lib/startup.ts +71 -101
- package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +32 -18
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +14 -14
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sdk-compat.test.ts +1 -1
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +5 -3
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-nsjail.test.ts +515 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sandbox.test.ts +397 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sidecar.test.ts +365 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python.test.ts +331 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +1 -13
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +38 -31
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +2 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +5 -308
- package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +17 -12
- package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +25 -0
- package/templates/nextjs-standalone/src/lib/tools/explore.ts +28 -32
- package/templates/nextjs-standalone/src/lib/tools/python-nsjail.ts +396 -0
- package/templates/nextjs-standalone/src/lib/tools/python-sandbox.ts +476 -0
- package/templates/nextjs-standalone/src/lib/tools/python-sidecar.ts +150 -0
- package/templates/nextjs-standalone/src/lib/tools/python.ts +367 -0
- package/templates/nextjs-standalone/src/lib/tools/registry.ts +49 -22
- package/templates/nextjs-standalone/src/lib/tools/sql.ts +88 -88
- package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +77 -8
- package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +25 -17
- package/templates/nextjs-standalone/src/ui/components/admin/change-password-dialog.tsx +128 -0
- package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +3 -3
- package/templates/nextjs-standalone/src/ui/components/admin/semantic-file-tree.tsx +159 -0
- package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +64 -12
- package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +25 -15
- package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +88 -42
- package/templates/nextjs-standalone/src/ui/components/chat/python-result-card.tsx +244 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-block.tsx +39 -15
- package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +6 -1
- package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +12 -3
- package/templates/nextjs-standalone/src/ui/components/chat/typing-indicator.tsx +5 -2
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +25 -20
- package/templates/nextjs-standalone/src/ui/context.tsx +1 -1
- package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +3 -3
- package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +17 -10
- package/templates/nextjs-standalone/tsconfig.json +0 -1
- package/templates/nextjs-standalone/vercel.json +4 -1
- package/templates/docker/render.yaml +0 -34
- package/templates/docker/semantic/entities/.gitkeep +0 -0
- package/templates/docker/semantic/metrics/.gitkeep +0 -0
- package/templates/docker/src/lib/db/__tests__/duckdb.test.ts +0 -141
- package/templates/docker/src/lib/db/__tests__/salesforce.test.ts +0 -339
- package/templates/docker/src/lib/db/__tests__/snowflake.test.ts +0 -217
- package/templates/docker/src/lib/db/duckdb.ts +0 -122
- package/templates/docker/src/lib/db/salesforce.ts +0 -342
- package/templates/docker/src/lib/tools/__tests__/salesforce-tool.test.ts +0 -154
- package/templates/docker/src/lib/tools/__tests__/soql-validation.test.ts +0 -303
- package/templates/docker/src/lib/tools/__tests__/sql-duckdb.test.ts +0 -233
- package/templates/docker/src/lib/tools/salesforce.ts +0 -138
- package/templates/docker/src/lib/tools/soql-validation.ts +0 -172
- package/templates/nextjs-standalone/semantic/entities/.gitkeep +0 -0
- package/templates/nextjs-standalone/semantic/metrics/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/duckdb.test.ts +0 -141
- package/templates/nextjs-standalone/src/lib/db/__tests__/salesforce.test.ts +0 -339
- package/templates/nextjs-standalone/src/lib/db/__tests__/snowflake.test.ts +0 -217
- package/templates/nextjs-standalone/src/lib/db/duckdb.ts +0 -122
- package/templates/nextjs-standalone/src/lib/db/salesforce.ts +0 -342
- package/templates/nextjs-standalone/src/lib/tools/__tests__/salesforce-tool.test.ts +0 -154
- package/templates/nextjs-standalone/src/lib/tools/__tests__/soql-validation.test.ts +0 -303
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-duckdb.test.ts +0 -233
- package/templates/nextjs-standalone/src/lib/tools/salesforce.ts +0 -138
- package/templates/nextjs-standalone/src/lib/tools/soql-validation.ts +0 -172
|
@@ -1,145 +1,132 @@
|
|
|
1
1
|
name: People
|
|
2
|
-
type:
|
|
2
|
+
type: dimension_table
|
|
3
3
|
table: people
|
|
4
|
-
grain: one row per
|
|
5
|
-
description:
|
|
4
|
+
grain: one row per contact
|
|
5
|
+
description: |
|
|
6
|
+
Contacts at customer companies. Each person has a department, seniority level,
|
|
7
|
+
job title, and start date. Linked to companies via company_id. Use for
|
|
8
|
+
stakeholder mapping, org analysis, and understanding who we're selling to
|
|
9
|
+
and supporting at each company.
|
|
10
|
+
|
|
6
11
|
dimensions:
|
|
7
12
|
- name: id
|
|
8
13
|
sql: id
|
|
9
14
|
type: number
|
|
10
|
-
description: Primary key
|
|
15
|
+
description: Primary key — unique contact identifier
|
|
11
16
|
primary_key: true
|
|
12
|
-
|
|
13
|
-
sample_values:
|
|
14
|
-
- '1'
|
|
15
|
-
- '2'
|
|
16
|
-
- '3'
|
|
17
|
-
- '4'
|
|
18
|
-
- '5'
|
|
19
|
-
- '6'
|
|
20
|
-
- '7'
|
|
21
|
-
- '8'
|
|
17
|
+
|
|
22
18
|
- name: name
|
|
23
19
|
sql: name
|
|
24
20
|
type: string
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- Alex Brown
|
|
28
|
-
- Alex Chen
|
|
29
|
-
- Alex Garcia
|
|
30
|
-
- Alex Kim
|
|
31
|
-
- Alex Mueller
|
|
32
|
-
- Alex Patel
|
|
33
|
-
- Alex Silva
|
|
34
|
-
- Alex Smith
|
|
21
|
+
description: Full name of the contact
|
|
22
|
+
|
|
35
23
|
- name: email
|
|
36
24
|
sql: email
|
|
37
25
|
type: string
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- alex.brown@company32.com
|
|
41
|
-
- alex.chen@company12.com
|
|
42
|
-
- alex.garcia@company42.com
|
|
43
|
-
- alex.kim@company32.com
|
|
44
|
-
- alex.mueller@company2.com
|
|
45
|
-
- alex.patel@company22.com
|
|
46
|
-
- alex.silva@company22.com
|
|
47
|
-
- alex.smith@company1.com
|
|
26
|
+
description: Work email address
|
|
27
|
+
|
|
48
28
|
- name: company_id
|
|
49
29
|
sql: company_id
|
|
50
30
|
type: number
|
|
51
|
-
description: Foreign key to companies
|
|
52
|
-
|
|
53
|
-
sample_values:
|
|
54
|
-
- '1'
|
|
55
|
-
- '2'
|
|
56
|
-
- '3'
|
|
57
|
-
- '4'
|
|
58
|
-
- '5'
|
|
59
|
-
- '6'
|
|
60
|
-
- '7'
|
|
61
|
-
- '8'
|
|
31
|
+
description: Foreign key to companies — which company this person works at
|
|
32
|
+
|
|
62
33
|
- name: department
|
|
63
34
|
sql: department
|
|
64
35
|
type: string
|
|
65
|
-
|
|
66
|
-
sample_values:
|
|
67
|
-
|
|
68
|
-
- Finance
|
|
69
|
-
- Marketing
|
|
70
|
-
- Operations
|
|
71
|
-
- Product
|
|
72
|
-
- Sales
|
|
36
|
+
description: Functional department within the company
|
|
37
|
+
sample_values: [Engineering, Finance, Marketing, Operations, Product, Sales]
|
|
38
|
+
|
|
73
39
|
- name: seniority
|
|
74
40
|
sql: seniority
|
|
75
41
|
type: string
|
|
76
|
-
|
|
77
|
-
sample_values:
|
|
78
|
-
|
|
79
|
-
- Junior
|
|
80
|
-
- Mid
|
|
81
|
-
- Senior
|
|
42
|
+
description: Career level — indicates decision-making authority
|
|
43
|
+
sample_values: [Executive, Senior, Mid, Junior]
|
|
44
|
+
|
|
82
45
|
- name: title
|
|
83
46
|
sql: title
|
|
84
47
|
type: string
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- Accountant
|
|
88
|
-
- Account Executive
|
|
89
|
-
- Backend Engineer
|
|
90
|
-
- Brand Manager
|
|
91
|
-
- CFO
|
|
92
|
-
- Content Strategist
|
|
93
|
-
- Controller
|
|
94
|
-
- Data Analyst
|
|
48
|
+
description: Job title (e.g. CFO, Backend Engineer, Account Executive)
|
|
49
|
+
|
|
95
50
|
- name: start_date
|
|
96
51
|
sql: start_date
|
|
97
52
|
type: date
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- Wed Jan 10 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
101
|
-
- Mon Jan 15 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
102
|
-
- Thu Feb 01 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
103
|
-
- Sat Mar 10 2018 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
104
|
-
- Tue Mar 20 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
105
|
-
- Sun Apr 01 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
106
|
-
- Sun Apr 15 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
107
|
-
- Thu May 10 2018 00:00:00 GMT-0400 (Eastern Daylight Time)
|
|
53
|
+
description: Date the person started at their company
|
|
54
|
+
|
|
108
55
|
- name: start_date_year
|
|
109
56
|
sql: EXTRACT(YEAR FROM start_date)
|
|
110
57
|
type: number
|
|
111
|
-
description: Year
|
|
58
|
+
description: Year the person started — useful for tenure analysis
|
|
112
59
|
virtual: true
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
60
|
+
|
|
61
|
+
- name: tenure_years
|
|
62
|
+
sql: EXTRACT(YEAR FROM AGE(CURRENT_DATE, start_date))
|
|
63
|
+
type: number
|
|
64
|
+
description: Approximate years of tenure at the company
|
|
117
65
|
virtual: true
|
|
66
|
+
|
|
118
67
|
measures:
|
|
119
|
-
- name:
|
|
68
|
+
- name: contact_count
|
|
120
69
|
sql: id
|
|
121
70
|
type: count_distinct
|
|
71
|
+
description: Number of unique contacts
|
|
72
|
+
|
|
73
|
+
- name: avg_tenure
|
|
74
|
+
sql: EXTRACT(YEAR FROM AGE(CURRENT_DATE, start_date))
|
|
75
|
+
type: avg
|
|
76
|
+
description: Average tenure in years
|
|
77
|
+
|
|
122
78
|
joins:
|
|
123
79
|
- target_entity: Companies
|
|
124
80
|
relationship: many_to_one
|
|
125
81
|
join_columns:
|
|
126
82
|
from: company_id
|
|
127
83
|
to: id
|
|
128
|
-
description: Each
|
|
84
|
+
description: Each contact belongs to one company
|
|
85
|
+
|
|
129
86
|
use_cases:
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
87
|
+
- Stakeholder mapping — who are the key contacts at each company
|
|
88
|
+
- Department breakdown — what functions are represented
|
|
89
|
+
- Seniority analysis — how many executives vs individual contributors
|
|
90
|
+
- Hiring trends — when were contacts added, by year
|
|
91
|
+
- Join to companies + accounts for full customer intelligence
|
|
92
|
+
|
|
133
93
|
query_patterns:
|
|
134
|
-
-
|
|
94
|
+
- name: contacts_by_department
|
|
95
|
+
description: Contact count by department
|
|
135
96
|
sql: |-
|
|
136
|
-
SELECT department,
|
|
97
|
+
SELECT department,
|
|
98
|
+
COUNT(*) AS contact_count
|
|
137
99
|
FROM people
|
|
138
100
|
GROUP BY department
|
|
139
|
-
ORDER BY
|
|
140
|
-
|
|
101
|
+
ORDER BY contact_count DESC
|
|
102
|
+
|
|
103
|
+
- name: contacts_by_seniority
|
|
104
|
+
description: Contact distribution by seniority level
|
|
141
105
|
sql: |-
|
|
142
|
-
SELECT seniority,
|
|
106
|
+
SELECT seniority,
|
|
107
|
+
COUNT(*) AS contact_count
|
|
143
108
|
FROM people
|
|
144
109
|
GROUP BY seniority
|
|
145
|
-
ORDER BY
|
|
110
|
+
ORDER BY contact_count DESC
|
|
111
|
+
|
|
112
|
+
- name: executives_by_company
|
|
113
|
+
description: Executive contacts per company
|
|
114
|
+
sql: |-
|
|
115
|
+
SELECT c.name AS company,
|
|
116
|
+
COUNT(*) AS executive_count
|
|
117
|
+
FROM people p
|
|
118
|
+
JOIN companies c ON p.company_id = c.id
|
|
119
|
+
WHERE p.seniority = 'Executive'
|
|
120
|
+
GROUP BY c.name
|
|
121
|
+
ORDER BY executive_count DESC
|
|
122
|
+
|
|
123
|
+
- name: contacts_per_company
|
|
124
|
+
description: Contact density per company
|
|
125
|
+
sql: |-
|
|
126
|
+
SELECT c.name AS company,
|
|
127
|
+
COUNT(*) AS contact_count,
|
|
128
|
+
c.employee_count AS total_employees
|
|
129
|
+
FROM people p
|
|
130
|
+
JOIN companies c ON p.company_id = c.id
|
|
131
|
+
GROUP BY c.name, c.employee_count
|
|
132
|
+
ORDER BY contact_count DESC
|
|
@@ -1,22 +1,118 @@
|
|
|
1
1
|
terms:
|
|
2
|
+
MRR:
|
|
3
|
+
status: defined
|
|
4
|
+
definition: >
|
|
5
|
+
Monthly Recurring Revenue. The sum of monthly_value across all active accounts.
|
|
6
|
+
Use accounts.monthly_value and filter by status = 'Active' for current MRR.
|
|
7
|
+
tables:
|
|
8
|
+
- accounts
|
|
9
|
+
|
|
10
|
+
ARR:
|
|
11
|
+
status: defined
|
|
12
|
+
definition: >
|
|
13
|
+
Annual Recurring Revenue. MRR * 12. Not stored directly — calculate from
|
|
14
|
+
accounts.monthly_value.
|
|
15
|
+
tables:
|
|
16
|
+
- accounts
|
|
17
|
+
|
|
18
|
+
ARPA:
|
|
19
|
+
status: defined
|
|
20
|
+
definition: >
|
|
21
|
+
Average Revenue Per Account. Total MRR divided by active account count.
|
|
22
|
+
Use AVG(monthly_value) on active accounts.
|
|
23
|
+
tables:
|
|
24
|
+
- accounts
|
|
25
|
+
|
|
26
|
+
churn:
|
|
27
|
+
status: defined
|
|
28
|
+
definition: >
|
|
29
|
+
An account with status = 'Churned'. Churned accounts have monthly_value = 0
|
|
30
|
+
and typically have a contract_end date set.
|
|
31
|
+
tables:
|
|
32
|
+
- accounts
|
|
33
|
+
|
|
34
|
+
plan:
|
|
35
|
+
status: defined
|
|
36
|
+
definition: >
|
|
37
|
+
Subscription tier. Four levels: Free ($0), Starter (~$49-89/mo),
|
|
38
|
+
Pro (~$299-500/mo), Enterprise (~$5,000-15,000/mo).
|
|
39
|
+
tables:
|
|
40
|
+
- accounts
|
|
41
|
+
|
|
42
|
+
status:
|
|
43
|
+
status: ambiguous
|
|
44
|
+
note: >
|
|
45
|
+
"status" appears on accounts only, but could be confused with general
|
|
46
|
+
state. Always refers to subscription status: Active, Inactive,
|
|
47
|
+
Suspended, or Churned.
|
|
48
|
+
possible_mappings:
|
|
49
|
+
- accounts.status
|
|
50
|
+
|
|
2
51
|
name:
|
|
3
52
|
status: ambiguous
|
|
4
|
-
note:
|
|
53
|
+
note: >
|
|
54
|
+
"name" appears in both companies and people. ASK the user which
|
|
55
|
+
entity they mean — company name or person name.
|
|
5
56
|
possible_mappings:
|
|
6
57
|
- companies.name
|
|
7
58
|
- people.name
|
|
59
|
+
|
|
8
60
|
company:
|
|
9
61
|
status: defined
|
|
10
|
-
definition:
|
|
11
|
-
|
|
62
|
+
definition: >
|
|
63
|
+
Refers to the companies entity (our customers). Linked from accounts
|
|
64
|
+
and people via company_id -> companies.id.
|
|
65
|
+
tables:
|
|
66
|
+
- companies
|
|
67
|
+
- accounts
|
|
68
|
+
- people
|
|
69
|
+
|
|
70
|
+
industry:
|
|
12
71
|
status: defined
|
|
13
|
-
definition:
|
|
14
|
-
|
|
72
|
+
definition: >
|
|
73
|
+
Business sector of a customer company. Values: Education, Energy,
|
|
74
|
+
Finance, Healthcare, Manufacturing, Media, Retail, Technology.
|
|
75
|
+
tables:
|
|
76
|
+
- companies
|
|
77
|
+
|
|
78
|
+
country:
|
|
15
79
|
status: defined
|
|
16
|
-
definition:
|
|
80
|
+
definition: >
|
|
81
|
+
ISO 2-letter country code for company HQ location. Values: AU, BR,
|
|
82
|
+
CA, DE, FR, IN, JP, SG, UK, US.
|
|
83
|
+
tables:
|
|
84
|
+
- companies
|
|
85
|
+
|
|
17
86
|
department:
|
|
18
87
|
status: defined
|
|
19
|
-
definition:
|
|
88
|
+
definition: >
|
|
89
|
+
Functional department of a contact. Values: Engineering, Finance,
|
|
90
|
+
Marketing, Operations, Product, Sales.
|
|
91
|
+
tables:
|
|
92
|
+
- people
|
|
93
|
+
|
|
20
94
|
seniority:
|
|
21
95
|
status: defined
|
|
22
|
-
definition:
|
|
96
|
+
definition: >
|
|
97
|
+
Career level of a contact. Values: Executive, Senior, Mid, Junior.
|
|
98
|
+
tables:
|
|
99
|
+
- people
|
|
100
|
+
|
|
101
|
+
revenue:
|
|
102
|
+
status: ambiguous
|
|
103
|
+
note: >
|
|
104
|
+
Could mean company revenue (companies.revenue — annual total revenue
|
|
105
|
+
of the customer) or account revenue (accounts.monthly_value — our MRR
|
|
106
|
+
from that account). Clarify which is meant.
|
|
107
|
+
possible_mappings:
|
|
108
|
+
- companies.revenue
|
|
109
|
+
- accounts.monthly_value
|
|
110
|
+
|
|
111
|
+
contract:
|
|
112
|
+
status: defined
|
|
113
|
+
definition: >
|
|
114
|
+
Subscription agreement period. contract_start is when billing began;
|
|
115
|
+
contract_end is set when an account churns or is terminated.
|
|
116
|
+
NULL contract_end means the account is still under contract.
|
|
117
|
+
tables:
|
|
118
|
+
- accounts
|
|
@@ -1,38 +1,77 @@
|
|
|
1
1
|
metrics:
|
|
2
|
-
- id:
|
|
3
|
-
label: Total
|
|
4
|
-
description:
|
|
5
|
-
type: atomic
|
|
6
|
-
sql: |-
|
|
7
|
-
SELECT COUNT(DISTINCT id) as count
|
|
8
|
-
FROM accounts
|
|
9
|
-
aggregation: count_distinct
|
|
10
|
-
- id: total_monthly_value
|
|
11
|
-
label: Total monthly value
|
|
12
|
-
description: Sum of monthly_value across all accounts.
|
|
2
|
+
- id: total_mrr
|
|
3
|
+
label: Total MRR
|
|
4
|
+
description: Total Monthly Recurring Revenue across all active accounts.
|
|
13
5
|
type: atomic
|
|
6
|
+
unit: USD
|
|
14
7
|
source:
|
|
15
8
|
entity: Accounts
|
|
16
|
-
measure:
|
|
9
|
+
measure: total_mrr
|
|
17
10
|
sql: |-
|
|
18
|
-
SELECT SUM(monthly_value)
|
|
11
|
+
SELECT SUM(monthly_value) AS total_mrr
|
|
19
12
|
FROM accounts
|
|
13
|
+
WHERE status = 'Active'
|
|
20
14
|
aggregation: sum
|
|
21
15
|
objective: maximize
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
|
|
17
|
+
- id: active_accounts
|
|
18
|
+
label: Active Accounts
|
|
19
|
+
description: Number of accounts with status = 'Active'.
|
|
25
20
|
type: atomic
|
|
26
21
|
sql: |-
|
|
27
|
-
SELECT
|
|
22
|
+
SELECT COUNT(*) AS active_accounts
|
|
28
23
|
FROM accounts
|
|
24
|
+
WHERE status = 'Active'
|
|
25
|
+
aggregation: count
|
|
26
|
+
|
|
27
|
+
- id: arpa
|
|
28
|
+
label: ARPA (Avg Revenue Per Account)
|
|
29
|
+
description: Average MRR per active account.
|
|
30
|
+
type: derived
|
|
31
|
+
unit: USD
|
|
32
|
+
sql: |-
|
|
33
|
+
SELECT AVG(monthly_value) AS arpa
|
|
34
|
+
FROM accounts
|
|
35
|
+
WHERE status = 'Active'
|
|
29
36
|
aggregation: avg
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
|
|
38
|
+
- id: churn_rate
|
|
39
|
+
label: Churn Rate
|
|
40
|
+
description: Percentage of all accounts that have churned.
|
|
41
|
+
type: derived
|
|
42
|
+
unit: percent
|
|
43
|
+
sql: |-
|
|
44
|
+
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'Churned') / COUNT(*), 1) AS churn_rate
|
|
45
|
+
FROM accounts
|
|
46
|
+
aggregation: ratio
|
|
47
|
+
objective: minimize
|
|
48
|
+
|
|
49
|
+
- id: mrr_by_plan
|
|
50
|
+
label: MRR by Plan
|
|
51
|
+
description: MRR breakdown by subscription plan tier.
|
|
52
|
+
type: breakdown
|
|
53
|
+
unit: USD
|
|
54
|
+
sql: |-
|
|
55
|
+
SELECT plan,
|
|
56
|
+
SUM(monthly_value) AS total_mrr,
|
|
57
|
+
COUNT(*) AS account_count,
|
|
58
|
+
AVG(monthly_value) AS avg_mrr
|
|
59
|
+
FROM accounts
|
|
60
|
+
WHERE status = 'Active'
|
|
61
|
+
GROUP BY plan
|
|
62
|
+
ORDER BY total_mrr DESC
|
|
63
|
+
|
|
64
|
+
- id: churn_by_plan
|
|
65
|
+
label: Churn Rate by Plan
|
|
66
|
+
description: Churn rate broken down by plan tier.
|
|
67
|
+
type: breakdown
|
|
68
|
+
unit: percent
|
|
34
69
|
sql: |-
|
|
35
|
-
SELECT plan,
|
|
70
|
+
SELECT plan,
|
|
71
|
+
COUNT(*) FILTER (WHERE status = 'Churned') AS churned,
|
|
72
|
+
COUNT(*) AS total,
|
|
73
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'Churned') / COUNT(*), 1) AS churn_pct
|
|
36
74
|
FROM accounts
|
|
37
75
|
GROUP BY plan
|
|
38
|
-
ORDER BY
|
|
76
|
+
ORDER BY churn_pct DESC
|
|
77
|
+
objective: minimize
|
|
@@ -1,89 +1,63 @@
|
|
|
1
1
|
metrics:
|
|
2
|
-
- id:
|
|
3
|
-
label: Total
|
|
4
|
-
description:
|
|
2
|
+
- id: total_customers
|
|
3
|
+
label: Total Customers
|
|
4
|
+
description: Number of unique customer companies.
|
|
5
5
|
type: atomic
|
|
6
6
|
sql: |-
|
|
7
|
-
SELECT COUNT(DISTINCT id)
|
|
7
|
+
SELECT COUNT(DISTINCT id) AS total_customers
|
|
8
8
|
FROM companies
|
|
9
9
|
aggregation: count_distinct
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
|
|
11
|
+
- id: avg_customer_revenue
|
|
12
|
+
label: Avg Customer Revenue
|
|
13
|
+
description: Average annual revenue across customer companies.
|
|
13
14
|
type: atomic
|
|
15
|
+
unit: USD
|
|
14
16
|
source:
|
|
15
17
|
entity: Companies
|
|
16
|
-
measure:
|
|
18
|
+
measure: avg_revenue
|
|
17
19
|
sql: |-
|
|
18
|
-
SELECT
|
|
19
|
-
FROM companies
|
|
20
|
-
aggregation: sum
|
|
21
|
-
objective: maximize
|
|
22
|
-
- id: avg_employee_count
|
|
23
|
-
label: Average employee count
|
|
24
|
-
description: Average employee_count per company.
|
|
25
|
-
type: atomic
|
|
26
|
-
sql: |-
|
|
27
|
-
SELECT AVG(employee_count) as avg_employee_count
|
|
28
|
-
FROM companies
|
|
29
|
-
aggregation: avg
|
|
30
|
-
- id: total_founded_year
|
|
31
|
-
label: Total founded year
|
|
32
|
-
description: Sum of founded_year across all companies.
|
|
33
|
-
type: atomic
|
|
34
|
-
source:
|
|
35
|
-
entity: Companies
|
|
36
|
-
measure: total_founded_year
|
|
37
|
-
sql: |-
|
|
38
|
-
SELECT SUM(founded_year) as total_founded_year
|
|
39
|
-
FROM companies
|
|
40
|
-
aggregation: sum
|
|
41
|
-
objective: maximize
|
|
42
|
-
- id: avg_founded_year
|
|
43
|
-
label: Average founded year
|
|
44
|
-
description: Average founded_year per company.
|
|
45
|
-
type: atomic
|
|
46
|
-
sql: |-
|
|
47
|
-
SELECT AVG(founded_year) as avg_founded_year
|
|
48
|
-
FROM companies
|
|
49
|
-
aggregation: avg
|
|
50
|
-
- id: total_revenue
|
|
51
|
-
label: Total revenue
|
|
52
|
-
description: Sum of revenue across all companies.
|
|
53
|
-
type: atomic
|
|
54
|
-
source:
|
|
55
|
-
entity: Companies
|
|
56
|
-
measure: total_revenue
|
|
57
|
-
sql: |-
|
|
58
|
-
SELECT SUM(revenue) as total_revenue
|
|
59
|
-
FROM companies
|
|
60
|
-
aggregation: sum
|
|
61
|
-
objective: maximize
|
|
62
|
-
- id: avg_revenue
|
|
63
|
-
label: Average revenue
|
|
64
|
-
description: Average revenue per company.
|
|
65
|
-
type: atomic
|
|
66
|
-
sql: |-
|
|
67
|
-
SELECT AVG(revenue) as avg_revenue
|
|
68
|
-
FROM companies
|
|
69
|
-
aggregation: avg
|
|
70
|
-
- id: total_valuation
|
|
71
|
-
label: Total valuation
|
|
72
|
-
description: Sum of valuation across all companies.
|
|
73
|
-
type: atomic
|
|
74
|
-
source:
|
|
75
|
-
entity: Companies
|
|
76
|
-
measure: total_valuation
|
|
77
|
-
sql: |-
|
|
78
|
-
SELECT SUM(valuation) as total_valuation
|
|
79
|
-
FROM companies
|
|
80
|
-
aggregation: sum
|
|
81
|
-
objective: maximize
|
|
82
|
-
- id: avg_valuation
|
|
83
|
-
label: Average valuation
|
|
84
|
-
description: Average valuation per company.
|
|
85
|
-
type: atomic
|
|
86
|
-
sql: |-
|
|
87
|
-
SELECT AVG(valuation) as avg_valuation
|
|
20
|
+
SELECT AVG(revenue) AS avg_customer_revenue
|
|
88
21
|
FROM companies
|
|
89
22
|
aggregation: avg
|
|
23
|
+
|
|
24
|
+
- id: customers_by_industry
|
|
25
|
+
label: Customers by Industry
|
|
26
|
+
description: Customer count and average revenue by industry vertical.
|
|
27
|
+
type: breakdown
|
|
28
|
+
sql: |-
|
|
29
|
+
SELECT industry,
|
|
30
|
+
COUNT(*) AS customer_count,
|
|
31
|
+
AVG(revenue) AS avg_revenue,
|
|
32
|
+
AVG(employee_count) AS avg_headcount
|
|
33
|
+
FROM companies
|
|
34
|
+
GROUP BY industry
|
|
35
|
+
ORDER BY customer_count DESC
|
|
36
|
+
|
|
37
|
+
- id: customers_by_country
|
|
38
|
+
label: Customers by Country
|
|
39
|
+
description: Customer distribution by HQ country.
|
|
40
|
+
type: breakdown
|
|
41
|
+
sql: |-
|
|
42
|
+
SELECT country,
|
|
43
|
+
COUNT(*) AS customer_count,
|
|
44
|
+
SUM(revenue) AS total_revenue
|
|
45
|
+
FROM companies
|
|
46
|
+
GROUP BY country
|
|
47
|
+
ORDER BY customer_count DESC
|
|
48
|
+
|
|
49
|
+
- id: revenue_per_customer
|
|
50
|
+
label: Revenue per Customer (our MRR)
|
|
51
|
+
description: Total MRR we earn from each customer company.
|
|
52
|
+
type: derived
|
|
53
|
+
unit: USD
|
|
54
|
+
sql: |-
|
|
55
|
+
SELECT c.name AS company,
|
|
56
|
+
c.industry,
|
|
57
|
+
SUM(a.monthly_value) AS total_mrr,
|
|
58
|
+
COUNT(a.id) AS account_count
|
|
59
|
+
FROM companies c
|
|
60
|
+
JOIN accounts a ON a.company_id = c.id
|
|
61
|
+
WHERE a.status = 'Active'
|
|
62
|
+
GROUP BY c.name, c.industry
|
|
63
|
+
ORDER BY total_mrr DESC
|
|
@@ -4,7 +4,7 @@ Atlas provides two example deployment topologies plus a static landing page. Dep
|
|
|
4
4
|
|
|
5
5
|
| Example | What's included | Use when |
|
|
6
6
|
|---------|----------------|----------|
|
|
7
|
-
| [`examples/docker/`](../examples/docker/) | Hono API + Docker + optional nsjail | Self-hosted deployment (Railway,
|
|
7
|
+
| [`examples/docker/`](../examples/docker/) | Hono API + Docker + optional nsjail | Self-hosted deployment (Railway, Docker Compose) |
|
|
8
8
|
| [`examples/nextjs-standalone/`](../examples/nextjs-standalone/) | Next.js + embedded Hono API | You want to deploy to Vercel with zero infrastructure |
|
|
9
9
|
| [`apps/www/`](../apps/www/) | Static landing page (Next.js export + Bun server) | Marketing site at useatlas.dev |
|
|
10
10
|
|
|
@@ -28,7 +28,7 @@ Go from zero to production with managed Postgres included.
|
|
|
28
28
|
1. **Scaffold your project:**
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
bun create
|
|
31
|
+
bun create @useatlas my-app
|
|
32
32
|
cd my-app
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -134,7 +134,7 @@ Atlas runs agent-generated commands (filesystem exploration, future code executi
|
|
|
134
134
|
|------|---------|-----------|-----------------|
|
|
135
135
|
| 1 | Vercel Sandbox | Vercel | Firecracker microVM (hardware-level). No network, ephemeral filesystem |
|
|
136
136
|
| 2 | nsjail | Self-hosted Docker/VM | Linux namespaces. No network, read-only mount, separate PID/user space |
|
|
137
|
-
| 3 | Sidecar service | Railway
|
|
137
|
+
| 3 | Sidecar service | Railway | Separate container with no secrets. Process-level isolation via private networking |
|
|
138
138
|
| 4 | just-bash | Everywhere (fallback) | In-memory OverlayFS + path-traversal protection. No process isolation |
|
|
139
139
|
|
|
140
140
|
### What's right for you?
|
|
@@ -260,43 +260,6 @@ Railway exposes a public URL. Check health at `https://<your-app>.up.railway.app
|
|
|
260
260
|
|
|
261
261
|
---
|
|
262
262
|
|
|
263
|
-
## Render
|
|
264
|
-
|
|
265
|
-
Atlas includes a `render.yaml` Blueprint in `examples/docker/`.
|
|
266
|
-
|
|
267
|
-
### Steps
|
|
268
|
-
|
|
269
|
-
1. Go to the [Render Dashboard](https://dashboard.render.com/) and click **New > Blueprint**
|
|
270
|
-
2. Connect your GitHub repo -- Render reads `examples/docker/render.yaml`
|
|
271
|
-
3. Set the prompted environment variables:
|
|
272
|
-
- `ATLAS_DATASOURCE_URL` -- your analytics database connection string
|
|
273
|
-
- `ANTHROPIC_API_KEY` -- your API key
|
|
274
|
-
4. Deploy
|
|
275
|
-
|
|
276
|
-
### Using Render Postgres
|
|
277
|
-
|
|
278
|
-
1. Create a Render Postgres instance from the dashboard
|
|
279
|
-
2. Copy the **Internal Connection String**
|
|
280
|
-
3. Set it as `DATABASE_URL` (Atlas internal) and create a separate database for `ATLAS_DATASOURCE_URL` (analytics)
|
|
281
|
-
|
|
282
|
-
### Configuration
|
|
283
|
-
|
|
284
|
-
The `examples/docker/render.yaml` configures:
|
|
285
|
-
|
|
286
|
-
- Docker-based deployment using the example's Dockerfile
|
|
287
|
-
- Health check at `/api/health`
|
|
288
|
-
- Starter plan
|
|
289
|
-
- `ATLAS_PROVIDER` defaults to `anthropic`
|
|
290
|
-
- `autoDeploy` is disabled -- trigger deploys manually from the Render dashboard, or set `autoDeploy: true` in `render.yaml` to deploy on every push
|
|
291
|
-
|
|
292
|
-
### Verify
|
|
293
|
-
|
|
294
|
-
```bash
|
|
295
|
-
curl https://<your-app>.onrender.com/api/health
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
---
|
|
299
|
-
|
|
300
263
|
## Vercel
|
|
301
264
|
|
|
302
265
|
Atlas provides a Next.js standalone example that embeds the Hono API via a catch-all route — deploy to Vercel with zero infrastructure. The explore tool automatically uses Vercel Sandbox (Firecracker VM isolation) when running on Vercel.
|
|
@@ -304,7 +267,7 @@ Atlas provides a Next.js standalone example that embeds the Hono API via a catch
|
|
|
304
267
|
### Scaffold a new project
|
|
305
268
|
|
|
306
269
|
```bash
|
|
307
|
-
bun create
|
|
270
|
+
bun create @useatlas my-app --platform vercel
|
|
308
271
|
cd my-app
|
|
309
272
|
```
|
|
310
273
|
|