Skip to content

jimseiwert/context-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ContextStream Documentation

Welcome to the ContextStream documentation. This directory contains all architectural decisions, design specifications, and implementation guides.

πŸ“š Documentation Index

Core Architecture

  1. ARCHITECTURE_NEXTJS.md ⭐

    • Full-stack Next.js 14+ architecture
    • Technology stack and directory structure
    • Baseline Prisma schema
    • API design and implementation patterns
    • Deployment strategies (Docker, Vercel)
    • Start here for understanding the overall system
  2. GLOBAL_SOURCE_ARCHITECTURE.md πŸ”₯

    • Enhanced data model with source sharing
    • Global vs workspace-scoped sources
    • Role-based access control (SUPER_ADMIN, ADMIN, USER)
    • Storage deduplication (99% savings on popular sources)
    • Admin tools for managing sources
    • Complete migration guide
    • Critical for production implementation

Product & Requirements

  1. product-manager-output.md πŸ“‹
    • User personas (AI-First Developer, DevRel Engineer, etc.)
    • Feature specifications (MVP through Phase 4)
    • User stories and acceptance criteria
    • Success metrics and KPIs
    • Competitive analysis
    • Go-to-market strategy

Design System

  1. design/ 🎨
    • design-system.md - Colors, typography, components
    • user-flows.md - Detailed user journeys
    • wireframes.md - Page layouts (text-based)
    • accessibility-guidelines.md - WCAG 2.1 AA compliance
    • README.md - Design system overview

πŸš€ Quick Start Guide

For New Developers

  1. Understand the Product

    • Read product-manager-output.md (Executive Summary + User Personas)
    • Understand the problem we're solving and who we're solving it for
  2. Learn the Architecture

  3. Critical: Global Sources

    • Must read: GLOBAL_SOURCE_ARCHITECTURE.md
    • This is the production data model - the baseline in ARCHITECTURE_NEXTJS.md is for reference only
    • Understand source scoping, permissions, and storage efficiency
  4. Review Design Specs

    • Browse design/ to understand UI/UX patterns
    • Use wireframes as reference during implementation

For Frontend Engineers

Priority reading order:

  1. design/design-system.md - Component specs
  2. design/user-flows.md - Interaction patterns
  3. design/wireframes.md - Page layouts
  4. ARCHITECTURE_NEXTJS.md - Section 5 (Frontend Architecture)

For Backend Engineers

Priority reading order:

  1. GLOBAL_SOURCE_ARCHITECTURE.md - Start here!
  2. ARCHITECTURE_NEXTJS.md - Sections 2-4 (Data, API, Core Features)
  3. product-manager-output.md - Feature specs

For Product/UX

Priority reading order:

  1. product-manager-output.md - User stories
  2. design/user-flows.md - User journeys
  3. design/wireframes.md - UI layouts

πŸ“– Document Relationships

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Product Requirements β”‚ β”‚ (product-manager-output.md) β”‚ β”‚ β€’ User personas β”‚ β”‚ β€’ Feature specs β”‚ β”‚ β€’ Success metrics β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ UX/UI Design β”‚ β”‚ Architecture β”‚ β”‚ (design/) β”‚ β”‚ (ARCHITECTURE_*) β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Components β”‚ β”‚ β€’ Data models β”‚ β”‚ β€’ User flows β”‚ β”‚ β€’ API design β”‚ β”‚ β€’ Wireframes β”‚ β”‚ β€’ Tech stack β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Baseline Schema β”‚ β”‚ Global Source Model β”‚ β”‚ (Reference) β”‚ β”‚ (PRODUCTION) β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Simple model β”‚ β”‚ β€’ Source sharing β”‚ β”‚ β€’ 1:1 workspace β”‚ β”‚ β€’ RBAC β”‚ β”‚ to source β”‚ β”‚ β€’ Deduplication β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 

πŸ”‘ Key Concepts

Source Scoping (CRITICAL)

Global Sources:

  • Shared across all workspaces
  • Admin-managed and curated
  • Stored once, referenced many times
  • Example: React docs, Python docs, TypeScript docs
  • 99% storage savings for popular documentation

