Custom Logic ð
Welcome to Custom Logic, a sleek, single-file web platform designed to deliver a full SaaS experience without the usual bloat. This project is proof that you can create a modern, responsive, and highly interactive website all in one source file, while leveraging the power of the cloud.
---
ð Project Overview
Custom Logic is the web presence for the company custom-logic.co.za. It handles:
- User feedback collection
- Service orders and requests
- Clean, single-page interface
- SEO-ready architecture, fully crawlable
All of this is delivered in a single HTML/JS/CSS source file, powered by the serverless cloud.
---
ð» Tech Stack
This project isnât your average SPA. Hereâs what makes it tick:
| Layer | Technology | Notes |
|-------|------------|-------|
| Hosting | Cloudflare Pages | Single-page static hosting with lightning-fast global distribution. |
| Serverless | Cloudflare Workers | Handles dynamic actions like feedback forms, service order submissions, and virtual endpoints (/sitemap.xml
, /robots.txt
). |
| Database | GitHub as a database | All persistent storage is managed via GitHub commits + API. This means no traditional DB required â just raw CSV stored in repos. |
| Frontend | Vanilla JS + HTML + CSS | Everything lives in a single source file. Modular enough to maintain sanity, yet compact for lightning performance. |
| SEO | Pre-rendered meta tags + JSON-LD | Single-page doesnât mean invisible to search engines. SEO-ready structured data, Open Graph tags, and dynamic sitemap are served via Workers. |
---
ð§ Architecture
Hereâs the brain behind the simplicity:
1. Single-File SPA - All HTML, CSS, and JS live in one file. - Interactive sections are powered by vanilla JS. - SEO sections pre-rendered to ensure crawlability.
2. Serverless Dynamic Layer
- Cloudflare Workers intercept requests for dynamic endpoints:
- /sitemap.xml
â serves automatically generated sitemap.
- /robots.txt
â search engine instructions.
- /feedback
and /orders
â handles multi-form submissions.
- Each submission is validated, processed, and stored in CSV files on GitHub.
3. GitHub as a Backend - Workers push data to a dedicated repository branch. - Each submission creates a commit, providing version history and audit trail. - No database server required.
4. SEO & Metadata
- Structured data (JSON-LD) embedded directly in the SPA.
- Open Graph meta tags included in for social previews.
- Cloudflare Workers allow dynamic injection of per-section
and if needed.
---
â¡ Features
- Single-source SPA â lightning fast, minimal dependencies.
- Serverless feedback & order system â no backend servers.
- Multi-form handling â different solutions are routed to separate CSV files (
unicenta-pos
,funeral-manager
,jobfinders
,custom-development
). - CORS-secured â allows requests only from approved domains.
- SEO ready â sitemap, robots.txt, structured data, and pre-rendered content.
- Cloud-native â leverages Cloudflare Pages + Workers for full-stack functionality.
- GitHub as a âdatabaseâ â versioned, persistent, and auditable.
---
ð Cloudflare Worker â Multi-Form Submission
The Worker handles:
1. CORS setup for requests from custom-logic.co.za
.
2. POST-only submissions, with preflight OPTIONS support.
3. Payload validation for required fields (fullName
, email
, solution
).
4. Dynamic CSV routing per solution:
- unicenta-pos
â unicenta_pos_leads.csv
- funeral-manager
â funeral_manager_leads.csv
- jobfinders
â jobfinders_leads.csv
- custom-development
â custom_development_leads.csv
5. GitHub storage:
- Fetch existing CSV or create a new one with headers.
- Append new submission row.
- Commit changes using GitHub REST API.
6. Unique submission IDs and timestamps for tracking.
7. Error handling for invalid payloads, GitHub errors, or misconfigured environment variables.
This setup allows scalable form handling without adding backend servers, fully integrating with GitHub for persistent storage and auditing.
---
ð Deployment
1. Cloudflare Pages - Deploy the single source HTML. - Automatic global CDN distribution.
2. Cloudflare Workers
- Script intercepts dynamic routes (/sitemap.xml
, /robots.txt
, /feedback
, /orders
).
- Integrates with GitHub API to persist user submissions.
3. GitHub Integration - Workers push data to a dedicated repository branch. - Data is versioned and auditable.
---
ð SEO Strategy
Even with a single-file SPA:
- Pre-rendered
andtags for main sections.
- JSON-LD structured data for organization info.
/sitemap.xml
and/robots.txt
dynamically served via Workers.- Anchor links for in-page sections help Google crawl content.
---
ð¡ Philosophy
Custom Logic is a love letter to minimalism in web development:
- One file, one source of truth.
- Serverless logic for everything dynamic.
- GitHub as a versioned database.
- Optimized for speed, SEO, and maintainability.
If youâre a coder who likes clever, compact, cloud-first architectures, this project is a playground of ideas.
---
ð License
MIT License â go ahead, explore, fork, or remix this single-file marvel.
---
Written by a coder who genuinely enjoys building clever, minimalist, cloud-native apps.