Commit Graph

1558 Commits

Author SHA1 Message Date
saravanakumardb1
602fa50216 feat(auth): add @bytelyst/auth package
- createJwtUtils() factory with configurable issuer and expiry (jose)
- extractAuth() middleware for Fastify request auth extraction
- requireRole() guard with multi-role support
- hashPassword() / verifyPassword() via bcryptjs
- getCurrentUser() helper for Next.js API routes (generic TUser)
- AuthPayload, TokenPayload, JwtUtils types
- NO dependency on @bytelyst/config (reads JWT_SECRET from process.env directly)
- Peer deps: jose >=5.0.0, bcryptjs >=2.4.0
2026-02-12 11:19:58 -08:00
saravanakumardb1
65bf79203b feat(config): add @bytelyst/config package
- Zod-based baseEnvSchema (PORT, HOST, NODE_ENV, CORS_ORIGIN, SERVICE_NAME, COSMOS_*)
- loadConfig() with extension support for service-specific fields
- loadProductIdentity() reads product.json or falls back to env vars
- getProductId() convenience function
- Replaces 5 duplicated product-config.ts files across LysnrAI
- Peer dep: zod >=3.20.0
2026-02-12 11:19:49 -08:00
saravanakumardb1
2e9dcf49a8 feat(cosmos): add @bytelyst/cosmos package
- Singleton CosmosClient with env var config (COSMOS_ENDPOINT, COSMOS_KEY, COSMOS_DATABASE)
- Simple getContainer() for services
- Container registry with registerContainers(), getRegisteredContainer(), initializeAllContainers() for dashboards
- ContainerConfig type with partitionKeyPath and optional defaultTtl
- _resetClient() and _resetRegistry() for test isolation
- Peer dep: @azure/cosmos >=4.0.0
2026-02-12 11:19:42 -08:00
saravanakumardb1
9c0ab36171 feat(errors): add @bytelyst/errors package
- ServiceError base class with statusCode, message, details
- HTTP errors: BadRequest, Unauthorized, Forbidden, NotFound, Conflict, TooManyRequests
- 10 tests passing (vitest)
- Superset of all 4 service error files in LysnrAI
2026-02-12 11:19:35 -08:00
saravanakumardb1
d875df09a3 chore(scaffold): initialize pnpm workspace with build tooling
- Root package.json with @bytelyst/root, pnpm scripts (build, test, typecheck, clean)
- pnpm-workspace.yaml declaring packages/*
- tsconfig.base.json (ESM, strict, ES2022, NodeNext)
- vitest.config.ts (globals, node environment)
- .gitignore, .nvmrc (Node 20), .editorconfig
- README.md with package overview and quick start
2026-02-12 11:19:29 -08:00
saravanakumardb1
bf22b5ee4c docs(roadmap): address 15 gaps found via codebase cross-reference
Gap Analysis added:
- G1: Route-level import rewiring (22 error files, 13 cosmos, 34 product-config)
- G2: Existing errors.test.ts files in 3 services need updating
- G3: 5th product-config copy in user-dashboard-web
- G4/G5: Admin dashboard API routes + repositories import product-config
- G6: growth-service webhooks.ts imports product-config
- G7: file: reference paths differ (services=3 levels, dashboards=2 levels)
- G8: pnpm install + lock file steps added to each integration
- G9: Rollback strategy added to Phase 0
- G10: Git branching strategy added to Phase 0
- G11: Docker file: reference solution (pre-copy script) in Phase 5
- G12: 24 auth-context consumer files need path updates (thin re-export pattern)
- G13: MindLyst Android MindLystTheme.kt added to Phase 4
- G14: @bytelyst/auth false dep on config removed (reads JWT_SECRET from env)
- G15: Dashboard repositories (8 files) importing cosmos added to Phase 1B

Revised: ~278 tasks, ~37-51 hours estimated
2026-02-12 10:55:03 -08:00
saravanakumardb1
69f18f2588 docs: add detailed phased roadmap with task checklists
- 7 phases (0-6 + future): scaffolding, P0 packages, P1 packages, P2 packages, design tokens, CI/CD, verification
- ~150 checkboxed tasks covering extract, test, integrate, cleanup, Docker, and docs
- Dependency-ordered execution: errors → cosmos → config → auth → fastify-core → api-client → react-auth → design-tokens
- Estimated ~28-41 hours total effort
2026-02-12 10:48:38 -08:00
saravanakumardb1
a874a4332b docs: add common platform analysis, ecosystem architecture, and drawio diagram
- COMMON_PLATFORM_ANALYSIS.md: identifies 8 shared packages to extract from LysnrAI and MindLyst repos (~1,580 LOC duplication eliminated)
- ECOSYSTEM_ARCHITECTURE.md: detailed post-refactor architecture with components, services, migration plan, advantages, cautions, versioning, testing, and CI/CD impact
- ecosystem-after-refactor.drawio: 4-layer architecture diagram (clients, repos, common platform, Azure infra)
2026-02-12 10:40:28 -08:00