Welcome to the ContextStream documentation. This directory contains all architectural decisions, design specifications, and implementation guides.
-
- 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
-
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-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/ π¨
- 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
-
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
-
Learn the Architecture
- Read ARCHITECTURE_NEXTJS.md (Sections 1-3)
- Understand Next.js structure, tech stack, and API design
-
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
-
Review Design Specs
- Browse design/ to understand UI/UX patterns
- Use wireframes as reference during implementation
Priority reading order:
- design/design-system.md - Component specs
- design/user-flows.md - Interaction patterns
- design/wireframes.md - Page layouts
- ARCHITECTURE_NEXTJS.md - Section 5 (Frontend Architecture)
Priority reading order:
- GLOBAL_SOURCE_ARCHITECTURE.md - Start here!
- ARCHITECTURE_NEXTJS.md - Sections 2-4 (Data, API, Core Features)
- product-manager-output.md - Feature specs
Priority reading order:
- product-manager-output.md - User stories
- design/user-flows.md - User journeys
- design/wireframes.md - UI layouts
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β 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 β ββββββββββββββββββββ βββββββββββββββββββββββββ
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
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
Without global sources:
100 workspaces Γ React docs (500MB) = 50GB total
With global sources:
1 Γ React docs (500MB) = 500MB total Savings: 49.5GB (99%)
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 |
- Database schema with global sources
- Permission system (roles + RBAC)
- Basic API endpoints
- Authentication (NextAuth)
- Source management (add, update, delete)
- Web scraping pipeline
- Embedding generation
- Hybrid search
- Admin dashboard
- Source promotion workflow
- Usage analytics
- User management
- Dashboard UI
- Source management UI
- Search interface
- Admin UI
- Testing (unit, integration, E2E)
- Documentation
- Performance optimization
- Production deployment
-
Include a header with:
- Document version
- Last updated date
- Status (Draft, Review, Approved, Implemented)
-
Add to this index (docs/README.md)
-
Link from related documents
-
Use consistent formatting:
- Markdown format
- Code blocks with language tags
- Clear section headers
- Examples for complex concepts
- Update "Last Updated" date in header
- Add changelog entry at bottom (optional for major changes)
- Update related documents if necessary
- Notify team of breaking changes
- Create a new markdown file in
docs/
- Follow the format of existing docs
- Include:
- Problem statement
- Proposed solution
- Trade-offs
- Migration strategy (if applicable)
- Submit for team review
- Unclear documentation: Open an issue
- Missing information: Open an issue or PR
- Incorrect information: Open a PR with correction
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
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
Last Updated: 2025-01-09 Maintained By: Engineering Team