Skip to content

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

  1. Provide a Seamless Collaborative Experience - Users can work together in real-time with synchronized data
  2. Enable Rich Content Creation - Advanced text editing with media, formatting, and embedding capabilities
  3. Visualize Complex Data - Interactive graphs and mapping tools for data exploration
  4. Support Multi-tenant Architecture - Isolated workspaces and admin controls
  5. Ensure Accessibility & Performance - Fast, responsive, and accessible to all users
  6. 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

  1. Code Splitting - Next.js automatic route-based splitting
  2. Image Optimization - Next.js Image component
  3. Component Lazy Loading - React.lazy for heavy components
  4. Memoization - React.memo for expensive renders
  5. Server-side Rendering - Next.js SSR for fast initial load
  6. 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.



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