next js.md
Tutoring centers: event registration using Next.js
Summary
A event registration blueprint for tutoring centers built with Next.js on Ample. Domain schema: course_groups (subject, level, start_at, end_at, capacity): tutoring groups; memberships (course_group_id, student_reference, guardian_reference, role): students, guardians and tutors; sessions (course_group_id, starts_at, tutor, attendance_count): session events; materials (course_group_id, title, object_key, visibility): worksheets and answer keys; events (seq, record_type, record_id, kind, at): application-owned history written in the same transaction. Public information: subjects and levels, schedule and locations, tutor qualifications. Kept out of scope until handling is reviewed: minor students and guardian identity, progress reports. Data about minors is sensitive; only group schedules and materials are modeled here.
Infrastructure requirements
- Compute: verified (Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.)
- Postgres: verified (Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.)
- S3-compatible object storage: verified (Buckets are S3-compatible with issued credentials; PutObject and GetObject are verified by canary. Other S3 operations are not verified.)
Prerequisites
- A Next.js project (next build then next start -H 0.0.0.0 -p $PORT on the node-22 template)
- A PostgreSQL driver reading DATABASE_URL (auto-provisioned when omitted)
- Bucket credentials from
ample bucket createpassed as encrypted S3_* environment variables - A review of which tutoring centers data classes may be handled at all; this blueprint models public information only
Steps
- Model the tutoring centers domain. Create the tables course_groups, memberships, sessions, materials, events.
- Workflow step 1. Model sessions with capacity and registrations with status.
- Workflow step 2. Register transactionally with a capacity check and an event per registration.
- Workflow step 3. Reject stale concurrent updates.
- Workflow step 4. Deploy and verify history and conflict handling.
- Deploy. Run the synchronous deploy once and read the result.
- Verify. Run the pattern self-test(s) from the example (/p/transactional-workflows) and your own acceptance checks for the tutoring centers workflow.
Tested examples
- Next.js pattern fixture (tests/deploy-canaries/next-js-patterns): Verified transactional workflows basis for this blueprint.
Success checks
- app responds on its public URL (
/on the live URL, expect ample canary next js patterns) - transactional-workflows self-test from the example (
/p/transactional-workflowson the live URL, expect see the pattern fixture checks)
Limitations
- The technical basis (transactional workflows on Next.js) was verified with the pattern fixture; the tutoring centers schema and workflow are an original design for this blueprint and were not executed as a separate application.
- No health, financial, privacy or other compliance claim is made. Data about minors is sensitive; only group schedules and materials are modeled here.
- Public content and synthetic examples only until actual data-handling requirements have been reviewed.
Cost estimate
Estimated 10.00 USD per month (size prices from pricing.toml at build revision a1b8c38919e59cd035ebabaced73cf84ece24371).
- app server x1
s-1vcpu-1gb: 5.00 USD - managed PostgreSQL database x1
s-1vcpu-1gb: 5.00 USD
Verification evidence
- canary_run on 2026-09-21T02:34:39Z at revision
1d28ae0-dirty (CLI 0.1.21): Next.js pattern fixture deployed on Ample (next build then next start -H 0.0.0.0 -p $PORT on the node-22 template); the transactional workflows checks passed: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). The blueprint's Tutoring centers schema and workflow below build on that verified basis and were not separately executed. (expires 2027-03-20T02:34:39Z)
Execution binding
MCP tool ample_deploy (registry mcp:ample_deploy), schema hash 876465fce906da0c observed 2026-09-21T03:19:59.461917+00:00 at revision 49962bcade4f, binding state current, required scopes: servers:write, databases:read, buckets:read.