DTECH Student Business Hub System & ation

Student Business Management
Back to Gateway

1. Platform Overview

The DTECH Student Business Hub is a web-based marketplace and directory platform designed specifically for students to list, promote, and manage their small businesses. It functions as a centralized hub where potential customers can discover student-run services and products, while giving student entrepreneurs a professional, customizable online presence.

Target Audience:

Key Features:

---

2. Architecture & Data Flow

The platform is built using a modern, serverless architecture.

Tech Stack:

How It Works (The Data Flow):

1. Frontend to Backend Communication: The frontend vanilla JS uses the fetch() API to send asynchronous requests to the Cloudflare Worker absolute URL (https://late-frost-770c.nakiaklocko57.workers.dev).

2. Authentication: User registration hashes passwords using bcryptjs. Login generates a JWT using jose, which is stored in local storage and sent in the Authorization: Bearer <token> header for protected requests.

3. Drafting (Local vs Cloud): While going through the onboarding or editing steps, data is temporarily stored in the browser's localStorage (prefixed with onboarding_ or editor_). Once the user reaches the end and submits, it is pushed to the backend.

4. Cloudflare KV Storage Strategy:

5. Dynamic Rendering: When a request hits a specific subdomain (slug.business.dtech-services.co.za), the Cloudflare Worker intercepts it. It looks up the slug in KV, retrieves the business data, and injects it into a pre-defined HTML template shell (business-dynamic.html) generated directly by the worker.

---

3. API Requests and Endpoints

All backend logic is handled inside worker.js via the fetch event listener.

Subdomain Routing

Authentication API

Marketplace API (Public)

Dashboard & Business Management API (Protected)

Admin API (Protected)

---

4. Detailed File Breakdown

Root Configuration Files

Global Assets

Dashboard & Business Management

The Onboarding Flow (Creation)

These files represent the 7-step wizard a new user takes to create their business. Data is saved in localStorage under onboarding_ keys.

The Editor Flow (Post-Approval Updates)

These files mirror the onboarding flow exactly but are used *after* a business has been created. They use editor_ prefixes in localStorage and load existing draftVersion data from the server.

The Admin System

Dynamic Business Rendering

Image Assets

Visit Live Platform