Skip to content
Tech Stack

Backend

Overview

The backend for the MVP leverages Supabase, a powerful and modern PostgreSQL-based backend solution. Integrated with Mollie for payments, Traefik for domain management, and Tebi.io for file storage, it ensures seamless handling of authentication, file uploads, domain routing, and real-time updates.

Components and Features

1. Database and Data Management

The database is powered by Supabase (PostgreSQL), ensuring reliability and scalability.
Features:
Row-Level Security (RLS): Protects user-specific data.
Schema Design:
Users Table: Tracks user profiles and subscription plans.
Documents Table: Stores metadata and content (JSON from Editor.js).
Custom Domains Table: Maps user domains to their sites.
Real-Time Subscriptions: Powers instant updates for collaborative editing or publishing.

2. Authentication

User authentication is handled by Supabase.
Capabilities:
Email/password authentication.
Optional magic links for secure, password-free access.
GDPR Compliance:
Minimal data retention with clear consent workflows.

3. Payments with Mollie

Mollie ensures GDPR-compliant payment handling for premium subscriptions.
Subscription Features:
Tracks user payment status and enforces plan-specific limits (e.g., storage quotas, custom domains).
Updates user roles in Supabase upon successful payments.
Webhook Integration:
Mollie webhooks notify the backend of payment changes in real time.

4. File and Image Management

Files and images uploaded by users are processed and stored in Tebi.io.
File Processing Workflow:
Virus Scanning: All uploads are scanned using ClamAV or VirusTotal API to prevent malware.
Image Optimization:
Use Sharp to resize, compress, and convert images to web-friendly formats (e.g., WebP, JPEG).
Generate multiple resolutions (e.g., thumbnails, full-size) for responsive delivery.
Responsive Serving: Files are delivered via Tebi.io’s CDN.

5. Domain Routing and SSL Management

Custom and subdomain routing is handled through direct communication with Traefik.
Subdomains: Dynamically assigns subdomains like user1.blokky.site.
Custom Domains: Verifies CNAME records and automates SSL issuance with Let’s Encrypt.

6. Real-Time Features

Supabase enables real-time interactivity.
Examples:
Notify users when a page is published.
Show live updates during document editing.

7. Email Services

Transactional emails are handled using Hetzner Email and nodemailer.
Examples:
Password recovery.
Account verification or subscription updates.

API Overview

The backend exposes key functionality through Next.js API routes:
Document Management: CRUD operations and publishing as static HTML.
Domain Configuration: CNAME verification and routing updates.
Payment Handling: Mollie integration for redirects and webhooks.
Authentication: Login, signup, and password recovery endpoints.

Maintenance and Scalability

Backups: Supabase automates daily database backups.
GDPR Compliance: All data is processed with privacy-first principles.
Scalability: Easily handles increased workloads through Supabase’s managed services.

Summary

The backend architecture combines Supabase’s real-time database and authentication capabilities with Mollie for payments and Tebi.io for scalable storage. This setup supports a feature-rich, secure, and privacy-compliant backend tailored to the MVP’s needs.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.