{"catalogRevision":"cat_726f873af6f566cc","recipeId":"page:recipes:project-tracker:next-js:csv-imports","recipeRevision":"r1","canonicalPath":"/recipes/project-tracker/next-js/csv-imports","label":"Host project tracker with Next.js: CSV imports","title":"How to host a project tracker built with Next.js on Ample: CSV imports","family":"Workload recipe","summary":"Deploy a project tracker built with Next.js on Ample using the bulk import staging pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL, a private S3-compatible bucket holds objects with credentials delivered as encrypted environment variables. Verified on Next.js: a CSV staged as an object, row-level validation with per-row errors recorded, and a restart-safe import keyed by import id (imported=2 rejected=1 restart=ok). The project tracker-specific behavior (your import format, mapping and conflict rules) is your application code on that verified basis.","representativeQueries":["Host project tracker with Next.js: CSV imports","Where can I host Project tracker built with Next.js?","I need a domain CSV format, row validation, deduplication and an import recovery path."],"breadcrumbIds":["discovery","workload","workload:business-operations","workload:project-tracker","page:recipes:project-tracker:next-js:csv-imports"],"breadcrumbs":[{"id":"discovery","label":"Agent hosting discovery","canonicalPath":"/discover/discovery","kind":"root"},{"id":"workload","label":"Applications and workloads","canonicalPath":"/discover/workload","kind":"facet"},{"id":"workload:business-operations","label":"Business operations","canonicalPath":"/discover/workload/business-operations","kind":"group"},{"id":"workload:project-tracker","label":"Project tracker","canonicalPath":"/discover/workload/project-tracker","kind":"atom"},{"id":"page:recipes:project-tracker:next-js:csv-imports","label":"Host project tracker with Next.js: CSV imports","canonicalPath":"/recipes/project-tracker/next-js/csv-imports","kind":"recipe"}],"parentIds":["workload:project-tracker","stack:framework-next-js","pattern:bulk-import-staging","intent:deploy-web-app"],"parents":[{"id":"workload:project-tracker","label":"Project tracker","canonicalPath":"/discover/workload/project-tracker","kind":"atom"},{"id":"stack:framework-next-js","label":"Next.js","canonicalPath":"/discover/stack/framework-next-js","kind":"atom"},{"id":"pattern:bulk-import-staging","label":"Bulk import staging","canonicalPath":"/discover/pattern/bulk-import-staging","kind":"atom"},{"id":"intent:deploy-web-app","label":"Deploy web app","canonicalPath":"/discover/intent/deploy-web-app","kind":"atom"}],"resourceRequirements":["primitive:compute","primitive:postgres","primitive:s3-compatible-object-storage"],"infrastructureRequirements":[{"primitiveId":"primitive:compute","label":"Compute","canonicalPath":"/discover/primitive/compute","status":"verified","summary":"Apps run in isolated x86_64 Firecracker microVMs; sizes are the priced VM sizes."},{"primitiveId":"primitive:postgres","label":"Postgres","canonicalPath":"/discover/primitive/postgres","status":"verified","summary":"Managed PostgreSQL 16 with pgvector runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied."},{"primitiveId":"primitive:s3-compatible-object-storage","label":"S3-compatible object storage","canonicalPath":"/discover/primitive/s3-compatible-object-storage","status":"verified","summary":"Buckets speak the S3 API with SigV4 credentials Ample Computer issues; `ample bucket upload-url` returns a presigned upload URL. PutObject and GetObject are checked by canary."}],"framework":"Next.js","workload":"Project tracker","releaseStatus":"published","supportStatus":"verified","executionStatus":"ready","docsOnly":false,"prerequisites":["A Next.js project that builds and starts with the documented commands (next build then next start -H 0.0.0.0 -p $PORT on the node-22 template)","A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env)","A bucket from `ample bucket create` with its credentials passed as encrypted S3_* environment variables","An Ample account token with servers:write, databases:read, buckets:read"],"testedConfiguration":{"template":"node-22","runtime":"node","size":"s-1vcpu-1gb","install":"npm install","build":"npm run build --if-present","start":"npm run start"},"inputSchema":{"additionalProperties":false,"properties":{"env":{"description":"Encrypted environment variables (bucket credentials, secrets)","items":{"pattern":"^[A-Z][A-Z0-9_]*=.*$","type":"string"},"maxItems":50,"type":"array"},"name":{"description":"App name","maxLength":63,"minLength":1,"pattern":"^[a-z0-9-]+$","type":"string"},"path":{"description":"Project directory or ample.toml service","maxLength":512,"minLength":1,"type":"string"},"release_command":{"description":"Migration command run before activation","maxLength":512,"type":"string"}},"required":["env","name","path"],"type":"object"},"outputSchema":null,"workflowSteps":[{"title":"Build and start","body":"next build then next start -H 0.0.0.0 -p $PORT on the node-22 template. The server must bind 0.0.0.0 on PORT."},{"title":"Implement the pattern on PostgreSQL","body":"The fixture's module implements bulk import staging: a CSV staged as an object, row-level validation with per-row errors recorded, and a restart-safe import keyed by import id (imported=2 rejected=1 restart=ok). Copy the approach into your schema; keep migrations idempotent and run them with --release-command."},{"title":"Wire object storage","body":"Create the bucket(s), then pass endpoint, region, bucket and keys as --env values. Use path-style addressing. Keep private data in an unpublished bucket."},{"title":"Deploy","body":"Run the synchronous deploy once and read the result (exit 0 live, 1 failed, 2 needs an answer first). Re-running with no change is a no-op.","command":"ample deploy . --name <app-name> --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=..."},{"title":"Verify","body":"Fetch the live URL and the pattern self-test route(s) (/p/bulk-import-staging) from the example; then run your own checks. On failure read `ample logs <deployment_id> --kind build` then `--kind runtime`.","command":"ample logs <deployment_id> --kind build"}],"examples":[{"title":"Next.js pattern fixture","description":"Multi-pattern Next.js app whose bulk import staging module was checked live; the module is under tests/deploy-canaries/_pattern-modules.","sourceRef":"tests/deploy-canaries/next-js-patterns"}],"successChecks":[{"description":"app responds on its public URL","kind":"http_get","path":"/","expect":"ample canary next js patterns"},{"description":"bulk-import-staging self-test","kind":"http_get","path":"/p/bulk-import-staging","expect":"imported=2 rejected=1 restart=ok"}],"limitations":["Verified on the node-22 template at s-1vcpu-1gb with the example fixture.","The pattern checks verified the platform side; the project tracker itself (your import format, mapping and conflict rules) is your application code.","Managed PostgreSQL 16 with pgvector; apps and their databases are placed together.","Buckets speak the standard S3 API (PutObject and GetObject with path-style addressing are checked by the fixture); `ample bucket upload-url` returns presigned upload URLs."],"costEstimate":{"currency":"USD","monthlyAmount":10.0,"authoritative":true,"basis":"size prices from pricing.toml (loaded by the API) at build revision 3a3dfe06151688a20d397caac2aa66e562c23eb0","components":[{"name":"app server","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0},{"name":"managed PostgreSQL database","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0}],"note":"Upper-bound monthly price of the tested sizes. Buckets are allocation-priced per quota and not included."},"evidenceSummary":[{"kind":"canary_run","summary":"Next.js pattern fixture deployed on Ample (next build then next start -H 0.0.0.0 -p $PORT on the node-22 template); checks passed for bulk-import-staging and configuration-secrets. Pattern proof: a CSV staged as an object, row-level validation with per-row errors recorded, and a restart-safe import keyed by import id (imported=2 rejected=1 restart=ok).","observedAt":"2026-11-05T22:38:23Z","implementationRevision":"da3e37255e5a","expiresAt":"2027-05-04T22:38:23Z","scope":{"checks":["/p/bulk-import-staging"],"pattern":"pattern:bulk-import-staging","template":"node-22"}},{"kind":"canary_run","summary":"The same Next.js app deployed with a --release-command migration; the marker it created was readable after activation.","observedAt":"2026-11-06T00:38:14Z","implementationRevision":"7360fc06ef21","expiresAt":"2027-05-05T00:38:14Z","scope":{"pattern":"pattern:bulk-import-staging"}}],"lastVerifiedAt":"2026-11-05T22:38:23Z","mcpBinding":{"registryRef":"mcp:ample_deploy","toolName":"ample_deploy","schemaHash":"0802c329be823fa0695460cf73206d47a6fa0efa57417c386c34b6614a92ea5f","observedAt":"2026-11-06T06:16:17.558478534+00:00","implementationRevision":"4558e9477d09","requiredScopes":["servers:write","databases:read","buckets:read"],"bindingState":"current"},"unknowns":[],"formats":{"html":"https://ample.computer/recipes/project-tracker/next-js/csv-imports","markdown":"https://ample.computer/recipes/project-tracker/next-js/csv-imports.md","json":"https://api.ample.computer/v1/catalog/recipes/page%3Arecipes%3Aproject-tracker%3Anext-js%3Acsv-imports"},"nextActions":[{"actionId":"browse-catalog","label":"Browse the catalog index","operationId":"catalog_index","method":"GET","relativePath":"/v1/catalog","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"search-recipes","label":"Search published recipes by intent, stack and constraints","operationId":"search_recipes","method":"POST","relativePath":"/v1/catalog/search","origin":"api","parameters":{"body":{"limit":5,"query":"Host project tracker with Next.js: CSV imports"}},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"plan:page:recipes:project-tracker:next-js:csv-imports","label":"Prepare a side-effect-free deployment plan for an authorized project","operationId":"plan_deployment","method":"POST","relativePath":"/v1/catalog/plan","origin":"api","parameters":{"body":{"inputs":{},"projectId":"<workspace or server id you own>","recipeId":"page:recipes:project-tracker:next-js:csv-imports","recipeRevision":"r1"}},"requiresAuthentication":true,"requiresApproval":false},{"actionId":"auth-setup","label":"Read the existing agent authentication setup","operationId":"existing_auth_setup","method":"GET","relativePath":"/mcp/setup","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:workload:project-tracker","label":"Browse Project tracker","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/workload%3Aproject-tracker","origin":"api","parameters":{"nodeId":"workload:project-tracker"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:stack:framework-next-js","label":"Browse Next.js","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/stack%3Aframework-next-js","origin":"api","parameters":{"nodeId":"stack:framework-next-js"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:pattern:bulk-import-staging","label":"Browse Bulk import staging","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/pattern%3Abulk-import-staging","origin":"api","parameters":{"nodeId":"pattern:bulk-import-staging"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:intent:deploy-web-app","label":"Browse Deploy web app","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/intent%3Adeploy-web-app","origin":"api","parameters":{"nodeId":"intent:deploy-web-app"},"requiresAuthentication":false,"requiresApproval":false}]}