Go to file
2026-02-12 16:16:54 -08:00
.github docs: add .cursorrules and .github/copilot-instructions.md 2026-02-12 12:55:32 -08:00
docs docs(roadmap): address 15 gaps found via codebase cross-reference 2026-02-12 10:55:03 -08:00
packages feat(logger): add @bytelyst/logger shared package 2026-02-12 15:35:27 -08:00
scripts feat: add Husky git hooks with enable/disable flag 2026-02-12 16:08:30 -08:00
services fix: replace Math.random() IDs with crypto.randomUUID() across all services 2026-02-12 13:03:09 -08:00
.aider.conf.yml docs: add missing agent configs (.windsurfrules, .clinerules, .aider.conf.yml) 2026-02-12 15:21:53 -08:00
.clinerules docs: add missing agent configs (.windsurfrules, .clinerules, .aider.conf.yml) 2026-02-12 15:21:53 -08:00
.cursorrules docs: add .cursorrules and .github/copilot-instructions.md 2026-02-12 12:55:32 -08:00
.editorconfig chore(scaffold): initialize pnpm workspace with build tooling 2026-02-12 11:19:29 -08:00
.env.example refactor(services): rewire lib/ to @bytelyst/* packages + add docker-compose 2026-02-12 11:49:42 -08:00
.gitignore chore(scaffold): initialize pnpm workspace with build tooling 2026-02-12 11:19:29 -08:00
.nvmrc chore(scaffold): initialize pnpm workspace with build tooling 2026-02-12 11:19:29 -08:00
.prettierrc feat: add quick wins - prettier, bundle limits, coverage 2026-02-12 15:54:06 -08:00
.windsurfrules docs: add missing agent configs (.windsurfrules, .clinerules, .aider.conf.yml) 2026-02-12 15:21:53 -08:00
AGENTS.md docs: update agent docs via /update-agent-docs 2026-02-12 15:31:20 -08:00
CLAUDE.md docs: add AGENTS.md and CLAUDE.md for AI coding agent onboarding 2026-02-12 12:51:39 -08:00
docker-compose.yml refactor(services): rewire lib/ to @bytelyst/* packages + add docker-compose 2026-02-12 11:49:42 -08:00
eslint.config.js feat: tighten production-readiness workflow 2026-02-12 15:49:46 -08:00
package.json feat: add Husky git hooks with enable/disable flag 2026-02-12 16:08:30 -08:00
pnpm-lock.yaml feat: tighten production-readiness workflow 2026-02-12 15:49:46 -08:00
pnpm-workspace.yaml feat(services): add monitoring (Loki + Grafana config, health-check) 2026-02-12 11:39:24 -08:00
README.md docs: update README with services section and full repo structure 2026-02-12 11:40:15 -08:00
test.js test: husky in common_plat 2026-02-12 16:16:54 -08:00
tsconfig.base.json chore(scaffold): initialize pnpm workspace with build tooling 2026-02-12 11:19:29 -08:00
vitest.config.ts feat: tighten production-readiness workflow 2026-02-12 15:49:46 -08:00

@bytelyst/common-platform

Shared packages and product-agnostic microservices for the ByteLyst ecosystem — used by LysnrAI and MindLyst.

Repository Structure

learning_ai_common_plat/
├── packages/                    # Shared libraries (@bytelyst/*)
│   ├── errors/                  # Typed HTTP service errors (400429)
│   ├── cosmos/                  # Azure Cosmos DB client + container registry
│   ├── config/                  # Zod env loader + product identity
│   ├── auth/                    # JWT, middleware, password hashing
│   ├── api-client/              # Configurable fetch wrapper
│   ├── react-auth/              # React auth context factory
│   └── design-tokens/           # Cross-platform tokens (JSON → CSS/TS/Kotlin/Swift)
├── services/                    # Product-agnostic microservices
│   ├── platform-service/        # Auth, audit, flags, notifications, blob (port 4003)
│   ├── billing-service/         # Subscriptions, Stripe, usage, licenses (port 4002)
│   ├── growth-service/          # Invitations, referrals, promos (port 4001)
│   ├── tracker-service/         # Items, comments, votes, public roadmap (port 4004)
│   └── monitoring/              # Loki + Grafana config, health-check
└── docs/                        # Architecture docs, roadmap, analysis

Shared Libraries

Package Description Peer Dependencies
@bytelyst/errors Typed HTTP service errors (400429)
@bytelyst/cosmos Azure Cosmos DB client singleton + container registry @azure/cosmos
@bytelyst/config Zod-based env config loader + product identity zod
@bytelyst/auth JWT utilities, auth middleware, password hashing jose, bcryptjs
@bytelyst/api-client Configurable fetch wrapper with auth token injection
@bytelyst/react-auth React auth context factory (typed provider + hook) react
@bytelyst/design-tokens Cross-platform design tokens (JSON → CSS/TS/Kotlin/Swift)

Shared Services

Service Port Description Tests
platform-service 4003 Auth, audit, feature flags, notifications, blob storage 55
billing-service 4002 Subscriptions, Stripe webhooks, usage tracking, licenses, plans 32
growth-service 4001 Invitations, referrals, promo codes 33
tracker-service 4004 Feature requests, bugs, tasks, public roadmap 45
monitoring Loki + Grafana dashboards, health-check script

All services are product-agnostic — every Cosmos document includes a productId field, so a single deployment serves LysnrAI, MindLyst, or any future product.

Quick Start

# Install dependencies
pnpm install

# Build all packages + services
pnpm build

# Run all tests (165 total across packages + services)
pnpm test

# Type-check all packages
pnpm typecheck

# Run a specific service in dev mode
pnpm --filter @lysnrai/platform-service dev

Consuming Libraries from Product Repos

During development, use file: references in consumer package.json:

// From a Next.js dashboard at repo root (2 levels up):
"@bytelyst/errors": "file:../../learning_ai_common_plat/packages/errors"

// From MindLyst web (3 levels up — inside mindlyst-native/web/):
"@bytelyst/design-tokens": "file:../../../learning_ai_common_plat/packages/design-tokens"

All repos must be cloned side-by-side under the same parent directory.

Design Tokens

Generate platform-specific token files from the canonical JSON:

cd packages/design-tokens
pnpm generate

Outputs in packages/design-tokens/generated/:

  • tokens.css — CSS custom properties (--ml-*)
  • tokens.ts — TypeScript constants
  • MindLystTokens.kt — Kotlin object for KMP
  • MindLystTheme.swift — Swift structs for SwiftUI

Roadmap

See docs/ROADMAP.md for the full phased extraction plan.