Skip to content

Roadmap

github-actions[bot] edited this page Feb 23, 2026 · 1 revision

nself-chat: Complete Implementation Roadmap

πŸ“Š Progress Tracker

Overall Progress: 0% Complete

  • Phase 0: Foundation
  • Phase 1: First-Run Setup
  • Phase 2: Authentication
  • Phase 3: Core Chat UI
  • Phase 4: Real-time Features
  • Phase 5: Advanced Features
  • Phase 6: White-Label System
  • Phase 7: Admin Dashboard
  • Phase 8: Backend Services
  • Phase 9: Mobile & Desktop
  • Phase 10: Testing & Deployment
  • Phase 11: Documentation
  • Phase 12: Polish & Launch

Current Focus: Phase 0.0 - Environment Configuration

🎯 Goal: Zero to Production-Ready White-Label Chat Platform

🎨 Design Inspiration

  • Theme: Protocol by Tailwind UI color scheme
  • Primary: Indigo/Purple gradients
  • Dark Mode: Deep slate backgrounds
  • Accent: Cyan/Teal highlights

Phase 0: Foundation [Day 1-2]

0.0 Environment Configuration

β–‘ Backend Configuration (.backend/.env.dev updates)
  β–‘ FRONTEND_APP_1_TABLE_PREFIX=nchat_
  β–‘ FRONTEND_APP_1_DISPLAY_NAME="nself Chat"
  β–‘ FRONTEND_APP_1_SYSTEM_NAME=nchat
  β–‘ FRONTEND_APP_1_REMOTE_SCHEMA_NAME=nchat_schema

β–‘ Frontend Configuration (web/.env.local)
  β–‘ NEXT_PUBLIC_NHOST_SUBDOMAIN=localhost
  β–‘ NEXT_PUBLIC_NHOST_REGION=local
  β–‘ NEXT_PUBLIC_GRAPHQL_URL=http://api.localhost/v1/graphql
  β–‘ NEXT_PUBLIC_WS_URL=ws://api.localhost/v1/graphql
  β–‘ NEXT_PUBLIC_AUTH_URL=http://auth.localhost/v1/auth
  β–‘ NEXT_PUBLIC_STORAGE_URL=http://storage.localhost/v1/storage
  β–‘ NEXT_PUBLIC_FUNCTIONS_URL=http://functions.localhost/v1/functions

β–‘ White-label Configuration (web/.env.local)
  β–‘ NEXT_PUBLIC_APP_NAME=nchat
  β–‘ NEXT_PUBLIC_APP_TAGLINE="Team Communication Platform"
  β–‘ NEXT_PUBLIC_APP_LOGO=/logo.svg
  β–‘ NEXT_PUBLIC_APP_FAVICON=/favicon.ico
  β–‘ NEXT_PUBLIC_THEME_PRIMARY=#6366f1
  β–‘ NEXT_PUBLIC_THEME_SECONDARY=#8b5cf6
  β–‘ NEXT_PUBLIC_THEME_ACCENT=#06b6d4

β–‘ Feature Flags (web/.env.local)
  β–‘ NEXT_PUBLIC_ENABLE_FILE_UPLOAD=true
  β–‘ NEXT_PUBLIC_ENABLE_REACTIONS=true
  β–‘ NEXT_PUBLIC_ENABLE_THREADS=true
  β–‘ NEXT_PUBLIC_ENABLE_VOICE_CHAT=false
  β–‘ NEXT_PUBLIC_ENABLE_VIDEO_CHAT=false
  β–‘ NEXT_PUBLIC_ENABLE_AI_FEATURES=true
  β–‘ NEXT_PUBLIC_ENABLE_SEARCH=true
  β–‘ NEXT_PUBLIC_ENABLE_ANALYTICS=true

β–‘ Limits Configuration (web/.env.local)
  β–‘ NEXT_PUBLIC_MAX_FILE_SIZE=104857600 # 100MB
  β–‘ NEXT_PUBLIC_MAX_MESSAGE_LENGTH=4000
  β–‘ NEXT_PUBLIC_MAX_CHANNELS=100
  β–‘ NEXT_PUBLIC_MESSAGE_EDIT_WINDOW=300000 # 5 minutes

0.1 Backend Database Schema

-- I will create these migrations in order
β–‘ 001_core_tables.sql
  β–‘ users table (extends auth.users)
  β–‘ nchat_organizations (single tenant but prepared for multi)
    β–‘ id, name, slug, logo_url, created_at
    β–‘ settings (JSONB for all org settings)
    β–‘ owner_id (FK to users, immutable after creation)
  β–‘ nchat_roles (owner, admin, moderator, member, guest)
    β–‘ id, name, slug, description, level (hierarchy number)
    β–‘ is_system (true for built-in roles)
    β–‘ created_at, updated_at
  β–‘ nchat_role_permissions (granular permissions)
    β–‘ role_id, permission_name, granted
    β–‘ Permissions list:
      - manage_organization
      - manage_roles
      - manage_users
      - manage_channels
      - manage_messages
      - delete_any_message
      - pin_messages
      - create_public_channel
      - create_private_channel
      - invite_users
      - ban_users
      - view_analytics
      - manage_integrations
      - manage_billing

