A W3C Design Tokens-compliant platform for managing design tokens with GitHub integration and multi-platform distribution.
This platform serves as a centralized design token management system where:
- Design teams can create and edit tokens through a web UI
- Tokens are stored in GitHub as the single source of truth (W3C 2025.10 format)
- Multiple platforms (Web, Flutter, etc.) consume tokens from GitHub
- Optional Figma plugin allows editing tokens directly from Figma
Stack:
- Frontend: SvelteKit (Vite)
- Backend: Strapi 5.6.0 (Headless CMS)
- Database: SQLite (dev), can be swapped for PostgreSQL/MySQL (prod)
- Authentication: GitHub OAuth
- Token Format: W3C Design Tokens Spec 2025.10
Flow:
User β SvelteKit UI β Strapi API β SQLite (Draft State)
β
GitHub Repo (Published State, W3C JSON)
β
Consumers (Web, Flutter, Figma, etc.)
- β GitHub OAuth login
- β JWT stored in httpOnly cookies for security
- β GitHub access token stored in httpOnly cookies
- β
Custom
jwt-cookiemiddleware for Strapi authentication
- β Create new GitHub repositories via UI
- β Connect to existing GitHub repositories
- β Searchable repository list with live filtering
- β Custom scrollbar styling matching design system
-
β Design System
- Fields:
name,slug,repo_owner,repo_name,branch,tokens_path,resolver_path - Tracks:
last_published_commit_sha,last_published_at,last_synced_at
- Fields:
-
β Token Collection (maps to W3C "groups")
- Fields:
name,key,description,design_system(relation) - Examples: Colors, Typography, Spacing
- Fields:
-
β Token (W3C Design Token)
- Fields:
name,full_path,group_path,type,value(JSON),description - Supports:
deprecated,alias_to,extensions - Types: color, dimension, fontFamily, fontWeight, duration, typography, shadow, gradient, etc.
- Fields:
- β
POST /api/github/create-repo- Create new GitHub repository - β
GET /api/github/repos- List user's GitHub repositories - β
POST /api/design-system/connect- Connect repo & create Design System + default collections - β Full CRUD endpoints for Design Systems, Token Collections, Tokens (via Strapi)
All endpoints secured with proper role-based permissions for "Authenticated" users.
- π Migrating from
collections.json(local file) to Strapi API - Components to update:
- Sidebar (fetch collections from Strapi)
- TokenModal (POST/PUT tokens to Strapi)
- Token list pages (fetch from Strapi)
- "Publish Changes" button in UI
- Strapi reads draft tokens β generates W3C JSON β commits to GitHub
- Revision history (Git commit log)
- Rollback capability
- Parse existing W3C tokens from GitHub when connecting repo
- Sync GitHub β Strapi on initial connection
- Extract Figma variables/styles
- Convert to W3C tokens
- Push to Strapi β GitHub
- Style Dictionary integration
- Generate platform-specific outputs (CSS, Dart, Swift, etc.)
Design-System-Docs/
βββ backend/ # Strapi backend
β βββ src/
β β βββ api/
β β β βββ design-system/ # Design System content type
β β β βββ token-collection/
β β β βββ token/
β β β βββ github/ # GitHub integration controllers
β β βββ middlewares/
β β β βββ jwt-cookie.ts # Custom JWT authentication
β β β βββ github-callback.ts
β β βββ index.ts # Permissions setup
β βββ .env # GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET
β
βββ frontend/ # SvelteKit frontend
β βββ src/
β β βββ routes/
β β β βββ (protected)/
β β β β βββ setup/ # Repository connection UI
β β β β βββ dashboard/ # Token management UI
β β β βββ +page.server.ts # OAuth callback handler
β β β βββ +layout.svelte
β β βββ lib/
β β β βββ api/strapi.ts # Strapi API client
β β β βββ components/ # Reusable UI components
β β βββ hooks.server.ts # Auth hooks
β βββ vite.config.ts
β
βββ README.md
- Node.js >= 18
- GitHub OAuth App credentials
-
Clone the repository
git clone <your-repo-url> cd Design-System-Docs
-
Backend Setup
cd backend npm install # Create .env file echo "GITHUB_CLIENT_ID=your_client_id" > .env echo "GITHUB_CLIENT_SECRET=your_client_secret" >> .env npm run develop
Backend runs on
http://localhost:1337 -
Frontend Setup
cd frontend npm install npm run devFrontend runs on
http://localhost:5173 -
Login
- Navigate to
http://localhost:5173 - Click "Connect with GitHub"
- Authorize the OAuth app
- Navigate to
- Use Tailwind CSS for utility-first styling
- Leverage Shadcn components from
$lib/components/ui - Organize classes using
cn()utility from$lib/utils
Define CSS variables without color space function:
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;Usage:
<div class="bg-primary text-primary-foreground">Hello</div>Key color variables:
--background,--foreground: Default body colors--muted,--muted-foreground: Muted backgrounds--card,--card-foreground: Card backgrounds--primary,--primary-foreground: Primary button colors--accent,--accent-foreground: Accent colors--destructive,--destructive-foreground: Destructive actions--ring: Focus ring color--radius: Border radius for components
This project follows the official W3C Design Tokens specification:
- Spec: https://tr.designtokens.org/format/
- Schema: https://www.designtokens.org/schemas/2025.10/format.json
{
"$schema": "https://www.designtokens.org/technical-reports/",
"color": {
"brand": {
"primary": {
"$type": "color",
"$value": {
"colorSpace": "srgb",
"hex": "#0057FF"
},
"$description": "Primary brand color"
}
}
}
}- JWT & GitHub tokens stored in httpOnly cookies (not accessible via JavaScript)
- CORS configured with
credentials: true - Role-based permissions in Strapi for all API endpoints
This project is in active development. Current focus: Dashboard migration to Strapi.
[Your License Here]
Last Updated: November 28, 2025
Status: Phase 1 (Repository Connection) β
Complete | Phase 2 (Dashboard Migration) π§ In Progress
one question, we generate the collections when we create a new repo right?
but lets assume we still have a repo somewhere and we want a design system for it, so when we