Instafication is a smart notification service that monitors booking systems and instantly alerts you via SMS or email when new appointment slots become available. Never miss a booking opportunity again!
- π Real-time Notifications - Get instant SMS/email alerts when bookings become available
- π Multi-Service Support - Monitor laundry, parking, rental bookings and more
- π Internationalization - Available in multiple languages (Swedish, English)
- π³ Flexible Pricing - Pay-per-use or monthly subscription options
- π± Responsive Design - Works seamlessly on desktop and mobile
- π Secure Authentication - Google OAuth and email/password login
- β‘ High-Performance Scraping - Efficient monitoring with configurable intervals
- π― Smart Filtering - Get notifications only for your preferred areas and timeframes
- Node.js 22.x or higher (Bun 1.2+ recommended)
- Cloudflare D1 database
- BetterAuth (email/password) with Drizzle ORM
- Stripe account (for payments)
-
Clone the repository
git clone https://github.com/instafication/frontend.git cd frontend
-
Install dependencies
bun install
-
Set up environment variables Create a
.env
file in the root directory (values are examples):BETTER_AUTH_SECRET=your_random_secret # Public analytics (optional) PUBLIC_POSTHOG_KEY=phc_xxx PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
-
Set up the database
# Generate migrations from the Drizzle schema bun run generate # Apply to the local SQLite file (dev.db) or to D1 if configured bun run push
-
Apply D1 migrations (remote D1) If you're targeting a remote Cloudflare D1, ensure you have valid credentials in
wrangler.toml
or env variables used bydrizzle.config.ts
, then:bun run migrate:prod
-
Start the development server
# Option A: Vite dev server (no CF bindings, good for UI work) bun run dev # Option B: Full Cloudflare Workers dev with D1 bindings bunx wrangler dev --x-remote-bindings --port=5173 --local --persist-to=.wrangler/state
Visit http://localhost:5173
to see the application running!
bun run build
- Build for productionbun run dev
- Start development serverbun run deploy
- Deploy project to Cloudflare
src/
βββ lib/
β βββ Components/ # Reusable Svelte components
β βββ Managers/ # Business logic managers
β βββ server/ # Server-side utilities
β βββ i18n.ts # Internationalization
β βββ translations.ts # Translation strings
βββ routes/
β βββ +layout.svelte # Main layout
β βββ +page.svelte # Landing page
β βββ [...api]/ # API routes
β βββ payment/ # Payment handling
β βββ webhook/ # Webhook endpoints
βββ app.html # HTML template
- Frontend: SvelteKit with TypeScript
- Styling: Tailwind CSS + Flowbite + Bits UI/shadcn-svelte ports
- Database: Cloudflare D1 with Drizzle ORM
- Authentication: BetterAuth (D1 + Drizzle)
- Payments: Stripe integration
- Deployment: Cloudflare Workers support
- Email: Resend integration
- Email/password is enabled with BetterAuth. In development, email verification is disabled.
- On successful signβup, a session cookie is set and the UI autoβlogs in. No activation email is sent in dev.
- Key endpoints (served under
basePath
/api/auth
):- POST
/api/auth/sign-up/email
with{ email, password }
- POST
/api/auth/sign-in/email
with{ email, password }
- POST
Core tables include:
- Product tables:
profiles
,services
,scrapers
,notifications
- Auth tables (BetterAuth):
users
,sessions
,accounts
,verifications
,apikeys
Generated auth schema lives at drizzle/generated.auth.schema.ts
. If you upgrade BetterAuth and need to refresh the schema, regenerate with the BetterAuth CLI.
Users can configure:
- Notification method (Email)
- Notification timing (1 hour, 1 day, 2 days in advance)
- Service areas (e.g., specific housing areas)
- Service types (laundry, parking, rentals)
Administrators can configure:
- Scraping frequency (minutes)
- Target companies/services
- Service parameters
- Monitoring areas
- Install Wrangler:
bun i -g wrangler
- Configure
wrangler.toml
- Run:
bun run deploy
Optional envs used by drizzle.config.ts
when pushing via HTTP driver:
export DRIZZLE_USE_D1=1
export CLOUDFLARE_ACCOUNT_ID=...
export CLOUDFLARE_DATABASE_ID=...
export CLOUDFLARE_D1_TOKEN=...
- If signβup returns 4xx due to schema mismatches, regenerate and push migrations, then apply to remote D1:
bun run generate && bun run push
(local) orbun run migrate:prod
(remote)
- To inspect D1 during dev:
wrangler d1 execute prod --remote --command "PRAGMA table_info('users');"
Instafication offers two pricing tiers:
- Pay-per-notification: 9 SEK for 2 notifications
- Monthly subscription: 19 SEK/month for unlimited notifications (30-day free trial)
Currently supports:
- Stockholms StudentbostΓ€der (SSSB) - Laundry booking monitoring
- More services coming soon!
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Use TypeScript for all new code
- Follow the existing code formatting (Rome)
- Add JSDoc comments for complex functions
- Use semantic commit messages
- Stripe payment webhooks
- Notification delivery webhooks
- All API routes are protected with authentication
- Sensitive data is encrypted
- CORS properly configured
- Rate limiting on API endpoints
MIT License β see LICENSE
for details.
Made with β€οΈ by the Instafication team