Workspace Sources:

  • Private to specific workspace
  • User-managed
  • Can be promoted to global by admins
  • Example: Internal wikis, client-specific docs

User Roles

SUPER_ADMIN:

  • Full system access
  • Manage global sources
  • Manage user roles
  • View all workspaces

ADMIN:

  • Manage global sources
  • Promote/demote sources
  • View usage analytics

USER:

  • Manage workspace sources
  • Access global sources
  • Standard user features

Storage Efficiency

Without global sources:

100 workspaces Γ— React docs (500MB) = 50GB total 

With global sources:

1 Γ— React docs (500MB) = 500MB total Savings: 49.5GB (99%) 

πŸ“Š Implementation Status

Component Status Documentation
Product Requirements βœ… Complete product-manager-output.md
Architecture Design βœ… Complete ARCHITECTURE_NEXTJS.md
Global Source Design βœ… Complete GLOBAL_SOURCE_ARCHITECTURE.md
UX/UI Design βœ… Complete design/
Database Schema πŸ“ Planned See GLOBAL_SOURCE_ARCHITECTURE.md
API Implementation πŸ“ Planned See ARCHITECTURE_NEXTJS.md
Frontend Implementation πŸ“ Planned See design/
Testing Strategy πŸ“ Planned All docs include testing sections

πŸ› οΈ Implementation Roadmap

Phase 1: Foundation (Weeks 1-4)

  • Database schema with global sources
  • Permission system (roles + RBAC)
  • Basic API endpoints
  • Authentication (NextAuth)

Phase 2: Core Features (Weeks 5-8)

  • Source management (add, update, delete)
  • Web scraping pipeline
  • Embedding generation
  • Hybrid search

Phase 3: Admin Tools (Weeks 9-12)

  • Admin dashboard
  • Source promotion workflow
  • Usage analytics
  • User management

Phase 4: Frontend (Weeks 13-16)

  • Dashboard UI
  • Source management UI
  • Search interface
  • Admin UI

Phase 5: Polish & Launch (Weeks 17-20)

  • Testing (unit, integration, E2E)
  • Documentation
  • Performance optimization
  • Production deployment

πŸ“ Documentation Standards

When Creating New Documents

  1. Include a header with:

    • Document version
    • Last updated date
    • Status (Draft, Review, Approved, Implemented)
  2. Add to this index (docs/README.md)

  3. Link from related documents

  4. Use consistent formatting:

    • Markdown format
    • Code blocks with language tags
    • Clear section headers
    • Examples for complex concepts

When Updating Documents

  1. Update "Last Updated" date in header
  2. Add changelog entry at bottom (optional for major changes)
  3. Update related documents if necessary
  4. Notify team of breaking changes

🀝 Contributing

Proposing Architecture Changes

  1. Create a new markdown file in docs/
  2. Follow the format of existing docs
  3. Include:
    • Problem statement
    • Proposed solution
    • Trade-offs
    • Migration strategy (if applicable)
  4. Submit for team review

Reporting Issues

  • Unclear documentation: Open an issue
  • Missing information: Open an issue or PR
  • Incorrect information: Open a PR with correction

πŸ“ž Getting Help

Architecture Questions:

  • Refer to ARCHITECTURE_NEXTJS.md and GLOBAL_SOURCE_ARCHITECTURE.md
  • Check the implementation examples in each doc

Design Questions:

  • Refer to design/ directory
  • Check wireframes and user flows

Product Questions:

  • Refer to product-manager-output.md
  • Check user stories and acceptance criteria

Still Stuck?

  • Ask in team chat
  • Schedule architecture review meeting
  • Open a discussion issue

🎯 Success Metrics

We measure documentation quality by:

βœ… Clarity: New developers can understand the system in < 1 day βœ… Completeness: All major decisions are documented βœ… Accuracy: Documentation matches implementation βœ… Maintainability: Easy to update as system evolves βœ… Discoverability: Easy to find relevant information


πŸ“š External Resources

Next.js

Prisma

shadcn/ui

Authentication


Last Updated: 2025-01-09 Maintained By: Engineering Team

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages