Project Overview: Constellation Front-end
Project Vision & Goals
Constellation is a comprehensive web application platform designed to provide users with collaborative workspace tools, rich content editing capabilities, and visual data representation. The front-end application serves as the primary user interface for interacting with the Constellation ecosystem.
Core Objectives
- Provide a Seamless Collaborative Experience - Users can work together in real-time with synchronized data
- Enable Rich Content Creation - Advanced text editing with media, formatting, and embedding capabilities
- Visualize Complex Data - Interactive graphs and mapping tools for data exploration
- Support Multi-tenant Architecture - Isolated workspaces and admin controls
- Ensure Accessibility & Performance - Fast, responsive, and accessible to all users
- Enable Global Reach - Multi-language support from day one
Architecture Overview
Frontend Stack
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Constellation Front-end โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Next.js 15 (React 19) โ
โ โโ App Router โ
โ โโ API Routes โ
โ โโ Image Optimization โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Components & Hooks โ
โ โโ Shadcn/ui Components โ
โ โโ Custom React Components โ
โ โโ Custom Hooks โ
โ โโ Context Providers โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Features โ
โ โโ Rich Text Editor (Plate.js) โ
โ โโ Workspace Management โ
โ โโ Dashboard & Analytics โ
โ โโ Admin Panel โ
โ โโ Homepage & Marketing โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Services & Utilities โ
โ โโ API Client โ
โ โโ Authentication โ
โ โโ i18n (Internationalization) โ
โ โโ Form Validation (Zod) โ
โ โโ Utilities & Helpers โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Styling & Design โ
โ โโ Tailwind CSS โ
โ โโ PostCSS โ
โ โโ Component Theme System โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Testing & Quality โ
โ โโ Vitest โ
โ โโ Testing Library โ
โ โโ MSW (Mock Service Worker) โ
โ โโ ESLint โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Microservices Integration
The front-end communicates with multiple backend services:
Constellation Front-end
โโ Neo4j API (Graph Database)
โ โโ localhost:8000
โโ Main API (Core Business Logic)
โ โโ localhost:8001
โโ SSE Service (Real-time Events)
โ โโ localhost:8002
โโ Hocuspocus (CRDT Sync)
โ โโ ws://localhost:8003
โโ AI API (AI/ML Features)
โโ localhost:8004
Key Features
1. Rich Text Editor
- Engine: Plate.js (Slate-based)
- Capabilities:
- Block editing with multiple node types
- Formatting (bold, italic, underline, code)
- Lists, tables, code blocks
- Media embedding (images, videos)
- Mentions, emojis, slash commands
- Comments and collaborative editing
- Location: src/components/editor
2. Workspace Management
- Multi-workspace Support: Users can create and manage multiple workspaces
- Real-time Collaboration: Synchronized edits across team members
- Permissions: Role-based access control (admin, editor, viewer)
- Location: src/features/workspace
3. Dashboard & Analytics
- User Dashboard: Personal workspace overview
- Analytics: Project statistics and usage metrics
- Graph Visualization: Interactive network and data visualization
- Location: src/components/dashboard
4. Admin Panel
- User Management: Create, edit, delete users
- Content Moderation: Review and manage user content
- System Settings: Configure application behavior
- Location: src/components/admin
5. Authentication & Authorization
- OAuth Integration: Google OAuth support
- Session Management: Secure token handling
- Role-based Access: Admin, workspace owner, member roles
- Location: src/lib/auth.ts
6. Internationalization
- Supported Languages: English, French
- Dynamic Language Switching: Change language on-the-fly
- Translation Management: i18n configuration
- Location: src/i18n
Project Structure
constellation/
โโโ src/
โ โโโ app/ # Next.js App Router pages
โ โ โโโ (admin)/ # Admin-protected routes
โ โ โโโ (www)/ # Public routes
โ โ โโโ api/ # API routes
โ โ โโโ dashboard/ # User dashboard
โ โ โโโ workspace/ # Workspace pages
โ โ
โ โโโ components/ # Reusable React components
โ โ โโโ admin/ # Admin-specific components
โ โ โโโ common/ # Shared components
โ โ โโโ context/ # Context providers
โ โ โโโ dashboard/ # Dashboard components
โ โ โโโ editor/ # Editor components (Plate.js)
โ โ โโโ forms/ # Form components
โ โ โโโ graph/ # Graph visualization
โ โ โโโ mapEditor/ # Map editor components
โ โ โโโ navigation/ # Navigation components
โ โ โโโ plate-ui/ # Plate.js UI components
โ โ โโโ ui/ # Shadcn/ui components
โ โ
โ โโโ features/ # Feature-level logic
โ โ โโโ homepage/ # Homepage feature
โ โ โโโ workspace/ # Workspace feature
โ โ
โ โโโ hooks/ # Custom React hooks
โ โ โโโ use-admin-ping.tsx
โ โ โโโ use-copy-to-clipboard.tsx
โ โ โโโ use-custom-chat.tsx
โ โ โโโ use-debounce.ts
โ โ โโโ use-is-admin.tsx
โ โ โโโ use-mobile.tsx
โ โ โโโ use-mounted.tsx
โ โ โโโ use-yjs.tsx
โ โ โโโ ...
โ โ
โ โโโ i18n/ # Internationalization
โ โ โโโ i18n.js
โ โ
โ โโโ lib/ # Utilities and libraries
โ โ โโโ auth.ts
โ โ โโโ api.ts # API client
โ โ โโโ utils.ts
โ โ โโโ schemas/ # Zod validation schemas
โ โ โโโ ...
โ โ
โ โโโ services/ # API services
โ โ โโโ apiClient.ts
โ โ โโโ token.ts
โ โ โโโ admin/
โ โ
โ โโโ types/ # TypeScript type definitions
โ โ โโโ chat.ts
โ โ โโโ data.ts
โ โ โโโ ...
โ โ
โ โโโ test/ # Test utilities and setup
โ โ โโโ mocks/
โ โ โ โโโ server.ts
โ โ โ โโโ handlers.ts
โ โ โโโ test-utils.tsx
โ โ
โ โโโ app.css # Global styles
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Root page
โ
โโโ public/ # Static assets
โ โโโ fonts/
โ โโโ images/
โ โโโ locales/ # i18n JSON files
โ โโโ logos/
โ
โโโ docs/ # Documentation (this folder)
โโโ coverage/ # Test coverage reports
โโโ build/ # Build output
โ
โโโ tailwind.config.ts # Tailwind configuration
โโโ tsconfig.json # TypeScript configuration
โโโ next.config.mjs # Next.js configuration
โโโ eslint.config.mjs # ESLint configuration
โโโ vitest.config.ts # Vitest configuration
โโโ package.json # Dependencies and scripts
โโโ README.md # Project README
Development Workflow
1. Feature Development
1. Create feature branch
2. Implement feature in src/
3. Write tests
4. Run linter
5. Create pull request
6. Code review
7. Merge to main
8. Deploy
2. Code Organization
- Components - Pure presentation logic
- Hooks - Reusable state and side effects
- Services - API communication
- Utils - Helper functions
- Types - TypeScript definitions
3. Testing Strategy
- Unit Tests - Test individual functions and hooks
- Component Tests - Test component rendering and interaction
- Integration Tests - Test feature workflows
- E2E Tests - Test complete user journeys (future)
Performance Considerations
Optimization Strategies
- Code Splitting - Next.js automatic route-based splitting
- Image Optimization - Next.js Image component
- Component Lazy Loading - React.lazy for heavy components
- Memoization - React.memo for expensive renders
- Server-side Rendering - Next.js SSR for fast initial load
- Static Generation - Pre-render static pages
Monitoring
- Bundle Size - Monitor with
@next/bundle-analyzer - Performance Metrics - Core Web Vitals tracking
- Error Tracking - Integration with error monitoring service
- User Analytics - Hotjar integration
Deployment Pipeline
Development Branch
โ
Feature Branch + PR
โ
Code Review + Tests
โ
Merge to Main
โ
Build Process
โ
Staging Environment
โ
Production Deployment
See DEPLOYMENT.md for detailed deployment instructions.
Related Documentation
- ๐ ARCHITECTURE.md - Deep dive into system design
- ๐ง SETUP_GUIDE.md - Environment setup
- ๐ QUICK_START.md - Get started in 10 minutes
- ๐ COMPONENTS.md - Component library
Glossary
| Term | Definition |
|---|---|
| SSR | Server-Side Rendering - rendering React on the server |
| CRDT | Conflict-free Replicated Data Type - for collaborative editing |
| i18n | Internationalization - multi-language support |
| RBAC | Role-Based Access Control - permission system |
| MSW | Mock Service Worker - API mocking for tests |
| Zod | TypeScript-first schema validation library |
Last Updated: January 2026
Maintained By: Constellation Team