# Tutoring centers: event registration using Laravel

## Summary
A event registration blueprint for tutoring centers built with Laravel 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 includes 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. Technical basis verified on Laravel: 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).

## Resource Requirements
- Compute
- PostgreSQL
- S3-compatible object storage

## Workflow Steps
1. **Model the tutoring centers domain**: Create the tables course_groups, memberships, sessions, materials, events. Tutoring groups live in course_groups; keep the sensitive classes (minor students and guardian identity, progress reports) out of this schema.
2. **Workflow step 1**: Model sessions with capacity and registrations with status.
3. **Workflow step 2**: Register transactionally with a capacity check and an event per registration.
4. **Workflow step 3**: Reject stale concurrent updates.
5. **Workflow step 4**: Deploy and verify history and conflict handling.
6. **Deploy**: Run the synchronous deploy once and read the result. Re-running with no change is a no-op.
   - Command: `ample deploy . --name --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=...`
7. **Verify**: Run the pattern self-test(s) from the example (/p/transactional-workflows) and your own acceptance checks for the tutoring centers workflow.
   - Command: `ample logs  --kind build`

## Examples
### Laravel pattern fixture
- **Description**: Verified transactional workflows basis for this blueprint.
- **Source Reference**: `tests/deploy-canaries/laravel-patterns`

## Success Checks
- **App responds on its public URL**:
   - Kind: `http_get`
   - Path: `/`
   - Expect: `ample canary laravel patterns`
- **Transactional-workflows self-test from the example**:
   - Kind: `http_get`
   - Path: `/p/transactional-workflows`
   - Expect: `see the pattern fixture checks`

## Limitations
- The technical basis (transactional workflows on Laravel) 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.
- Verified on the php-8.5 template at s-1vcpu-1gb; region, request-duration limits and other sizes are unknown or unverified.
- Managed PostgreSQL 16 only; extensions, connection limits, and backup or restore procedures are not verified.
- PutObject and GetObject with path-style addressing are verified; other S3 operations and CDN cache rules are not verified.

## Cost Estimate
- **Currency**: USD
- **Monthly Amount**: 10.0
- **Basis**: Size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
- **Components**:
    - App server: s-1vcpu-1gb, quantity: 1.0, monthly amount: 5.0
    - Managed PostgreSQL database: s-1vcpu-1gb, quantity: 1.0, monthly amount: 5.0
- **Note**: Always-on monthly price of the tested sizes; apps and databases auto-pause when idle. Buckets are allocation-priced per quota and not included.
