Skip to content
BansifyPublic

About

GrixChat is a comprehensive, high-performance social media and real-time messaging application. It combines the features of popular platforms like Instagram and WhatsApp into a single, mobile-first experience.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Bansify Chat — Secure Social & Real-Time Messaging Platform

Bansify Chat is a high-performance, low-cost messaging and private-calling app, built as a PWA and Google Play TWA. It is deliberately scoped to five tabs — Chats, Stories, Search, Calls and Profile — plus an in-app AI assistant (Grix AI), a GitHub repository browser, and an app lock.

The visual language blends 60% unique Dark Cosmic identity, 20% Telegram performance micro-animations, and 20% WhatsApp communication mechanics.

👉 New here? Start at docs/CONTEXT.md. It is the shortest path to a working mental model — how to run the app, where things live, and what will bite you.


🏗 Core Architecture Blueprint

  • Backend, Storage & Real-Time Sync: Driven 100% by Supabase. Includes custom PostgreSQL procedures, storage buckets, and filtered postgres_changes listeners.
  • Push Notifications: Firebase Cloud Messaging (FCM) is strictly restricted to background mobile notifications so database egress loads remain at exactly zero.
  • Direct Private Calling: Peer-to-peer audio/video calling powered by WebRTC with automatic 45-second persistent dialing, Web Audio API sound synths, and background conversation survival.
  • Aesthetic Visual Blend: Custom display typography of Space Grotesk paired with Inter and JetBrains Mono, complete with WhatsApp-style delivery double-ticks, custom context sliders, and selection highlights.

💸 Cost-Optimization & 50K Free User Scalability

To support more than 50,000 active users comfortably on Supabase's free tier, database operations obey strict efficiency guidelines:

  1. Unfiltered Listeners Banned: All real-time channel listeners are strictly targeted and filtered based on keys (e.g. receiver_id=eq.${userId}). We never listen to entire tables globally to protect egress.
  2. Lightweight WebSocket Broadcasts: High-frequency, fleeting events—such as typing feedback, read ticks, or calling connection states—are routed via Supabase Broadcast and Presence channels, avoiding heavy relational database queries.
  3. Optimized Local Caching: State managers cache local messages and profiles before triggering remote syncs, delivering a persistent offline-first experience.
  4. Range constraints & Pagination: Initial list loading feeds only the vital 20-30 conversational records.

🛠 Feature Profile

  • Background Video/Voice Calling: WebRTC signalling lives inside a global React Context (providers/CallProvider.tsx). You can back out of a call to keep messaging, and a WhatsApp-style pulsing green line keeps ticking beneath the navigation bar.
  • Micro-Animations: Staggered transition arrays and slide-out logout menus engineered via motion/react for smooth, native-like user flows.
  • Interactive Multi-Tab Setup: Visited views are retained using a custom keep-alive container pattern to prevent visual reloads.
  • Secure App Lock: Secure PIN screen and privacy toggles to protect chats.

📁 System Registry Map

  • /src/providers: Application context singletons (Supabase AuthProvider, global WebRTC CallProvider).
  • /src/features: Modular screens broken into focus zones (chat, call, profile, search, stories, github, grixai).
  • /src/components: UI layouts, bottom/top navigation components, and global drop-downs.
  • /sql: The only place for schema — 01_schema.sql (tables, policies, indexes) and 02_functions_realtime_storage.sql (functions, triggers, realtime, storage, the egress work), plus 00_master_instructions.md (the runbook). Both files are safe to re-run: nothing is dropped, missing objects are created, policies and functions are re-created. New SQL is appended to the current file until it reaches 600–1000 lines, then the next number starts; superseded files live in /sql/legacy — never run those.
  • /server/api.ts: The API. Runtime-neutral (Web Request/Response), so the same file serves Cloudflare Pages Functions and the Express dev server.
  • /functions: Cloudflare Pages Functions — thin adapters that forward /api/* and /auth/* to server/api.ts.
  • /docs: Developer documentation — orientation, setup, testing, data model, known issues.
  • /dev: The mock Supabase (dev/mock/) and test setup (dev/test/). See docs/TESTING.md.

🚀 Getting Started

1. Installation

npm install

2. Run it — no credentials needed

npm run dev:mock

→ http://localhost:3000 · login demo@grixchat.app / grixchat

This runs the full app against an in-memory Supabase mock (dev/mock/) with a seeded social graph. Nothing touches the network.

3. …or against real Supabase

cp .env.example .env      # fill in VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY
npm run dev

.env.example documents every variable, frontend and server — including the ones that live in the Cloudflare Pages dashboard in production.

4. Test and build

npm test                  # 99 tests
npm run lint              # tsc --noEmit
npm run build             # vite build → dist/ (what Cloudflare Pages builds)

5. Deploy

Cloudflare Pages builds this repository and serves https://grixchat.gothwadtech.com — dist/ as the static site and functions/ as the API. Build command npm run build, output directory dist, and the project's environment variables. Full checklist: docs/DEV_SETUP.md.

npx wrangler pages functions build   # check the API bundles for the edge
npx wrangler pages dev dist          # run it locally in workerd on :8788

CI (.github/workflows/ci.yml) typechecks, tests and bundle-checks every push; it does not deploy.


Crafted under high-precision directives for the Bansify Chat Mobile Ecosystem. 🌌

About

GrixChat is a comprehensive, high-performance social media and real-time messaging application. It combines the features of popular platforms like Instagram and WhatsApp into a single, mobile-first experience.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Contributors

Languages