Skip to content

Latest commit

 

History

History
102 lines (65 loc) · 2.27 KB

README.md

File metadata and controls

102 lines (65 loc) · 2.27 KB

Motzi

Neighborhood bakery's CSA site

Development

Requires Postgres and mise (manages Ruby/Bun). Add to .env:

AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
STRIPE_PUBLISHABLE_KEY=...

Real data from prod: bin/seed_local

To also download item images from S3 (requires AWS credentials):

bin/seed_local --images

Start everything: bin/dev

Background jobs use Solid Queue. Run workers with:

bin/jobs start

Mission Control Jobs UI is mounted at /jobs (admin access required).

JavaScript / TypeScript

Run tests:

bun run test

Typecheck app code (default gate):

bun run typecheck

Typecheck tests too (stricter, may expose legacy test typings):

bun run typecheck:test

Note: React act(...) warnings can still appear during bun run test; those are runtime test warnings, not TypeScript failures.

Data

Fixtures: rails db:fixtures:load. For a copy of production data, use bin/seed_local.

Emails

Visit /letter_opener to see emails sent locally.

Spam users

User.find(SqlQuery.new(:spam_user_ids).execute.pluck("id")).each {|u| u.destroy!}

Heroku

Auto-deploys from master when CI passes. Full review-app config in app.json.

Addons

Addon Plan Purpose
heroku-postgresql essential-1 (v18) Primary database

ActionCable runs on Solid Cable (config/cable.yml), so Redis is not required for runtime.

Recurring jobs

All recurring jobs run via Solid Queue (config/recurring.yml):

Job Frequency
SendDayOfReminderJob Hourly at :05
SendHaventOrderedReminderJob Hourly at :15
UptimeCheckJob Every 5 minutes
CaptureDynoMetricsJob Twice an hour (:03, :33)
AnalyzeAnomaliesJob Daily at 9:21pm ET
clear_solid_queue_finished_jobs Daily at 4:15am ET
TrimAnalyticsJob Daily at 4:30am ET
CaptureDbBackupJob Sundays at 3:07am ET

Email

SendGrid via SENDGRID_USERNAME / SENDGRID_PASSWORD. On review apps, ReviewAppMailInterceptor restricts delivery to admin users only.

Review apps

REVIEW_APP=true set automatically via app.json. Use bin/seed_review_app <app-name> to copy prod data and config vars.