How heartstchr/notion-p works
Project type and purpose
• This is a full-stack, serverless web application (“Notion-P”) for handling customer service requests.
• It uses a static frontend (HTML/JS/CSS) hosted on Netlify, several Netlify Functions as the backend, Notion as the database, Netlify Blobs for file storage, and Gmail SMTP for email notifications.
File structure
• Top-level files:
• package.json / package-lock.json – project metadata and dependencies
• netlify.toml – deploy/build settings for Netlify
• env.example – shows required environment variables
• public/index.html – single-page form UI
• Netlify Functions (serverless “microservices”):
• check-status-changes.js – cron-style status watcher
• get-issue-types.js – fetches dropdown options from Notion
• serve-blob.js / upload-image.js – handles file upload via Netlify Blobs
• submit-to-notion.js – writes new requests into Notion
• email-templates.js, email-utils.js, config.js – SMTP setup and templating
• “Step-by-Step Guide” folder contains documentation, not part of runtime.
Key architectural insights from README
• Workflow:
1. Customer → fills form on the static site
2. Browser → invokes serverless functions to upload images, fetch issue types, and submit form data
3. Netlify Blob service → stores files
4. Notion API → persists request records
5. Cron-style function → polls Notion every 2 minutes for status changes
6. SMTP (Gmail) → sends update emails
• All sensitive credentials (Notion API key, DB ID, SMTP user/pass) are injected as Netlify environment variables.