@cloudgrid-io/mcp 0.13.0 → 0.15.0
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/package.json +1 -1
- package/src/corpus/capability-map.md +81 -7
- package/src/corpus/templates/_cloudgrid.yaml.reference +228 -0
- package/src/corpus/templates/admin-dashboard/cloudgrid.yaml +226 -8
- package/src/corpus/templates/admin-dashboard/index.md +3 -0
- package/src/corpus/templates/ai-app/cloudgrid.yaml +225 -11
- package/src/corpus/templates/ai-app/index.md +3 -11
- package/src/corpus/templates/ai-knowledge-base/AGENTS.md +254 -0
- package/src/corpus/templates/ai-knowledge-base/README.md +28 -0
- package/src/corpus/templates/ai-knowledge-base/cloudgrid.yaml +238 -0
- package/src/corpus/templates/ai-knowledge-base/index.md +81 -0
- package/src/corpus/templates/analytics-dashboard/README.md +85 -0
- package/src/corpus/templates/analytics-dashboard/cloudgrid.yaml +232 -0
- package/src/corpus/templates/analytics-dashboard/index.md +316 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/api/events/route.js +60 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/event-form.js +100 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/layout.js +41 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/page.js +54 -0
- package/src/corpus/templates/analytics-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/analytics-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/api-dashboard/README.md +84 -0
- package/src/corpus/templates/api-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/api-dashboard/index.md +310 -0
- package/src/corpus/templates/api-dashboard/services/web/app/api/requests/route.js +62 -0
- package/src/corpus/templates/api-dashboard/services/web/app/dashboard.js +156 -0
- package/src/corpus/templates/api-dashboard/services/web/app/layout.js +42 -0
- package/src/corpus/templates/api-dashboard/services/web/app/page.js +39 -0
- package/src/corpus/templates/api-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/api-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/api-docs/cloudgrid.yaml +222 -4
- package/src/corpus/templates/api-docs/index.md +3 -5
- package/src/corpus/templates/api-service/cloudgrid.yaml +224 -9
- package/src/corpus/templates/api-service/index.md +3 -11
- package/src/corpus/templates/app-with-data/cloudgrid.yaml +226 -8
- package/src/corpus/templates/app-with-data/index.md +3 -8
- package/src/corpus/templates/appointment-booking/AGENTS.md +223 -0
- package/src/corpus/templates/appointment-booking/README.md +16 -0
- package/src/corpus/templates/appointment-booking/cloudgrid.yaml +250 -0
- package/src/corpus/templates/appointment-booking/index.md +72 -0
- package/src/corpus/templates/approval-workflow/AGENTS.md +170 -0
- package/src/corpus/templates/approval-workflow/README.md +12 -0
- package/src/corpus/templates/approval-workflow/cloudgrid.yaml +237 -0
- package/src/corpus/templates/approval-workflow/index.md +58 -0
- package/src/corpus/templates/billing-dashboard/AGENTS.md +199 -0
- package/src/corpus/templates/billing-dashboard/README.md +18 -0
- package/src/corpus/templates/billing-dashboard/cloudgrid.yaml +235 -0
- package/src/corpus/templates/billing-dashboard/index.md +87 -0
- package/src/corpus/templates/blog-cms/README.md +94 -0
- package/src/corpus/templates/blog-cms/cloudgrid.yaml +233 -0
- package/src/corpus/templates/blog-cms/index.md +358 -0
- package/src/corpus/templates/blog-cms/services/web/app/admin/admin-editor.js +133 -0
- package/src/corpus/templates/blog-cms/services/web/app/admin/page.js +33 -0
- package/src/corpus/templates/blog-cms/services/web/app/api/posts/route.js +84 -0
- package/src/corpus/templates/blog-cms/services/web/app/layout.js +47 -0
- package/src/corpus/templates/blog-cms/services/web/app/page.js +56 -0
- package/src/corpus/templates/blog-cms/services/web/app/posts/[slug]/page.js +45 -0
- package/src/corpus/templates/blog-cms/services/web/lib/db.js +32 -0
- package/src/corpus/templates/blog-cms/services/web/package.json +16 -0
- package/src/corpus/templates/booking-system/AGENTS.md +189 -0
- package/src/corpus/templates/booking-system/README.md +17 -0
- package/src/corpus/templates/booking-system/cloudgrid.yaml +248 -0
- package/src/corpus/templates/booking-system/index.md +86 -0
- package/src/corpus/templates/calendar-scheduler/AGENTS.md +226 -0
- package/src/corpus/templates/calendar-scheduler/README.md +25 -0
- package/src/corpus/templates/calendar-scheduler/cloudgrid.yaml +259 -0
- package/src/corpus/templates/calendar-scheduler/index.md +85 -0
- package/src/corpus/templates/changelog/cloudgrid.yaml +222 -4
- package/src/corpus/templates/changelog/index.md +3 -5
- package/src/corpus/templates/company-website/README.md +54 -0
- package/src/corpus/templates/company-website/cloudgrid.yaml +233 -0
- package/src/corpus/templates/company-website/index.html +309 -0
- package/src/corpus/templates/company-website/index.md +29 -0
- package/src/corpus/templates/course-platform/AGENTS.md +161 -0
- package/src/corpus/templates/course-platform/README.md +26 -0
- package/src/corpus/templates/course-platform/cloudgrid.yaml +237 -0
- package/src/corpus/templates/course-platform/index.md +70 -0
- package/src/corpus/templates/crm/cloudgrid.yaml +226 -8
- package/src/corpus/templates/crm/index.md +3 -0
- package/src/corpus/templates/dashboard/cloudgrid.yaml +228 -4
- package/src/corpus/templates/dashboard/index.md +3 -5
- package/src/corpus/templates/deck/cloudgrid.yaml +228 -4
- package/src/corpus/templates/deck/index.md +3 -5
- package/src/corpus/templates/directory/README.md +75 -0
- package/src/corpus/templates/directory/cloudgrid.yaml +233 -0
- package/src/corpus/templates/directory/index.md +334 -0
- package/src/corpus/templates/directory/services/web/app/api/entries/route.js +63 -0
- package/src/corpus/templates/directory/services/web/app/directory-list.js +146 -0
- package/src/corpus/templates/directory/services/web/app/layout.js +44 -0
- package/src/corpus/templates/directory/services/web/app/page.js +38 -0
- package/src/corpus/templates/directory/services/web/lib/db.js +32 -0
- package/src/corpus/templates/directory/services/web/package.json +16 -0
- package/src/corpus/templates/docs-site/cloudgrid.yaml +222 -4
- package/src/corpus/templates/docs-site/index.md +3 -5
- package/src/corpus/templates/erp/AGENTS.md +116 -0
- package/src/corpus/templates/erp/README.md +17 -0
- package/src/corpus/templates/erp/cloudgrid.yaml +235 -0
- package/src/corpus/templates/erp/index.md +81 -0
- package/src/corpus/templates/event-board/README.md +74 -0
- package/src/corpus/templates/event-board/cloudgrid.yaml +233 -0
- package/src/corpus/templates/event-board/index.md +299 -0
- package/src/corpus/templates/event-board/services/web/app/api/events/route.js +61 -0
- package/src/corpus/templates/event-board/services/web/app/event-form.js +118 -0
- package/src/corpus/templates/event-board/services/web/app/layout.js +39 -0
- package/src/corpus/templates/event-board/services/web/app/page.js +34 -0
- package/src/corpus/templates/event-board/services/web/lib/db.js +32 -0
- package/src/corpus/templates/event-board/services/web/package.json +16 -0
- package/src/corpus/templates/expense-tracker/README.md +76 -0
- package/src/corpus/templates/expense-tracker/cloudgrid.yaml +233 -0
- package/src/corpus/templates/expense-tracker/index.md +305 -0
- package/src/corpus/templates/expense-tracker/services/web/app/api/expenses/route.js +61 -0
- package/src/corpus/templates/expense-tracker/services/web/app/expense-form.js +145 -0
- package/src/corpus/templates/expense-tracker/services/web/app/layout.js +42 -0
- package/src/corpus/templates/expense-tracker/services/web/app/page.js +34 -0
- package/src/corpus/templates/expense-tracker/services/web/lib/db.js +32 -0
- package/src/corpus/templates/expense-tracker/services/web/package.json +16 -0
- package/src/corpus/templates/feature-request-board/README.md +87 -0
- package/src/corpus/templates/feature-request-board/cloudgrid.yaml +233 -0
- package/src/corpus/templates/feature-request-board/index.md +317 -0
- package/src/corpus/templates/feature-request-board/services/web/app/api/requests/route.js +92 -0
- package/src/corpus/templates/feature-request-board/services/web/app/board.js +91 -0
- package/src/corpus/templates/feature-request-board/services/web/app/layout.js +43 -0
- package/src/corpus/templates/feature-request-board/services/web/app/page.js +35 -0
- package/src/corpus/templates/feature-request-board/services/web/lib/db.js +32 -0
- package/src/corpus/templates/feature-request-board/services/web/package.json +16 -0
- package/src/corpus/templates/financial-dashboard/README.md +80 -0
- package/src/corpus/templates/financial-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/financial-dashboard/index.md +326 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/api/entries/route.js +63 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/entry-board.js +130 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/layout.js +46 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/page.js +31 -0
- package/src/corpus/templates/financial-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/financial-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/forum/AGENTS.md +196 -0
- package/src/corpus/templates/forum/README.md +12 -0
- package/src/corpus/templates/forum/cloudgrid.yaml +237 -0
- package/src/corpus/templates/forum/index.md +66 -0
- package/src/corpus/templates/hr-portal/AGENTS.md +174 -0
- package/src/corpus/templates/hr-portal/README.md +14 -0
- package/src/corpus/templates/hr-portal/cloudgrid.yaml +237 -0
- package/src/corpus/templates/hr-portal/index.md +56 -0
- package/src/corpus/templates/internal-tools-portal/AGENTS.md +201 -0
- package/src/corpus/templates/internal-tools-portal/README.md +17 -0
- package/src/corpus/templates/internal-tools-portal/cloudgrid.yaml +237 -0
- package/src/corpus/templates/internal-tools-portal/index.md +62 -0
- package/src/corpus/templates/inventory/README.md +71 -0
- package/src/corpus/templates/inventory/cloudgrid.yaml +233 -0
- package/src/corpus/templates/inventory/index.md +68 -0
- package/src/corpus/templates/inventory/services/web/app/api/items/route.js +88 -0
- package/src/corpus/templates/inventory/services/web/app/inventory-manager.js +101 -0
- package/src/corpus/templates/inventory/services/web/app/layout.js +36 -0
- package/src/corpus/templates/inventory/services/web/app/page.js +37 -0
- package/src/corpus/templates/inventory/services/web/lib/db.js +32 -0
- package/src/corpus/templates/inventory/services/web/package.json +16 -0
- package/src/corpus/templates/invoice/README.md +71 -0
- package/src/corpus/templates/invoice/cloudgrid.yaml +233 -0
- package/src/corpus/templates/invoice/index.md +68 -0
- package/src/corpus/templates/invoice/services/web/app/api/invoices/route.js +82 -0
- package/src/corpus/templates/invoice/services/web/app/invoice-manager.js +101 -0
- package/src/corpus/templates/invoice/services/web/app/layout.js +35 -0
- package/src/corpus/templates/invoice/services/web/app/page.js +34 -0
- package/src/corpus/templates/invoice/services/web/lib/db.js +32 -0
- package/src/corpus/templates/invoice/services/web/package.json +16 -0
- package/src/corpus/templates/job-board/README.md +71 -0
- package/src/corpus/templates/job-board/cloudgrid.yaml +233 -0
- package/src/corpus/templates/job-board/index.md +68 -0
- package/src/corpus/templates/job-board/services/web/app/api/jobs/route.js +66 -0
- package/src/corpus/templates/job-board/services/web/app/job-board.js +73 -0
- package/src/corpus/templates/job-board/services/web/app/layout.js +35 -0
- package/src/corpus/templates/job-board/services/web/app/page.js +32 -0
- package/src/corpus/templates/job-board/services/web/lib/db.js +32 -0
- package/src/corpus/templates/job-board/services/web/package.json +16 -0
- package/src/corpus/templates/kanban/cloudgrid.yaml +226 -8
- package/src/corpus/templates/kanban/index.md +3 -0
- package/src/corpus/templates/landing-page/cloudgrid.yaml +228 -4
- package/src/corpus/templates/landing-page/index.md +3 -5
- package/src/corpus/templates/lms/AGENTS.md +193 -0
- package/src/corpus/templates/lms/README.md +27 -0
- package/src/corpus/templates/lms/cloudgrid.yaml +237 -0
- package/src/corpus/templates/lms/index.md +79 -0
- package/src/corpus/templates/marketplace/AGENTS.md +208 -0
- package/src/corpus/templates/marketplace/README.md +22 -0
- package/src/corpus/templates/marketplace/cloudgrid.yaml +233 -0
- package/src/corpus/templates/marketplace/index.md +76 -0
- package/src/corpus/templates/membership-site/AGENTS.md +160 -0
- package/src/corpus/templates/membership-site/README.md +18 -0
- package/src/corpus/templates/membership-site/cloudgrid.yaml +236 -0
- package/src/corpus/templates/membership-site/index.md +66 -0
- package/src/corpus/templates/monitoring-dashboard/README.md +84 -0
- package/src/corpus/templates/monitoring-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/monitoring-dashboard/index.md +328 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/api/checks/route.js +76 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/check-form.js +124 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/layout.js +44 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/page.js +49 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/online-store/AGENTS.md +153 -0
- package/src/corpus/templates/online-store/README.md +16 -0
- package/src/corpus/templates/online-store/cloudgrid.yaml +234 -0
- package/src/corpus/templates/online-store/index.md +81 -0
- package/src/corpus/templates/portfolio/cloudgrid.yaml +222 -4
- package/src/corpus/templates/portfolio/index.md +3 -5
- package/src/corpus/templates/product-catalog/README.md +74 -0
- package/src/corpus/templates/product-catalog/cloudgrid.yaml +232 -0
- package/src/corpus/templates/product-catalog/index.md +330 -0
- package/src/corpus/templates/product-catalog/services/web/app/api/products/route.js +69 -0
- package/src/corpus/templates/product-catalog/services/web/app/catalog.js +153 -0
- package/src/corpus/templates/product-catalog/services/web/app/layout.js +49 -0
- package/src/corpus/templates/product-catalog/services/web/app/page.js +36 -0
- package/src/corpus/templates/product-catalog/services/web/lib/db.js +32 -0
- package/src/corpus/templates/product-catalog/services/web/package.json +16 -0
- package/src/corpus/templates/product-launch/README.md +46 -0
- package/src/corpus/templates/product-launch/cloudgrid.yaml +234 -0
- package/src/corpus/templates/product-launch/index.html +320 -0
- package/src/corpus/templates/product-launch/index.md +34 -0
- package/src/corpus/templates/project-management/README.md +83 -0
- package/src/corpus/templates/project-management/cloudgrid.yaml +233 -0
- package/src/corpus/templates/project-management/index.md +346 -0
- package/src/corpus/templates/project-management/services/web/app/api/projects/route.js +48 -0
- package/src/corpus/templates/project-management/services/web/app/api/tasks/route.js +85 -0
- package/src/corpus/templates/project-management/services/web/app/board.js +182 -0
- package/src/corpus/templates/project-management/services/web/app/layout.js +45 -0
- package/src/corpus/templates/project-management/services/web/app/page.js +49 -0
- package/src/corpus/templates/project-management/services/web/lib/db.js +32 -0
- package/src/corpus/templates/project-management/services/web/package.json +16 -0
- package/src/corpus/templates/property-listings/README.md +76 -0
- package/src/corpus/templates/property-listings/cloudgrid.yaml +233 -0
- package/src/corpus/templates/property-listings/index.md +335 -0
- package/src/corpus/templates/property-listings/services/web/app/api/properties/route.js +73 -0
- package/src/corpus/templates/property-listings/services/web/app/layout.js +45 -0
- package/src/corpus/templates/property-listings/services/web/app/listings.js +152 -0
- package/src/corpus/templates/property-listings/services/web/app/page.js +53 -0
- package/src/corpus/templates/property-listings/services/web/lib/db.js +32 -0
- package/src/corpus/templates/property-listings/services/web/package.json +16 -0
- package/src/corpus/templates/quiz-platform/README.md +84 -0
- package/src/corpus/templates/quiz-platform/cloudgrid.yaml +233 -0
- package/src/corpus/templates/quiz-platform/index.md +313 -0
- package/src/corpus/templates/quiz-platform/services/web/app/api/questions/route.js +69 -0
- package/src/corpus/templates/quiz-platform/services/web/app/layout.js +47 -0
- package/src/corpus/templates/quiz-platform/services/web/app/page.js +37 -0
- package/src/corpus/templates/quiz-platform/services/web/app/quiz.js +188 -0
- package/src/corpus/templates/quiz-platform/services/web/lib/db.js +32 -0
- package/src/corpus/templates/quiz-platform/services/web/package.json +16 -0
- package/src/corpus/templates/report/cloudgrid.yaml +228 -4
- package/src/corpus/templates/report/index.md +3 -5
- package/src/corpus/templates/restaurant-reservations/AGENTS.md +258 -0
- package/src/corpus/templates/restaurant-reservations/README.md +17 -0
- package/src/corpus/templates/restaurant-reservations/cloudgrid.yaml +258 -0
- package/src/corpus/templates/restaurant-reservations/index.md +62 -0
- package/src/corpus/templates/revenue-dashboard/README.md +75 -0
- package/src/corpus/templates/revenue-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/revenue-dashboard/index.md +307 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/api/sales/route.js +60 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/layout.js +40 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/page.js +87 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/sale-form.js +63 -0
- package/src/corpus/templates/revenue-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/revenue-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/saas-marketing/cloudgrid.yaml +222 -4
- package/src/corpus/templates/saas-marketing/index.md +3 -5
- package/src/corpus/templates/semantic-search/AGENTS.md +192 -0
- package/src/corpus/templates/semantic-search/README.md +74 -0
- package/src/corpus/templates/semantic-search/cloudgrid.yaml +217 -0
- package/src/corpus/templates/semantic-search/index.md +97 -0
- package/src/corpus/templates/semantic-search/services/backend/requirements.txt +7 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/__init__.py +0 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/answer.py +90 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/auth.py +65 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/config.py +110 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/db.py +89 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/embeddings.py +44 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/indexing.py +222 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/main.py +259 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/search.py +222 -0
- package/src/corpus/templates/semantic-search/services/backend/src/app/source.py +259 -0
- package/src/corpus/templates/semantic-search/services/backend/src/main.py +12 -0
- package/src/corpus/templates/semantic-search/services/web/index.html +12 -0
- package/src/corpus/templates/semantic-search/services/web/package-lock.json +1680 -0
- package/src/corpus/templates/semantic-search/services/web/package.json +19 -0
- package/src/corpus/templates/semantic-search/services/web/src/App.jsx +55 -0
- package/src/corpus/templates/semantic-search/services/web/src/api.js +125 -0
- package/src/corpus/templates/semantic-search/services/web/src/components/Dashboard.jsx +61 -0
- package/src/corpus/templates/semantic-search/services/web/src/components/ManagerLogin.jsx +39 -0
- package/src/corpus/templates/semantic-search/services/web/src/components/SearchView.jsx +166 -0
- package/src/corpus/templates/semantic-search/services/web/src/components/Settings.jsx +148 -0
- package/src/corpus/templates/semantic-search/services/web/src/main.jsx +10 -0
- package/src/corpus/templates/semantic-search/services/web/src/styles.css +78 -0
- package/src/corpus/templates/semantic-search/services/web/vite.config.js +10 -0
- package/src/corpus/templates/status-page/cloudgrid.yaml +222 -4
- package/src/corpus/templates/status-page/index.md +3 -5
- package/src/corpus/templates/subscription-management/AGENTS.md +191 -0
- package/src/corpus/templates/subscription-management/README.md +21 -0
- package/src/corpus/templates/subscription-management/cloudgrid.yaml +236 -0
- package/src/corpus/templates/subscription-management/index.md +73 -0
- package/src/corpus/templates/task-manager/cloudgrid.yaml +226 -8
- package/src/corpus/templates/task-manager/index.md +3 -0
- package/src/corpus/templates/ticket-system/README.md +71 -0
- package/src/corpus/templates/ticket-system/cloudgrid.yaml +233 -0
- package/src/corpus/templates/ticket-system/index.md +68 -0
- package/src/corpus/templates/ticket-system/services/web/app/api/tickets/route.js +81 -0
- package/src/corpus/templates/ticket-system/services/web/app/layout.js +36 -0
- package/src/corpus/templates/ticket-system/services/web/app/page.js +35 -0
- package/src/corpus/templates/ticket-system/services/web/app/ticket-queue.js +112 -0
- package/src/corpus/templates/ticket-system/services/web/lib/db.js +32 -0
- package/src/corpus/templates/ticket-system/services/web/package.json +16 -0
- package/src/corpus/templates/time-tracking/README.md +81 -0
- package/src/corpus/templates/time-tracking/cloudgrid.yaml +233 -0
- package/src/corpus/templates/time-tracking/index.md +298 -0
- package/src/corpus/templates/time-tracking/services/web/app/api/entries/route.js +66 -0
- package/src/corpus/templates/time-tracking/services/web/app/entry-form.js +106 -0
- package/src/corpus/templates/time-tracking/services/web/app/layout.js +39 -0
- package/src/corpus/templates/time-tracking/services/web/app/page.js +30 -0
- package/src/corpus/templates/time-tracking/services/web/lib/db.js +32 -0
- package/src/corpus/templates/time-tracking/services/web/package.json +16 -0
- package/src/corpus/templates/travel-booking/AGENTS.md +207 -0
- package/src/corpus/templates/travel-booking/README.md +17 -0
- package/src/corpus/templates/travel-booking/cloudgrid.yaml +249 -0
- package/src/corpus/templates/travel-booking/index.md +88 -0
- package/src/corpus/templates/waitlist/cloudgrid.yaml +222 -4
- package/src/corpus/templates/waitlist/index.md +3 -5
- package/src/corpus/templates/web-app/cloudgrid.yaml +228 -4
- package/src/corpus/templates/web-app/index.md +3 -5
- package/src/corpus/workflows/ai-knowledge-base.md +137 -0
- package/src/corpus/workflows/analytics-dashboard.md +104 -0
- package/src/corpus/workflows/api-dashboard.md +102 -0
- package/src/corpus/workflows/appointment-booking.md +143 -0
- package/src/corpus/workflows/approval-workflow.md +124 -0
- package/src/corpus/workflows/billing-dashboard.md +120 -0
- package/src/corpus/workflows/blog-cms.md +104 -0
- package/src/corpus/workflows/booking-system.md +116 -0
- package/src/corpus/workflows/calendar-scheduler.md +134 -0
- package/src/corpus/workflows/company-website.md +46 -0
- package/src/corpus/workflows/course-platform.md +126 -0
- package/src/corpus/workflows/directory.md +101 -0
- package/src/corpus/workflows/erp.md +125 -0
- package/src/corpus/workflows/event-board.md +102 -0
- package/src/corpus/workflows/expense-tracker.md +102 -0
- package/src/corpus/workflows/feature-request-board.md +105 -0
- package/src/corpus/workflows/financial-dashboard.md +103 -0
- package/src/corpus/workflows/forum.md +128 -0
- package/src/corpus/workflows/hr-portal.md +115 -0
- package/src/corpus/workflows/internal-tools-portal.md +125 -0
- package/src/corpus/workflows/inventory.md +101 -0
- package/src/corpus/workflows/invoice.md +101 -0
- package/src/corpus/workflows/job-board.md +101 -0
- package/src/corpus/workflows/lms.md +113 -0
- package/src/corpus/workflows/marketplace.md +123 -0
- package/src/corpus/workflows/membership-site.md +128 -0
- package/src/corpus/workflows/monitoring-dashboard.md +104 -0
- package/src/corpus/workflows/online-store.md +114 -0
- package/src/corpus/workflows/product-catalog.md +105 -0
- package/src/corpus/workflows/product-launch.md +43 -0
- package/src/corpus/workflows/project-management.md +106 -0
- package/src/corpus/workflows/property-listings.md +101 -0
- package/src/corpus/workflows/quiz-platform.md +105 -0
- package/src/corpus/workflows/restaurant-reservations.md +123 -0
- package/src/corpus/workflows/revenue-dashboard.md +102 -0
- package/src/corpus/workflows/semantic-search.md +133 -0
- package/src/corpus/workflows/subscription-management.md +141 -0
- package/src/corpus/workflows/ticket-system.md +101 -0
- package/src/corpus/workflows/time-tracking.md +104 -0
- package/src/corpus/workflows/travel-booking.md +115 -0
- package/src/tools.js +73 -12
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# forum — structure guide (BLUEPRINT)
|
|
2
|
+
|
|
3
|
+
This is a **blueprint**, not runnable app code. It gives you the exact structure
|
|
4
|
+
to build a threaded community forum on CloudGrid: a Next.js app under
|
|
5
|
+
`services/web/`, backed by grid-shared MongoDB, with sign-in-to-post auth via a
|
|
6
|
+
hosted provider (Clerk / Auth0) whose keys come from the org vault. Build the app
|
|
7
|
+
by following this guide; the shape mirrors the proven `app-with-data` template
|
|
8
|
+
(lazy Mongo getter, App-Router API routes, `needs: { database: true }`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. File tree
|
|
13
|
+
|
|
14
|
+
Build exactly this layout. **App code MUST live under `services/web/`** — the
|
|
15
|
+
service is named `web`, so the CLI looks for `services/web/`. `path: /` in
|
|
16
|
+
`cloudgrid.yaml` is the URL mount, NOT the filesystem path. Files at the repo
|
|
17
|
+
root fail with `Error: Service directory not found: …/services/web`.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
cloudgrid.yaml # name + services.web (nextjs) + needs:{database:true} + vault: (auth keys)
|
|
21
|
+
services/web/package.json # next, react, react-dom, mongodb, + auth provider SDK (e.g. @clerk/nextjs)
|
|
22
|
+
services/web/middleware.js # auth provider middleware — protects write routes, exposes read routes
|
|
23
|
+
services/web/lib/db.js # lazy Mongo client from DATABASE_MONGODB_URL (legacy MONGODB_URL fallback)
|
|
24
|
+
services/web/lib/auth.js # helper: resolve current user (id + display name) from the provider session
|
|
25
|
+
services/web/app/layout.js # root layout: wraps children in the provider <ClerkProvider>/<Auth0Provider>, sign-in button
|
|
26
|
+
services/web/app/page.js # server component: lists threads (newest / most-active)
|
|
27
|
+
services/web/app/thread/[id]/page.js # server component: one thread + its nested reply tree
|
|
28
|
+
services/web/app/thread/[id]/reply-form.js # client component: post a reply (sign-in gated)
|
|
29
|
+
services/web/app/new-thread.js # client component: create a thread (sign-in gated)
|
|
30
|
+
services/web/app/api/threads/route.js # GET list threads / POST create thread (auth required to POST)
|
|
31
|
+
services/web/app/api/threads/[id]/route.js # GET one thread / DELETE (author or moderator only)
|
|
32
|
+
services/web/app/api/posts/route.js # GET posts for a thread / POST a reply (auth required, supports parentId for nesting)
|
|
33
|
+
services/web/app/api/posts/[id]/route.js # DELETE / PATCH a post — moderation (author or moderator)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Keep the UI minimal (inline CSS in `layout.js`, same as `app-with-data`). The
|
|
37
|
+
domain, not styling, is what this blueprint is about.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 2. MongoDB collections + fields
|
|
42
|
+
|
|
43
|
+
The grid provisions MongoDB from `needs: { database: true }`. Model three
|
|
44
|
+
collections. Store the provider's user id as `authorId` on every authored
|
|
45
|
+
document — do not copy PII beyond a display name.
|
|
46
|
+
|
|
47
|
+
**`users`** — a thin local mirror of the auth-provider identity (upserted on
|
|
48
|
+
first post; the provider remains the source of truth for auth).
|
|
49
|
+
| field | type | notes |
|
|
50
|
+
|---------------|----------|----------------------------------------------------|
|
|
51
|
+
| `_id` | ObjectId | Mongo id |
|
|
52
|
+
| `authorId` | string | provider user id (Clerk/Auth0 `sub`), **unique** |
|
|
53
|
+
| `displayName` | string | shown next to posts |
|
|
54
|
+
| `role` | string | `member` (default) or `moderator` |
|
|
55
|
+
| `createdAt` | Date | |
|
|
56
|
+
|
|
57
|
+
**`threads`** — one row per discussion topic.
|
|
58
|
+
| field | type | notes |
|
|
59
|
+
|---------------|----------|----------------------------------------------------|
|
|
60
|
+
| `_id` | ObjectId | thread id (used in `/thread/[id]`) |
|
|
61
|
+
| `title` | string | required, trimmed |
|
|
62
|
+
| `authorId` | string | provider user id of the creator |
|
|
63
|
+
| `authorName` | string | denormalized display name |
|
|
64
|
+
| `replyCount` | number | denormalized, bumped on each reply |
|
|
65
|
+
| `createdAt` | Date | sort key for "newest" |
|
|
66
|
+
| `lastPostAt` | Date | sort key for "most-active" |
|
|
67
|
+
|
|
68
|
+
**`posts`** — every reply. Nesting is by `parentId` (self-referential adjacency
|
|
69
|
+
list); the top-level post of a thread has `parentId: null`.
|
|
70
|
+
| field | type | notes |
|
|
71
|
+
|---------------|-----------------|---------------------------------------------|
|
|
72
|
+
| `_id` | ObjectId | post id |
|
|
73
|
+
| `threadId` | ObjectId | which thread this belongs to (indexed) |
|
|
74
|
+
| `parentId` | ObjectId / null | reply target; `null` = direct thread reply |
|
|
75
|
+
| `authorId` | string | provider user id |
|
|
76
|
+
| `authorName` | string | denormalized display name |
|
|
77
|
+
| `body` | string | required, trimmed |
|
|
78
|
+
| `deleted` | boolean | soft-delete for moderation (keeps tree) |
|
|
79
|
+
| `createdAt` | Date | sort within a nesting level |
|
|
80
|
+
|
|
81
|
+
Recommended indexes: `posts.threadId`, `posts.parentId`, unique
|
|
82
|
+
`users.authorId`, `threads.lastPostAt`.
|
|
83
|
+
|
|
84
|
+
**Render nested replies** by fetching all posts for a thread (`{ threadId }`),
|
|
85
|
+
then building the tree in memory from `parentId` — one query, arbitrary depth.
|
|
86
|
+
For a soft-deleted post keep the node so its children stay reachable; render its
|
|
87
|
+
body as "[removed]".
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 3. How CloudGrid injects things
|
|
92
|
+
|
|
93
|
+
You never provision infra or set connection strings by hand. Declared needs and
|
|
94
|
+
vault mappings become environment variables at **both** `next build` / `grid
|
|
95
|
+
dev` and runtime.
|
|
96
|
+
|
|
97
|
+
- **Database (`needs: { database: true }`)** → the grid provisions MongoDB and
|
|
98
|
+
injects **`DATABASE_MONGODB_URL`** (plus the legacy **`MONGODB_URL`** alias).
|
|
99
|
+
Read it as `process.env.DATABASE_MONGODB_URL || process.env.MONGODB_URL`
|
|
100
|
+
**lazily, inside the getter in `lib/db.js`** — never at module top level, or
|
|
101
|
+
`next build` throws when it imports the module for route analysis before the
|
|
102
|
+
var exists.
|
|
103
|
+
- **Auth secrets (`vault:` block)** → each `ENV_VAR: vault-item-key` mapping
|
|
104
|
+
injects that vault item as `process.env.ENV_VAR`. This blueprint maps
|
|
105
|
+
`AUTH_PROVIDER_SECRET_KEY` and `AUTH_PROVIDER_PUBLISHABLE_KEY`. Rename the env
|
|
106
|
+
keys to whatever the provider SDK expects (see §4) and set the vault items with
|
|
107
|
+
`gridctl_secrets` / the org vault — do not commit keys.
|
|
108
|
+
- **AI (optional)** — if you add `needs: { ai: true }` (e.g. auto-moderation or
|
|
109
|
+
summarize-thread), the grid injects **`AI_GATEWAY_URL`**; call it via
|
|
110
|
+
`@cloudgrid-io/ai`. Not required for the base forum.
|
|
111
|
+
- **Reserved vars** you must NOT set yourself: `PORT`, `NODE_ENV`,
|
|
112
|
+
`DATABASE_MONGODB_URL`, `MONGODB_URL`, `REDIS_URL`, `AI_GATEWAY_URL`,
|
|
113
|
+
`CLOUDGRID_*`.
|
|
114
|
+
|
|
115
|
+
`lib/db.js` — copy the lazy-getter pattern from `app-with-data`:
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
import { MongoClient } from "mongodb";
|
|
119
|
+
function clientPromise() {
|
|
120
|
+
const uri = process.env.DATABASE_MONGODB_URL || process.env.MONGODB_URL;
|
|
121
|
+
if (!uri) throw new Error("DATABASE_MONGODB_URL not set — run with grid dev or grid plug.");
|
|
122
|
+
if (!globalThis.__mongoClientPromise) globalThis.__mongoClientPromise = new MongoClient(uri).connect();
|
|
123
|
+
return globalThis.__mongoClientPromise;
|
|
124
|
+
}
|
|
125
|
+
export async function getDb() { return (await clientPromise()).db(); }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 4. Wiring auth (sign-in-to-post)
|
|
131
|
+
|
|
132
|
+
Reading threads is public; **posting requires a signed-in member**. Use a hosted
|
|
133
|
+
auth provider so you don't build password handling. Two common choices:
|
|
134
|
+
|
|
135
|
+
- **Clerk** — add `@clerk/nextjs`. The SDK reads `CLERK_SECRET_KEY` and
|
|
136
|
+
`NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`. Map the vault to those exact env names in
|
|
137
|
+
`cloudgrid.yaml` (rename `AUTH_PROVIDER_SECRET_KEY` →
|
|
138
|
+
`CLERK_SECRET_KEY`, `AUTH_PROVIDER_PUBLISHABLE_KEY` →
|
|
139
|
+
`NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`). Wrap `app/layout.js` in
|
|
140
|
+
`<ClerkProvider>`, add `<SignInButton>` / `<UserButton>`, and in
|
|
141
|
+
`middleware.js` protect the write routes.
|
|
142
|
+
- **Auth0** — add `@auth0/nextjs-auth0`; it reads `AUTH0_SECRET`,
|
|
143
|
+
`AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET`, `AUTH0_BASE_URL`, `AUTH0_ISSUER_BASE_URL`.
|
|
144
|
+
Map the vault items to those names.
|
|
145
|
+
|
|
146
|
+
Wiring pattern regardless of provider:
|
|
147
|
+
|
|
148
|
+
1. `middleware.js` — mark `GET /`, `GET /thread/*`, and the read (`GET`) API
|
|
149
|
+
routes as public; require a session for `POST`/`PATCH`/`DELETE`.
|
|
150
|
+
2. `lib/auth.js` — resolve the current user server-side (`auth()` in Clerk,
|
|
151
|
+
`getSession()` in Auth0). Return `{ authorId, displayName }` or `null`.
|
|
152
|
+
3. In each write route: call the auth helper; if `null`, return `401`. On the
|
|
153
|
+
first authored action, **upsert** the user into the `users` collection
|
|
154
|
+
(keyed by `authorId`) so display names + roles are local.
|
|
155
|
+
4. **Moderation** — a `DELETE`/`PATCH` on a post or thread is allowed only when
|
|
156
|
+
the caller's `authorId` matches the document's `authorId` OR the caller's
|
|
157
|
+
`users.role === "moderator"`. Prefer **soft delete** (`deleted: true`) on
|
|
158
|
+
posts so the reply tree stays intact.
|
|
159
|
+
|
|
160
|
+
The `vault:` block is the CloudGrid-correct way to inject these secrets — never
|
|
161
|
+
inline a key in code or `env:`.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 5. Deploy steps
|
|
166
|
+
|
|
167
|
+
A forum is a runtime (built + deployed container) app — **local edition**
|
|
168
|
+
(Claude Desktop / Claude Code / CLI), async build.
|
|
169
|
+
|
|
170
|
+
1. `gridctl_login_status` → `gridctl_login` if needed. Respect the grid picker
|
|
171
|
+
(ask which grid if the user has more than one).
|
|
172
|
+
2. `gridctl_init` an app `<name>` — creates the entity + `.cloudgrid/link.json`
|
|
173
|
+
and a `cloudgrid.yaml` with empty `services: {}`. Run `init` FIRST (`plug`
|
|
174
|
+
needs a linked dir).
|
|
175
|
+
3. Write the app under `services/web/` per §1, then fill `cloudgrid.yaml` to the
|
|
176
|
+
active shape: `name`, `services.web { type: nextjs, path: / }`, `needs:
|
|
177
|
+
{ database: true }`, and the `vault:` mappings for the auth keys.
|
|
178
|
+
4. Set the auth secrets: `gridctl_secrets` (or the org vault) for the provider
|
|
179
|
+
keys. Do NOT set `DATABASE_MONGODB_URL` — the grid injects it.
|
|
180
|
+
5. (Optional) `grid dev` to run locally against injected Mongo before shipping.
|
|
181
|
+
6. `gridctl_plug` to deploy. A runtime deploy is **ASYNC** — the first response
|
|
182
|
+
is `status: building`, not a live URL. Poll `gridctl_status` (or the returned
|
|
183
|
+
poll_url) until live; surface a liveness signal while it builds, never a bare
|
|
184
|
+
spinner.
|
|
185
|
+
7. Only once live, return the deployed app URL. Re-plug the SAME entity to update
|
|
186
|
+
the same URL.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 6. Edition note
|
|
191
|
+
|
|
192
|
+
This blueprint targets a **runtime** deploy, which requires the **local
|
|
193
|
+
edition**. The hosted edition (Claude Web / hosted MCP) is inline-only and can
|
|
194
|
+
only publish static pages — it CANNOT build this containerized Next.js + Mongo +
|
|
195
|
+
auth forum. On hosted, either switch to a local edition or offer a static,
|
|
196
|
+
read-only mock instead and stop the runtime path.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# forum template — threaded community forum (BLUEPRINT)
|
|
2
|
+
|
|
3
|
+
A community discussion board where members sign in to start threads and post
|
|
4
|
+
nested replies, with moderation — a persistent Next.js app under `services/web/`
|
|
5
|
+
backed by grid-shared MongoDB (`threads` / `posts` / `users`), with sign-in-to-post
|
|
6
|
+
auth via a hosted provider (Clerk / Auth0) whose keys come from the org vault.
|
|
7
|
+
This is a **blueprint**: it ships the structure and the `cloudgrid.yaml`, not
|
|
8
|
+
runnable app code — read `AGENTS.md` for the file tree, Mongo schema, CloudGrid
|
|
9
|
+
wiring (DATABASE_MONGODB_URL, vault→env secrets), auth/moderation, and the
|
|
10
|
+
`grid init → fill → grid plug → poll` deploy flow, then adapt and build the app.
|
|
11
|
+
|
|
12
|
+
See `AGENTS.md` for the full structure guide.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# cloudgrid.yaml — Complete Example
|
|
3
|
+
# ============================================================================
|
|
4
|
+
#
|
|
5
|
+
# This file shows EVERY field the platform supports, with comments explaining
|
|
6
|
+
# each one. It is a reference — no real project would use all of these at once.
|
|
7
|
+
#
|
|
8
|
+
# STANDARD: every CloudGrid template ships its cloudgrid.yaml in THIS full form.
|
|
9
|
+
# Uncomment ONLY the fields the archetype needs (always: name + services; plus
|
|
10
|
+
# needs: for runtime apps). Leave everything else commented. Comments are
|
|
11
|
+
# ignored by the parser, so the file deploys to exactly the active fields.
|
|
12
|
+
#
|
|
13
|
+
# Only two fields are required: name and services. Everything else is optional.
|
|
14
|
+
# Full docs: docs/cloudgrid-yaml-reference.md
|
|
15
|
+
# ============================================================================
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# ─── IDENTITY ───────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
# Entity slug (REQUIRED). 2-42 chars, lowercase alphanumeric + hyphens.
|
|
21
|
+
# Must start and end with a letter or digit.
|
|
22
|
+
# Becomes part of your public URL: <name>-<4hex>.<org>.cloudgrid.io
|
|
23
|
+
name: forum
|
|
24
|
+
|
|
25
|
+
# One-line summary. Max 280 chars. If omitted, Grid Brain auto-generates one.
|
|
26
|
+
# description: Order processing API for the e-commerce platform
|
|
27
|
+
|
|
28
|
+
# Single emoji or short text shown as the entity icon. Max 64 chars.
|
|
29
|
+
# icon: "📦"
|
|
30
|
+
|
|
31
|
+
# Entity type: 'app' (default) or 'agent'. An agent is an app with an agent: block.
|
|
32
|
+
# kind: app
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# ─── NETWORKING ─────────────────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
# Whether this entity serves public HTTP traffic.
|
|
38
|
+
# true = public URL + Ingress (default). false = internal only.
|
|
39
|
+
# expose: true
|
|
40
|
+
|
|
41
|
+
# Additional domain names this entity serves on (the platform URL is always active).
|
|
42
|
+
# custom_domains:
|
|
43
|
+
# - orders.example.com
|
|
44
|
+
# - shop.example.com
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# ─── HEALTH PROBE (entity-level override) ──────────────────────────────────
|
|
48
|
+
|
|
49
|
+
# Override the default health check for the entire entity.
|
|
50
|
+
# probe:
|
|
51
|
+
# path: /healthz # HTTP path to probe (default: /).
|
|
52
|
+
# expected: "<500" # '<500' (default), '200', '2xx'.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# ─── DEPLOY NOTIFICATIONS ──────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
# Slack notification to the org's default channel on deploy failure.
|
|
58
|
+
# true = notify (default), false = silent.
|
|
59
|
+
# notify: true
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# ─── SCALING ────────────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
# Replica scaling intent.
|
|
65
|
+
# 'auto' — platform decides from the grid tier (default).
|
|
66
|
+
# 'alert' — single-replica, emit a SPOF warning at plug time.
|
|
67
|
+
# 1-10 — explicit replica count, clamped to the grid max.
|
|
68
|
+
# scale: auto
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# ─── INFRASTRUCTURE NEEDS ──────────────────────────────────────────────────
|
|
72
|
+
#
|
|
73
|
+
# Declare infrastructure; the platform provisions it and injects connection
|
|
74
|
+
# details as env vars. Nine needs: database, cache, kv, queue, pubsub, vector,
|
|
75
|
+
# object_storage, disk, ai. Simplest form is `true`.
|
|
76
|
+
#
|
|
77
|
+
# needs:
|
|
78
|
+
# # database — MongoDB. Injects DATABASE_MONGODB_URL (+ legacy MONGODB_URL).
|
|
79
|
+
# # true | pool | dedicated | { tier: external, secret: MY_DB }
|
|
80
|
+
# database: true
|
|
81
|
+
# # cache — Redis, LRU eviction (derived data). Injects CACHE_REDIS_URL (+ REDIS_URL).
|
|
82
|
+
# # true | redis | { engine: external, secret: MY_REDIS_URL }
|
|
83
|
+
# cache: true
|
|
84
|
+
# # kv — Redis, no eviction (durable: flags, idempotency). Injects KV_REDIS_URL.
|
|
85
|
+
# kv: true
|
|
86
|
+
# # queue — Redis job-queue substrate (BullMQ). Injects QUEUE_REDIS_URL.
|
|
87
|
+
# queue: true
|
|
88
|
+
# # pubsub — Redis broadcast pub/sub. Injects PUBSUB_REDIS_URL.
|
|
89
|
+
# pubsub: true
|
|
90
|
+
# # vector — pgvector on Postgres. Injects VECTOR_PGVECTOR_URL (+ PGVECTOR_URL).
|
|
91
|
+
# # true | pgvector | { engine: pgvector, dim: 1536 }
|
|
92
|
+
# vector: pgvector
|
|
93
|
+
# # object_storage — GCS bucket. Injects OBJECT_STORAGE_GCS_BUCKET, _GCS_REGION.
|
|
94
|
+
# # true | { size: 10Gi }
|
|
95
|
+
# object_storage: true
|
|
96
|
+
# # disk — persistent FS mount (PVC). Injects DISK_PATH. Pins to 1 replica.
|
|
97
|
+
# # true | { size: 1Gi, mount: /var/data } (forbidden: /proc /sys /dev)
|
|
98
|
+
# disk: true
|
|
99
|
+
# # ai — AI Gateway via @cloudgrid-io/ai. Injects AI_GATEWAY_URL. true | false.
|
|
100
|
+
# ai: true
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# ─── INTER-ENTITY COMMUNICATION ────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
# Entities this app calls (outbound). Service-account token injected per pair.
|
|
106
|
+
# calls:
|
|
107
|
+
# - org:atomic/billing-api
|
|
108
|
+
|
|
109
|
+
# Inbound caller policy — who can call YOUR entity.
|
|
110
|
+
# callers:
|
|
111
|
+
# policy: auto # 'auto' | 'manual' (default).
|
|
112
|
+
# scope: org # 'org' (default) | 'space' | 'explicit'.
|
|
113
|
+
# fallback: deny # 'deny' (default) | 'warn'.
|
|
114
|
+
# # allowed_apps: # required only when scope: explicit
|
|
115
|
+
# # - org:atomic/frontend
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# ─── VAULT ──────────────────────────────────────────────────────────────────
|
|
119
|
+
#
|
|
120
|
+
# Map org vault items to env vars. Keys UPPER_SNAKE_CASE; values = vault item keys.
|
|
121
|
+
# This forum uses a hosted auth provider (Clerk/Auth0) so members must sign in to
|
|
122
|
+
# post. Store the provider's secret + publishable keys as org vault items, then
|
|
123
|
+
# map them to env vars here. The grid injects them at build + runtime — never
|
|
124
|
+
# hardcode a key or commit one to the repo.
|
|
125
|
+
vault:
|
|
126
|
+
AUTH_PROVIDER_SECRET_KEY: auth-provider-secret-key
|
|
127
|
+
AUTH_PROVIDER_PUBLISHABLE_KEY: auth-provider-publishable-key
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# ─── CONNECTORS AND HOOKS ──────────────────────────────────────────────────
|
|
131
|
+
|
|
132
|
+
# connectors:
|
|
133
|
+
# - id: team-slack
|
|
134
|
+
# target: org # 'system' | 'org'.
|
|
135
|
+
# channel: "#deploys"
|
|
136
|
+
# hooks:
|
|
137
|
+
# - on: deploy.failed # release.published | deploy.failed | feedback.received | entity.created
|
|
138
|
+
# via: team-slack
|
|
139
|
+
# template: "Deploy failed for {entity_name}: {error}"
|
|
140
|
+
# channel: "#alerts"
|
|
141
|
+
# triggers:
|
|
142
|
+
# - from: team-slack
|
|
143
|
+
# event: message
|
|
144
|
+
# channel: "#support"
|
|
145
|
+
# route: /webhooks/slack
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# ─── LOCAL DEVELOPMENT ──────────────────────────────────────────────────────
|
|
149
|
+
|
|
150
|
+
# Config for `grid dev`. Redact fields in dev data snapshots.
|
|
151
|
+
# dev:
|
|
152
|
+
# snapshot:
|
|
153
|
+
# mask:
|
|
154
|
+
# - users.email
|
|
155
|
+
# - users.phone
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
# ─── AGENT METADATA ────────────────────────────────────────────────────────
|
|
159
|
+
|
|
160
|
+
# An agent is an app with kind: agent (above) and an agent: block.
|
|
161
|
+
# agent:
|
|
162
|
+
# purpose: Sync customer data from external CRM every night
|
|
163
|
+
# schedule: "0 2 * * *"
|
|
164
|
+
# trigger: webhook
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
# ─── PRIVATE RESOURCE AUTO-DEPENDENCIES ────────────────────────────────────
|
|
168
|
+
|
|
169
|
+
# When true (default), private resources are auto-injected as depends_on.
|
|
170
|
+
# auto_depends_on_private_requires: true
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# ─── SERVICES (REQUIRED) ───────────────────────────────────────────────────
|
|
174
|
+
#
|
|
175
|
+
# At least one service is required. Key = service name (slug rules).
|
|
176
|
+
# Types: node, nextjs, python, static, cron.
|
|
177
|
+
#
|
|
178
|
+
services:
|
|
179
|
+
web:
|
|
180
|
+
# type (REQUIRED): node | nextjs | python | static | cron
|
|
181
|
+
type: nextjs
|
|
182
|
+
# HTTP route: '/' | '/api' | false (internal) | omitted (=false + warning).
|
|
183
|
+
# Only one service per entity can claim '/'.
|
|
184
|
+
path: /
|
|
185
|
+
# Container port (default 8080; read process.env.PORT). Not for cron.
|
|
186
|
+
# port: 3000
|
|
187
|
+
# nextjs only: base_image: distroless (default) | alpine
|
|
188
|
+
# base_image: distroless
|
|
189
|
+
# node only: lang: javascript (default) | typescript
|
|
190
|
+
# lang: typescript
|
|
191
|
+
# Custom source location (default services/<name>/). '.' = project root.
|
|
192
|
+
# source:
|
|
193
|
+
# path: src/worker
|
|
194
|
+
# Health probe: false/omitted (TCP) | true (/health) | "/path" | {path,expected}
|
|
195
|
+
# health:
|
|
196
|
+
# path: /api/health
|
|
197
|
+
# expected: "200"
|
|
198
|
+
# Static runtime env vars (strings). Reserved: PORT, APP_NAME, SERVICE_NAME,
|
|
199
|
+
# NODE_ENV, MONGODB_URL, REDIS_URL, AI_GATEWAY_URL, N8N_WEBHOOK_URL, CLOUDGRID_*.
|
|
200
|
+
# env:
|
|
201
|
+
# LOG_LEVEL: info
|
|
202
|
+
# Sibling services/private resources that must be Ready first (no cron, no cycles).
|
|
203
|
+
# depends_on:
|
|
204
|
+
# - worker
|
|
205
|
+
# Per-service needs override (merges with app-level needs).
|
|
206
|
+
# needs:
|
|
207
|
+
# queue: true
|
|
208
|
+
# Static-only build step:
|
|
209
|
+
# build:
|
|
210
|
+
# command: npm run build
|
|
211
|
+
# output: dist
|
|
212
|
+
# env:
|
|
213
|
+
# VITE_API_URL: https://api.example.com
|
|
214
|
+
# node_version: "22" # static build step: '18'|'20'|'22'|'24' (quoted)
|
|
215
|
+
# Cron-only: schedule (REQUIRED), timezone (UTC|EST|PST), run (job | https URL)
|
|
216
|
+
# schedule: "0 9 * * 1"
|
|
217
|
+
# timezone: UTC
|
|
218
|
+
# run: job
|
|
219
|
+
# Verbose per-service persistence (prefer needs.disk):
|
|
220
|
+
# persist:
|
|
221
|
+
# - name: scratch
|
|
222
|
+
# path: /tmp/scratch
|
|
223
|
+
# size: 500Mi
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
needs:
|
|
228
|
+
database: true
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
# ============================================================================
|
|
232
|
+
# NOTES
|
|
233
|
+
# - NOT here: org:/entity_id: (→ .cloudgrid/link.json), secrets (→ grid secrets set),
|
|
234
|
+
# Dockerfile (platform generates from services.*.type).
|
|
235
|
+
# - Deploy: grid plug | Local with grid resources: grid dev
|
|
236
|
+
# - Full reference: docs/cloudgrid-yaml-reference.md | CLI: docs/cli-reference.md
|
|
237
|
+
# ============================================================================
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Template: forum (BLUEPRINT — threaded community forum)
|
|
2
|
+
|
|
3
|
+
A persistent, sign-in-to-post community forum: `threads` → nested `posts` with
|
|
4
|
+
moderation, on Next.js + grid-shared MongoDB, auth via a hosted provider
|
|
5
|
+
(Clerk / Auth0). This is a **blueprint** — it gives you the structure and
|
|
6
|
+
`cloudgrid.yaml`, NOT runnable app code. Read `AGENTS.md`, then build the app
|
|
7
|
+
under `services/web/` following it. The shape mirrors the proven `app-with-data`
|
|
8
|
+
template (lazy Mongo getter, App-Router routes, `needs: { database: true }`).
|
|
9
|
+
|
|
10
|
+
**Fetch the bundle:** `gridctl_fetch("template", "forum")` returns this
|
|
11
|
+
directory — `cloudgrid.yaml`, `AGENTS.md` (the structure guide), and this file.
|
|
12
|
+
|
|
13
|
+
**Key rules:**
|
|
14
|
+
|
|
15
|
+
1. **App code MUST live under `services/web/`.** `path: /` is the URL mount, not
|
|
16
|
+
the filesystem path. Root files fail with `Service directory not found`.
|
|
17
|
+
2. **Read the DB connection LAZILY** in `lib/db.js` —
|
|
18
|
+
`process.env.DATABASE_MONGODB_URL || process.env.MONGODB_URL` inside the
|
|
19
|
+
getter, never at module top level (a top-level read fails `next build`). The
|
|
20
|
+
grid injects it from `needs: { database: true }`. Never hardcode it.
|
|
21
|
+
3. **Declare `needs: { database: true }`** — the canonical shape. Never author
|
|
22
|
+
`requires:`, and never set `needs:` and `requires:` together (the validator
|
|
23
|
+
rejects the combination).
|
|
24
|
+
4. **Auth secrets come from the `vault:` block** → env vars, injected by the
|
|
25
|
+
grid at build + runtime. Never inline a provider key.
|
|
26
|
+
5. **Runtime app → local edition, async deploy.** `grid plug` returns
|
|
27
|
+
`status: building`; poll to a live URL.
|
|
28
|
+
|
|
29
|
+
## cloudgrid.yaml
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
# On disk this file is the full-annotated reference (templates/_cloudgrid.yaml.reference)
|
|
33
|
+
# with EVERY field present as a comment; only the fields below are uncommented,
|
|
34
|
+
# so it deploys to exactly these active fields.
|
|
35
|
+
name: forum
|
|
36
|
+
services:
|
|
37
|
+
web:
|
|
38
|
+
type: nextjs
|
|
39
|
+
path: /
|
|
40
|
+
vault:
|
|
41
|
+
AUTH_PROVIDER_SECRET_KEY: auth-provider-secret-key
|
|
42
|
+
AUTH_PROVIDER_PUBLISHABLE_KEY: auth-provider-publishable-key
|
|
43
|
+
needs:
|
|
44
|
+
database: true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Capability:** `needs: { database: true }` → the deployer provisions MongoDB
|
|
48
|
+
> and injects `DATABASE_MONGODB_URL` (plus the legacy `MONGODB_URL` alias). The
|
|
49
|
+
> `vault:` mappings inject the auth-provider keys as env vars. `requires:` is the
|
|
50
|
+
> deprecated v1 alias — don't mix it with `needs:`.
|
|
51
|
+
|
|
52
|
+
## Collections (see AGENTS.md for full fields)
|
|
53
|
+
|
|
54
|
+
- **`users`** — thin mirror of the auth-provider identity (`authorId` unique,
|
|
55
|
+
`displayName`, `role: member|moderator`).
|
|
56
|
+
- **`threads`** — `title`, `authorId`, `authorName`, `replyCount`, `createdAt`,
|
|
57
|
+
`lastPostAt`.
|
|
58
|
+
- **`posts`** — `threadId`, `parentId` (self-referential for nesting; `null` =
|
|
59
|
+
top-level), `authorId`, `authorName`, `body`, `deleted` (soft-delete for
|
|
60
|
+
moderation), `createdAt`.
|
|
61
|
+
|
|
62
|
+
## Build it
|
|
63
|
+
|
|
64
|
+
Read `AGENTS.md` for the file tree, Mongo schema, secret injection, auth +
|
|
65
|
+
moderation wiring, and deploy steps. Adapt the domain, then `grid dev` (local) /
|
|
66
|
+
`grid plug` (deploy, async — poll to a live URL).
|