Your new Fresh project is ready to go. You can follow the Fresh "Getting Started" guide here: https://fresh.deno.dev/docs/getting-started
Make sure to install Deno: https://deno.land/manual/getting_started/installation
Then start the project:
deno task start
This will watch the project directory and restart as necessary.
This project is configured to work with GitHub Codespaces, allowing you to develop in a consistent environment directly in your browser.
To use GitHub Codespaces:
- Navigate to your GitHub repository
- Click the "Code" button
- Select the "Codespaces" tab
- Click "Create codespace on main"
Once the codespace is created, it will automatically:
- Install Deno and other dependencies
- Set up VS Code with the necessary extensions
- Forward port 8000 for local development
To start the development server in Codespaces:
deno task start
This application uses various environment variables for configuration. Create a
.env file in the root directory with the following variables:
CLIENT_ID: Auth provider client ID used by the login/logout/callback routes.CLIENT_SECRET: Auth provider client secret used during OAuth callback.DB_URL: Optional Deno KV database URL. If omitted locally, the app falls back to local SQLite-backedDeno.openKv().STAGE: Environment identifier.PRODenables cron jobs and affects some app behavior. Non-PRODvalues skip production-only cron work.LOG_LEVEL: Optional logger level. Defaults todebug.
ADMIN_EMAIL: Destination for support emails, question report emails, SES/SQS notifications, and Stripe order alert emails.SES_FROM_EMAIL: Sender address for outgoing SES emails.RECAPTCHA_SECRET_KEY: Required by the support form API to verify reCAPTCHA.
AWS_ACCESS_KEY_ID: AWS access key used by SES, SQS, S3, and logging.AWS_SECRET_ACCESS_KEY: AWS secret access key paired with the access key ID.AWS_REGION: Optional AWS region. Defaults tous-east-1.WEEWOO_OPS_QUEUE_URL: SQS queue URL used by the cron task that polls operational notifications.
STRIPE_API_KEY: Stripe secret API key used by checkout, webhooks, and admin scripts.STRIPE_SIGNING_SECRET: Stripe webhook signing secret used byroutes/api/stripe_webhook.ts.PRINTFUL_SECRET: Printful API token used for product sync and order submission.
CHAT_GPT_KEY: OpenAI API key used by the question-generation routes/scripts.OPENAI_API_KEY: Alternative toCHAT_GPT_KEYsupported by the workflow scripts.S3_BUCKET_NAME: Optional S3 bucket containing chapter/content assets. Defaults toems-questions-static-assets.S3_PREFIX_KEY: Optional S3 key prefix for chapter/content assets. Defaults toemt-book/.
S3_IMAGES_BUCKET: S3 bucket used byscripts/migrate_images_to_webp.ts.CLOUDFRONT_URL: CloudFront domain used byscripts/migrate_images_to_webp.tswhen generating public asset URLs.
DENO_KV_ACCESS_TOKENis not currently read anywhere in the repository.COOKIE_SECRETis not currently used by the app.STRIPE_WEBHOOK_TEMPis not currently used by the app.
Cool sounds here: https://freesound.org/search/?q=correct&f=grouping_pack%3A%2230761_feedback-correct%22
To run the stripe CLI webhook tests
stripe listen --forward-to localhost:8000/api/stripe_webhook
stripe trigger checkout.session.completed
- Create the product in printful
- Download the images and upload them to the cloudfront CDN
- Update the google sheet
- Download the csv
- Upload to Stripe
- Add to the app database
potentially useful for extracting the urls out of s3
function getImageUris(str) {
return Array.from(document.getElementsByClassName("name object latest object-name")).map((el) => {
if (el.innerHTML.includes(str)) {
return `https://d3leqxp227sjlw.cloudfront.net/hoodie/${el.innerHTML}`
}
}).filter(Boolean).join("|")
}
products spreadsheet
https://docs.google.com/spreadsheets/d/1Tzcpc9YNc6sHVZK_6PAjQCBgEfKiQr9mZAZdaG4Nb6I/edit?gid=0#gid=0
.
Remeber to rotate!
expires May 16, 2027
https://www.nremt.org/Pages/Examinations/EMR-and-EMT-Certification-Examinations