β–‘ 002_user_tables.sql
  β–‘ nchat_users (app-specific profiles)
    β–‘ id, user_id (FK to auth.users)
    β–‘ display_name, avatar_url, bio
    β–‘ status_message, status_emoji
    β–‘ timezone, language
    β–‘ is_bot, bot_token (for integrations)
    β–‘ last_seen_at, created_at, updated_at
  β–‘ nchat_user_roles (user-role assignments)
    β–‘ user_id, role_id, assigned_by, assigned_at
    β–‘ Unique constraint on user_id + role_id
  β–‘ nchat_user_preferences (theme, notifications, etc)
    β–‘ user_id (unique), preferences (JSONB)
    β–‘ theme_mode (light/dark/auto)
    β–‘ notification_sound, notification_desktop, notification_mobile
    β–‘ show_message_preview, enter_to_send
    β–‘ compact_mode, show_avatars
  β–‘ nchat_user_presence (online/away/offline)
    β–‘ user_id, status (online/away/offline/dnd)
    β–‘ last_activity, device_type
    β–‘ is_mobile, custom_status

β–‘ 003_channel_tables.sql
  β–‘ nchat_channels (name, slug, type, visibility)
    β–‘ id, name, slug (unique), description
    β–‘ type (public/private/direct/group)
    β–‘ category_id, position (for ordering)
    β–‘ topic, icon_emoji, header_color
    β–‘ is_archived, is_read_only
    β–‘ created_by, created_at, updated_at
    β–‘ settings (JSONB - who can post, etc)
  β–‘ nchat_channel_roles (channel-specific permissions)
    β–‘ channel_id, role_id
    β–‘ can_read, can_write, can_manage
    β–‘ added_by, added_at
  β–‘ nchat_channel_members (membership tracking)
    β–‘ channel_id, user_id
    β–‘ joined_at, last_read_at
    β–‘ notification_preference (all/mentions/none)
    β–‘ is_muted, muted_until
    β–‘ is_starred, is_admin
  β–‘ nchat_channel_categories (organize channels)
    β–‘ id, name, position
    β–‘ is_collapsed (per user via preferences)
    β–‘ created_at, updated_at

β–‘ 004_message_tables.sql
  β–‘ nchat_messages (content, type, metadata)
  β–‘ nchat_message_reactions (emoji reactions)
  β–‘ nchat_message_threads (threaded replies)
  β–‘ nchat_message_mentions (@user, @role, @channel)
  β–‘ nchat_message_attachments (files, images)
  β–‘ nchat_message_edits (edit history)

