How balasubramaniam12007/chattr works
Project type and purpose
• Chattr is a full-stack, real-time chat application.
• Frontend: React 18 Single Page App (SPA) built with Vite and styled with Tailwind CSS.
• Backend: Supabase (PostgreSQL database + Auth + Real-time subscriptions + Storage).
• Purpose: Enable authenticated users to chat in real time, manage profiles (avatars, bio), see presence, and handle read receipts.
File structure
• Top-level config/build files:
• vite.config.js, tailwind.config.js, postcss.config.js, eslint.config.js
• package.json / package-lock.json define dependencies (React, React Router, Lucide, etc.)
• public/index.html is the SPA entry point.
• src/
• App.jsx, main.jsx: bootstrap React app and routing.
• components/: reusable UI (ChatWindow, ChatMessage, ConversationList, UserProfilesBar, ProtectedRoute).
• pages/: route targets (Auth.jsx, Chat.jsx, NotFound.jsx, ProfileFormModal.jsx).
• contexts/AuthContext.jsx: global auth/user state.
• utils/supabase.js: initializes Supabase client (URL + anon key).
• assets/, styles (App.css, index.css).
• There is no custom backend code—everything uses Supabase as a BaaS.
Key insights from README
• Real-time messaging via Supabase subscriptions.
• RLS policies on profiles, conversations, messages.
• Supabase Storage used for avatar uploads.
• ProtectedRoute component ensures only authenticated users access chat/profile pages.
• Mobile-first responsive design and UI behaviors (auto-scroll, typing indicators).