β–‘ 005_feature_tables.sql
  β–‘ nchat_drafts (unsent messages)
  β–‘ nchat_bookmarks (saved messages)
  β–‘ nchat_pins (pinned messages)
  β–‘ nchat_read_receipts (last read tracking)
  β–‘ nchat_typing_indicators (who's typing)
  β–‘ nchat_notifications (notification queue)

β–‘ 006_customization_tables.sql
  β–‘ nchat_themes (custom themes)
  β–‘ nchat_branding (logo, name, tagline)
  β–‘ nchat_custom_emojis (organization emojis)
  β–‘ nchat_settings (key-value settings)

0.2 Hasura Metadata Configuration

β–‘ Track all tables with relationships
β–‘ Set up Row Level Security (RLS) policies
β–‘ Owner can do everything
β–‘ Admin can manage users/channels
β–‘ Moderator can manage messages
β–‘ Member can read/write in allowed channels
β–‘ Guest can only read in public channels
β–‘ Create Hasura Actions
β–‘ initializeOrganization
β–‘ createFirstOwner
β–‘ searchMessages
β–‘ exportChannel
β–‘ processSlashCommand
β–‘ Set up Event Triggers
β–‘ on_new_message β†’ index_search
β–‘ on_new_message β†’ send_notifications
β–‘ on_mention β†’ notify_user
β–‘ on_file_upload β†’ scan_virus
β–‘ Configure Scheduled Events
β–‘ cleanup_old_typing_indicators (every 30s)
β–‘ update_user_presence (every 1m)
β–‘ send_digest_emails (daily)

0.3 Project Setup

β–‘ Create monorepo structure with pnpm workspaces
  β–‘ Create pnpm-workspace.yaml
  β–‘ Root package.json with workspace config
  β–‘ .npmrc with shamefully-hoist=true
  β–‘ Root tsconfig.json with path aliases

β–‘ /web (Next.js 14 with App Router)
  β–‘ npx create-next-app@latest web --typescript --tailwind --app
  β–‘ Configure next.config.js
    β–‘ Add transpilePackages for monorepo
    β–‘ Configure images domains
    β–‘ Add PWA plugin
  β–‘ Install core dependencies:
    β–‘ @nhost/nextjs @nhost/react
    β–‘ @apollo/client graphql
    β–‘ socket.io-client
  β–‘ Install UI dependencies:
    β–‘ @radix-ui/react-dialog
    β–‘ @radix-ui/react-dropdown-menu
    β–‘ @radix-ui/react-tooltip
    β–‘ @radix-ui/react-avatar
    β–‘ @radix-ui/react-scroll-area
    β–‘ @radix-ui/react-separator
    β–‘ @radix-ui/react-switch
    β–‘ @radix-ui/react-tabs
  β–‘ Install editor dependencies:
    β–‘ @tiptap/react @tiptap/starter-kit
    β–‘ @tiptap/extension-mention
    β–‘ @tiptap/extension-placeholder
    β–‘ @tiptap/extension-code-block-lowlight
    β–‘ lowlight
  β–‘ Install utility dependencies:
    β–‘ framer-motion
    β–‘ react-hook-form
    β–‘ zod @hookform/resolvers
    β–‘ tailwind-merge clsx
    β–‘ class-variance-authority
    β–‘ date-fns
    β–‘ react-intersection-observer
    β–‘ react-dropzone
    β–‘ emoji-picker-react
    β–‘ react-hot-toast
    β–‘ zustand (state management)
    β–‘ swr (data fetching)

β–‘ /packages/ui (Shared component library)
  β–‘ Setup package.json with exports
  β–‘ Configure TypeScript
  β–‘ Create component structure
  β–‘ Setup Storybook
  β–‘ Base components to create:
    β–‘ Button (variants: primary, secondary, ghost, danger)
    β–‘ Input (text, password, email, number)
    β–‘ Textarea (auto-resize option)
    β–‘ Select (native and custom)
    β–‘ Checkbox & Radio
    β–‘ Switch/Toggle
    β–‘ Avatar (with status indicator)
    β–‘ Badge (count, status, tag)
    β–‘ Card (clickable, static)
    β–‘ Modal/Dialog
    β–‘ Dropdown Menu
    β–‘ Tooltip
    β–‘ Toast/Notification
    β–‘ Tabs
    β–‘ Accordion
    β–‘ Progress (bar, circle)
    β–‘ Spinner/Loader
    β–‘ Skeleton
    β–‘ Empty State
    β–‘ Error Boundary

β–‘ /packages/graphql (Generated types & operations)
  β–‘ Setup codegen.yml
  β–‘ Create operations folder structure
  β–‘ Configure type generation

β–‘ /packages/hooks (Shared React hooks)
  β–‘ Setup exports structure
  β–‘ Create hooks folder

β–‘ /packages/utils (Helper functions)
  β–‘ Setup date formatters
  β–‘ Create validation schemas
  β–‘ Add helper functions

β–‘ /packages/config (Shared configuration)
  β–‘ Theme configuration
  β–‘ Constants
  β–‘ Feature flags

Phase 1: First-Run Setup Experience [Day 3-4]

1.1 Initial Setup Flow

β–‘ /web/app/(setup)/layout.tsx - Setup wrapper
β–‘ /web/app/(setup)/welcome/page.tsx
  β–‘ Check if organization exists
  β–‘ If not, show welcome screen
  β–‘ Animated logo placeholder
  β–‘ "Let's set up your chat platform" CTA

β–‘ /web/app/(setup)/owner/page.tsx
  β–‘ First user registration form
  β–‘ Email, password, full name
  β–‘ Auto-assign as Owner role
  β–‘ Create auth.users entry
  β–‘ Create nchat_users profile

β–‘ /web/app/(setup)/organization/page.tsx
  β–‘ Organization name input
  β–‘ Tagline/description
  β–‘ Logo upload (or skip)
  β–‘ Primary domain/slug

β–‘ /web/app/(setup)/theme/page.tsx
  β–‘ Color palette picker
    β–‘ Pre-built themes (Protocol, Slack, Discord, Teams)
    β–‘ Custom color picker for primary/secondary
    β–‘ Dark mode toggle
    β–‘ Live preview panel
  β–‘ Font selection (System, Inter, Custom)
  β–‘ Save to nchat_themes table

β–‘ /web/app/(setup)/auth/page.tsx
  β–‘ Authentication methods configuration
    β–‘ Email/Password (always on)
    β–‘ Magic Link toggle
    β–‘ Google OAuth toggle & setup
    β–‘ GitHub OAuth toggle & setup
    β–‘ SSO/SAML preparation
  β–‘ Save to nchat_settings

β–‘ /web/app/(setup)/complete/page.tsx
  β–‘ "Your chat is ready!" celebration
  β–‘ Quick tour option
  β–‘ Redirect to main app

1.2 Core Configuration System

β–‘ /web/lib/config/organization.ts
  β–‘ loadOrganizationConfig()
  β–‘ saveOrganizationConfig()
  β–‘ getDefaultConfig()
  β–‘ validateConfig()
  β–‘ migrateConfig() // For version updates

β–‘ /web/lib/config/theme.ts
  β–‘ Theme interface definition
  β–‘ loadTheme()
  β–‘ saveTheme()
  β–‘ generateCSSVariables()
  β–‘ validateColorContrast() // WCAG compliance
  β–‘ exportThemeJSON()
  β–‘ importThemeJSON()

β–‘ /web/components/providers/SetupProvider.tsx
  β–‘ Check if setup is complete
  β–‘ Redirect to setup if needed
  β–‘ Load organization config
  β–‘ Track setup progress
  β–‘ Handle setup errors

β–‘ /web/lib/config/defaults.ts
  β–‘ Default role definitions
  β–‘ Default permissions matrix
  β–‘ Default channel structure
  β–‘ Default theme presets
  β–‘ Default notification settings

Phase 2: Authentication & Authorization [Day 5-6]

2.1 Authentication Implementation

β–‘ /web/app/(auth)/layout.tsx - Auth pages wrapper
β–‘ /web/app/(auth)/login/page.tsx
  β–‘ Email/password form
  β–‘ Magic link option
  β–‘ Social login buttons
  β–‘ Remember me checkbox
  β–‘ Forgot password link

β–‘ /web/app/(auth)/register/page.tsx
  β–‘ Registration form
  β–‘ Email verification flow
  β–‘ Terms acceptance
  β–‘ Auto-join default channels

β–‘ /web/app/(auth)/forgot-password/page.tsx
β–‘ /web/app/(auth)/reset-password/page.tsx
β–‘ /web/app/(auth)/verify-email/page.tsx
β–‘ /web/app/(auth)/magic-link/page.tsx

β–‘ /web/components/auth/AuthProvider.tsx
  β–‘ Wrap app with NhostProvider
  β–‘ Handle auth state
  β–‘ Refresh tokens

β–‘ /web/lib/auth/permissions.ts
  β–‘ Role-based access control
  β–‘ Channel-specific permissions
  β–‘ Permission checking helpers

2.2 Role Management System

β–‘ /web/app/(app)/settings/roles/page.tsx
  β–‘ List all roles
  β–‘ Create custom roles
  β–‘ Edit role permissions
  β–‘ Assign roles to users
  β–‘ Role hierarchy display

β–‘ /web/lib/roles/roleDefinitions.ts
  β–‘ Default roles configuration
  β–‘ Permission matrix
  β–‘ Role inheritance logic

β–‘ /web/hooks/usePermissions.ts
  β–‘ Check user permissions
  β–‘ Channel-specific checks
  β–‘ UI element visibility

Phase 3: Core Chat UI [Day 7-10]

3.1 Layout Components

β–‘ /web/app/(app)/layout.tsx
  β–‘ Main app shell
  β–‘ Auth guard wrapper
  β–‘ Theme provider
  β–‘ Socket.io provider

β–‘ /web/components/layout/AppHeader.tsx
  β–‘ Organization logo & name
  β–‘ Global search bar
  β–‘ User menu dropdown
  β–‘ Settings gear icon
  β–‘ Notification bell

β–‘ /web/components/layout/Sidebar.tsx
  β–‘ Channel categories
  β–‘ Channel list with unread counts
  β–‘ Direct messages section
  β–‘ Online users list
  β–‘ Create channel button

β–‘ /web/components/layout/MainContent.tsx
  β–‘ Dynamic content area
  β–‘ Mobile responsive
  β–‘ Keyboard navigation

3.2 Channel Management

β–‘ /web/components/channels/ChannelList.tsx
  β–‘ Grouped by category
  β–‘ Drag-drop reordering
  β–‘ Unread indicators
  β–‘ Private/public icons

β–‘ /web/components/channels/ChannelItem.tsx
  β–‘ Channel name & icon
  β–‘ Unread count badge
  β–‘ Typing indicator
  β–‘ Context menu (right-click)

β–‘ /web/components/channels/CreateChannelModal.tsx
  β–‘ Channel name input
  β–‘ Public/private toggle
  β–‘ Category selection
  β–‘ Role restrictions
  β–‘ Initial members

β–‘ /web/components/channels/ChannelHeader.tsx
  β–‘ Channel name & description
  β–‘ Member count
  β–‘ Pin/star toggle
  β–‘ Channel settings button
  β–‘ Search in channel

3.3 Message Components

β–‘ /web/components/messages/MessageList.tsx
  β–‘ Virtual scrolling for performance
  β–‘ Auto-scroll to bottom
  β–‘ Jump to unread button
  β–‘ Load more on scroll up
  β–‘ Date separators

β–‘ /web/components/messages/MessageItem.tsx
  β–‘ User avatar
  β–‘ Username & timestamp
  β–‘ Message content rendering
  β–‘ File attachments
  β–‘ Reactions display
  β–‘ Thread indicator
  β–‘ Hover actions menu

β–‘ /web/components/messages/MessageComposer.tsx
  β–‘ Rich text editor (TipTap)
    β–‘ Bold, italic, underline
    β–‘ Code blocks with syntax
    β–‘ Lists (ordered/unordered)
    β–‘ Links with preview
  β–‘ Emoji picker
  β–‘ File upload button
  β–‘ @mention autocomplete
  β–‘ Slash commands
  β–‘ Send button with Ctrl+Enter

β–‘ /web/components/messages/MessageActions.tsx
  β–‘ Add reaction
  β–‘ Reply in thread
  β–‘ Edit message
  β–‘ Delete message
  β–‘ Pin message
  β–‘ Copy text
  β–‘ Share message

Phase 4: Real-time Features [Day 11-12]

4.1 GraphQL Subscriptions

β–‘ /packages/graphql/subscriptions/messages.graphql
  β–‘ subscription OnNewMessage($channelId: uuid!)
  β–‘ subscription OnMessageUpdate($channelId: uuid!)
  β–‘ subscription OnMessageDelete($channelId: uuid!)
  β–‘ subscription OnReaction($messageId: uuid!)
  β–‘ subscription OnThreadReply($messageId: uuid!)

β–‘ /packages/graphql/subscriptions/presence.graphql
  β–‘ subscription OnPresenceUpdate
  β–‘ subscription OnUserStatusChange($userId: uuid!)
  β–‘ subscription OnBulkPresenceUpdate

β–‘ /packages/graphql/subscriptions/typing.graphql
  β–‘ subscription OnTypingIndicator($channelId: uuid!)
  β–‘ subscription OnTypingStop($channelId: uuid!)

β–‘ /packages/graphql/subscriptions/channels.graphql
  β–‘ subscription OnChannelUpdate($channelId: uuid!)
  β–‘ subscription OnChannelMemberJoin($channelId: uuid!)
  β–‘ subscription OnChannelMemberLeave($channelId: uuid!)
  β–‘ subscription OnNewChannel

β–‘ /packages/graphql/subscriptions/notifications.graphql
  β–‘ subscription OnNewNotification($userId: uuid!)
  β–‘ subscription OnNotificationRead($userId: uuid!)
  β–‘ subscription OnMention($userId: uuid!)

4.2 Socket.io Integration

β–‘ /web/lib/socket/client.ts
  β–‘ Initialize Socket.io connection
  β–‘ JWT authentication
  β–‘ Reconnection logic
  β–‘ Event handlers

β–‘ /web/hooks/usePresence.ts
  β–‘ Broadcast user presence
  β–‘ Track online users
  β–‘ Handle disconnects

β–‘ /web/hooks/useTyping.ts
  β–‘ Send typing events
  β–‘ Display typing indicators
  β–‘ Auto-clear after timeout

β–‘ /web/components/realtime/TypingIndicator.tsx
  β–‘ "User is typing..." display
  β–‘ Multiple users typing
  β–‘ Smooth animations

β–‘ /web/components/realtime/PresenceDot.tsx
  β–‘ Online/away/offline indicator
  β–‘ Last seen time
  β–‘ Custom status message

Phase 5: Advanced Features [Day 13-15]

5.1 File Management

β–‘ /web/components/files/FileUpload.tsx
  β–‘ Drag-drop zone
  β–‘ Multi-file selection
  β–‘ Progress bars
  β–‘ File type validation
  β–‘ Size limit checking

β–‘ /web/components/files/FilePreview.tsx
  β–‘ Image thumbnails
  β–‘ Video player
  β–‘ PDF viewer
  β–‘ Code syntax highlighting
  β–‘ Download button

β–‘ /web/lib/storage/upload.ts
  β–‘ Upload to Hasura Storage
  β–‘ Generate presigned URLs
  β–‘ Handle large files
  β–‘ Resume on failure

5.2 Search System

β–‘ /web/components/search/GlobalSearch.tsx
  β–‘ Command palette (Cmd+K)
  β–‘ Search messages
  β–‘ Search files
  β–‘ Search users
  β–‘ Filter by date/channel

β–‘ /web/components/search/SearchResults.tsx
  β–‘ Grouped results
  β–‘ Highlighted matches
  β–‘ Jump to message
  β–‘ Load more pagination

β–‘ /web/lib/search/meilisearch.ts
  β–‘ Index messages
  β–‘ Search queries
  β–‘ Filter builder
  β–‘ Result formatting

5.3 Notifications

β–‘ /web/components/notifications/NotificationCenter.tsx
  β–‘ Notification dropdown
  β–‘ Unread count badge
  β–‘ Mark as read
  β–‘ Notification settings

β–‘ /web/components/notifications/NotificationToast.tsx
  β–‘ Desktop notifications
  β–‘ In-app toasts
  β–‘ Sound alerts
  β–‘ Do not disturb mode

β–‘ /web/lib/notifications/manager.ts
  β–‘ Permission request
  β–‘ Send notifications
  β–‘ Queue management
  β–‘ Preference storage

Phase 6: White-Label Customization [Day 16-17]

6.1 Theme System

β–‘ /web/lib/theme/ThemeProvider.tsx
  β–‘ Load theme from database
  β–‘ Apply CSS variables
  β–‘ Dark mode toggle
  β–‘ Theme hot-reload

β–‘ /web/lib/theme/themes/protocol.ts (default)
  primary: {
    50: '#f0f9ff',
    500: '#6366f1',
    900: '#312e81'
  },
  secondary: {
    50: '#f0fdfa',
    500: '#14b8a6',
    900: '#134e4a'
  }

β–‘ /web/app/(app)/settings/appearance/page.tsx
  β–‘ Theme editor UI
  β–‘ Color pickers
  β–‘ Font selection
  β–‘ Spacing adjustments
  β–‘ Border radius
  β–‘ Live preview
  β–‘ Save/reset buttons

β–‘ /web/lib/theme/generator.ts
  β–‘ Generate theme from colors
  β–‘ Ensure accessibility
  β–‘ Create color scales
  β–‘ Export theme JSON

6.2 Branding Configuration

β–‘ /web/app/(app)/settings/branding/page.tsx
  β–‘ Organization name
  β–‘ Logo upload
  β–‘ Favicon upload
  β–‘ Email templates
  β–‘ Custom CSS injection
  β–‘ PWA configuration

β–‘ /web/components/brand/DynamicLogo.tsx
  β–‘ Load from settings
  β–‘ Fallback to text
  β–‘ Responsive sizing

β–‘ /web/components/brand/DynamicFavicon.tsx
  β–‘ Update dynamically
  β–‘ Notification badge

Phase 7: Admin Dashboard [Day 18-19]

7.1 User Management

β–‘ /web/app/(app)/admin/users/page.tsx
  β–‘ User list table
  β–‘ Search/filter users
  β–‘ Role assignment
  β–‘ Suspend/activate users
  β–‘ Reset passwords
  β–‘ Export user data

β–‘ /web/app/(app)/admin/users/[id]/page.tsx
  β–‘ User profile view
  β–‘ Activity history
  β–‘ Message count
  β–‘ Channels joined
  β–‘ Files uploaded

7.2 Analytics Dashboard

β–‘ /web/app/(app)/admin/analytics/page.tsx
  β–‘ Active users chart
  β–‘ Message volume graph
  β–‘ Popular channels
  β–‘ Peak usage times
  β–‘ File storage usage
  β–‘ Search queries

β–‘ /web/lib/analytics/collector.ts
  β–‘ Track user events
  β–‘ Aggregate data
  β–‘ Generate reports

7.3 System Settings

β–‘ /web/app/(app)/admin/settings/page.tsx
  β–‘ Rate limiting
  β–‘ File size limits
  β–‘ Message retention
  β–‘ Backup configuration
  β–‘ Email settings
  β–‘ Security policies

Phase 8: Backend Services [Day 20-21]

8.1 Realtime Service (Socket.io)

β–‘ /services/realtime/index.ts
  β–‘ Socket.io server setup
  β–‘ JWT authentication
  β–‘ Room management
  β–‘ Redis adapter

β–‘ /services/realtime/handlers/presence.ts
  β–‘ Track user connections
  β–‘ Broadcast status updates
  β–‘ Handle disconnections

β–‘ /services/realtime/handlers/typing.ts
  β–‘ Receive typing events
  β–‘ Broadcast to channel
  β–‘ Auto-clear timeout

8.2 Worker Service (BullMQ)

β–‘ /services/worker/index.ts
  β–‘ Queue initialization
  β–‘ Worker processes
  β–‘ Error handling

β–‘ /services/worker/jobs/email.ts
  β–‘ Send email notifications
  β–‘ Digest emails
  β–‘ Password resets

β–‘ /services/worker/jobs/search.ts
  β–‘ Index new messages
  β–‘ Update search index
  β–‘ Cleanup old entries

β–‘ /services/worker/jobs/files.ts
  β–‘ Generate thumbnails
  β–‘ Scan for viruses
  β–‘ Compress images

Phase 9: Mobile & Desktop [Day 22-24]

9.1 Progressive Web App

β–‘ /web/public/manifest.json
  β–‘ App name & icons
  β–‘ Theme colors
  β–‘ Display mode

β–‘ /web/lib/pwa/serviceWorker.ts
  β–‘ Offline caching
  β–‘ Background sync
  β–‘ Push notifications

β–‘ /web/components/pwa/InstallPrompt.tsx
  β–‘ Add to home screen
  β–‘ iOS instructions
  β–‘ Desktop install

9.2 Mobile Optimizations

β–‘ Responsive design throughout
β–‘ Touch gestures
  β–‘ Swipe to reply
  β–‘ Pull to refresh
  β–‘ Long press actions
β–‘ Mobile keyboard handling
β–‘ Viewport management
β–‘ Reduced animations option

9.3 Desktop Enhancements

β–‘ Keyboard shortcuts
  β–‘ Cmd+K - Search
  β–‘ Cmd+/ - Shortcuts help
  β–‘ Esc - Close modals
  β–‘ Up/Down - Navigate messages
β–‘ Native system tray
β–‘ Desktop notifications
β–‘ File drag-drop from desktop

Phase 10: Testing & Deployment [Day 25-26]

10.1 Testing Suite

β–‘ Unit tests for utilities
  β–‘ /packages/utils test coverage > 90%
  β–‘ Date formatters
  β–‘ Validation functions
  β–‘ Permission helpers
  β–‘ Theme generators

β–‘ Component tests with React Testing Library
  β–‘ Message component
  β–‘ Channel list component
  β–‘ Auth forms
  β–‘ Settings panels
  β–‘ Modal dialogs

β–‘ Integration tests
  β–‘ GraphQL operations
  β–‘ Socket.io connections
  β–‘ File upload flow
  β–‘ Search functionality

β–‘ E2E tests with Playwright
  β–‘ Auth flow
    β–‘ Register new user
    β–‘ Login with email
    β–‘ Magic link login
    β–‘ Password reset
    β–‘ Logout
  β–‘ First-run setup
    β–‘ Owner registration
    β–‘ Organization setup
    β–‘ Theme selection
    β–‘ Initial configuration
  β–‘ Messaging
    β–‘ Send message
    β–‘ Edit message
    β–‘ Delete message
    β–‘ Add reaction
    β–‘ Reply in thread
  β–‘ Channels
    β–‘ Create channel
    β–‘ Join channel
    β–‘ Leave channel
    β–‘ Archive channel
    β–‘ Channel settings
  β–‘ Files
    β–‘ Upload file
    β–‘ Preview image
    β–‘ Download file
    β–‘ Delete file
  β–‘ Search
    β–‘ Search messages
    β–‘ Search users
    β–‘ Search files
    β–‘ Filter results
  β–‘ User management
    β–‘ Invite user
    β–‘ Assign role
    β–‘ Remove user
    β–‘ Update profile

β–‘ Load testing with K6
  β–‘ 100 concurrent users
  β–‘ 1000 messages per minute
  β–‘ File upload stress test
  β–‘ WebSocket connection limits
  β–‘ Database query performance

β–‘ Accessibility testing
  β–‘ axe-core automated tests
  β–‘ Screen reader manual testing
  β–‘ Keyboard navigation audit
  β–‘ Color contrast validation
  β–‘ Focus management review

10.2 Performance Optimization

β–‘ Code splitting
β–‘ Lazy loading
β–‘ Image optimization
β–‘ Bundle analysis
β–‘ Lighthouse audits
β–‘ Database indexes
β–‘ Query optimization

10.3 Deployment Setup

β–‘ Docker configuration
β–‘ Environment variables
β–‘ CI/CD pipeline
β–‘ Monitoring setup
β–‘ Backup strategy
β–‘ SSL certificates
β–‘ CDN configuration

Phase 11: Documentation [Day 27]

11.1 User Documentation

β–‘ /docs/user-guide.md
β–‘ Getting started
β–‘ Creating channels
β–‘ Sending messages
β–‘ File sharing
β–‘ Keyboard shortcuts

β–‘ /docs/admin-guide.md
β–‘ Initial setup
β–‘ User management
β–‘ Role configuration
β–‘ Customization
β–‘ Backups

11.2 Developer Documentation

β–‘ /docs/deployment.md
β–‘ /docs/configuration.md
β–‘ /docs/customization.md
β–‘ /docs/api-reference.md
β–‘ /docs/contributing.md

Phase 12: Polish & Launch [Day 28-30]

12.1 Final Polish

β–‘ Loading states everywhere
  β–‘ Message list loading
  β–‘ Channel list loading
  β–‘ User search loading
  β–‘ File upload progress
  β–‘ Initial app load
β–‘ Error boundaries
  β–‘ Global error boundary
  β–‘ Component-level boundaries
  β–‘ Error recovery UI
  β–‘ Error reporting
β–‘ Empty states
  β–‘ No messages in channel
  β–‘ No channels created
  β–‘ No search results
  β–‘ No notifications
  β–‘ Welcome messages
β–‘ Skeleton loaders
  β–‘ Message skeleton
  β–‘ Channel skeleton
  β–‘ User avatar skeleton
  β–‘ Settings skeleton
β–‘ Smooth animations
  β–‘ Page transitions
  β–‘ Modal animations
  β–‘ Message animations
  β–‘ Hover effects
  β–‘ Focus indicators
β–‘ Micro-interactions
  β–‘ Button press feedback
  β–‘ Emoji reactions bounce
  β–‘ Typing indicator pulse
  β–‘ Notification slide-in
  β–‘ Success checkmarks
β–‘ Sound effects (optional)
  β–‘ New message sound
  β–‘ Mention notification
  β–‘ Error sound
  β–‘ Success sound
  β–‘ Settings to control

12.2 Launch Checklist

β–‘ Security audit
β–‘ SQL injection prevention
β–‘ XSS protection
β–‘ CSRF tokens
β–‘ Rate limiting
β–‘ Input validation
β–‘ File upload restrictions
β–‘ JWT expiration
β–‘ Permission checks
β–‘ Performance testing
β–‘ Lighthouse scores > 90
β–‘ Bundle size < 500KB
β–‘ Time to Interactive < 3s
β–‘ First Contentful Paint < 1s
β–‘ Core Web Vitals pass
β–‘ Cross-browser testing
β–‘ Chrome (latest)
β–‘ Firefox (latest)
β–‘ Safari (latest)
β–‘ Edge (latest)
β–‘ Mobile browsers
β–‘ Mobile testing
β–‘ iOS Safari
β–‘ Android Chrome
β–‘ Tablet layouts
β–‘ Touch interactions
β–‘ Keyboard handling
β–‘ Accessibility review
β–‘ Screen reader testing
β–‘ Keyboard navigation
β–‘ Color contrast (WCAG AA)
β–‘ Focus management
β–‘ ARIA labels
β–‘ Alt text for images
β–‘ SEO optimization
β–‘ Meta tags
β–‘ Open Graph tags
β–‘ Twitter cards
β–‘ Sitemap
β–‘ Robots.txt
β–‘ Canonical URLs
β–‘ Analytics setup
β–‘ Google Analytics 4
β–‘ Custom events
β–‘ User properties
β–‘ Conversion tracking
β–‘ Error tracking (Sentry)
β–‘ Install Sentry
β–‘ Configure environments
β–‘ Source maps
β–‘ User context
β–‘ Custom error boundaries
β–‘ Demo data seeding
β–‘ Sample users
β–‘ Sample channels
β–‘ Sample messages
β–‘ Sample files
β–‘ Demo organization
β–‘ Documentation
β–‘ README.md
β–‘ CONTRIBUTING.md
β–‘ API documentation
β–‘ Deployment guide
β–‘ Configuration guide
β–‘ Launch announcement
β–‘ Product Hunt
β–‘ Hacker News
β–‘ Twitter/X
β–‘ LinkedIn
β–‘ Dev.to article

πŸŽ‰ Deliverables

What You Get:

  1. Fully functional chat platform comparable to Slack/Discord
  2. Complete white-label system with UI customization
  3. Role-based permissions with Owner protection
  4. Real-time messaging with presence and typing
  5. File sharing with previews
  6. Search powered by MeiliSearch
  7. Mobile-responsive PWA
  8. Desktop-ready with keyboard shortcuts
  9. Theme system with Protocol-inspired default
  10. Admin dashboard for management
  11. Production-ready with tests and docs

Key Features:

  • βœ… Zero to production in 30 days
  • βœ… Single tenant but multi-tenant ready
  • βœ… Complete customization via UI
  • βœ… Role hierarchy with Owner protection
  • βœ… Private channels based on roles
  • βœ… Skinnable via theme.json
  • βœ… First-run setup wizard
  • βœ… Auth method configuration
  • βœ… Maximal white-labeling

Technology Stack:

  • Frontend: Next.js 14, TypeScript, Tailwind CSS
  • UI: Radix UI primitives, Framer Motion
  • Backend: Hasura, PostgreSQL, Redis
  • Real-time: GraphQL Subscriptions, Socket.io
  • Storage: Hasura Storage, MinIO
  • Search: MeiliSearch
  • Auth: Hasura Auth (Nhost)
  • Email: MailPit (dev), SMTP (prod)
  • Workers: BullMQ
  • Deployment: Docker, nself CLI

πŸ“ Implementation Notes

For AI Implementation:

  1. Each checkbox is a discrete task
  2. Complete each file before moving to next
  3. Test each component in isolation
  4. Commit after each phase
  5. Use TypeScript strictly
  6. Follow React best practices
  7. Ensure accessibility (WCAG 2.1 AA)
  8. Mobile-first responsive design
  9. Performance budget: <3s initial load
  10. Bundle size: <500KB initial

Critical Success Factors:

  1. Owner role cannot be changed after setup
  2. Theme must be hot-reloadable
  3. Search must be instant (<100ms)
  4. Messages must deliver in <50ms
  5. File uploads must support 100MB+
  6. Mobile must work perfectly
  7. Setup must be foolproof
  8. Customization must not require code

This is your complete blueprint. Follow it exactly and you'll have a production-ready, white-labelable chat platform that showcases the power of the nself backend.


🎯 Getting Started


✨ Features

Core Features

Communication

Security & Privacy

(See πŸ” Security section below for 2FA, PIN Lock, and security audits.)

Interactive

(Search lives in πŸ“š Reference below.)

Extensibility


πŸ“– Guides

User Guides

Developer Guides

Enterprise

Backend

Deployment


βš™οΈ Configuration


πŸ“‘ API

API Documentation


πŸš€ Deployment


πŸ“š Reference

Architecture

Quick Reference


πŸ” Security


πŸ†˜ Help


ℹ️ About


πŸ”— Links


v1.0.0 β€’ 2026

Clone this wiki locally