{"id":50206117,"url":"https://github.com/howardsun-dev/quickchat","last_synced_at":"2026-05-26T01:08:09.848Z","repository":{"id":329318277,"uuid":"1119087987","full_name":"howardsun-dev/quickchat","owner":"howardsun-dev","description":"Proof of concept","archived":false,"fork":false,"pushed_at":"2026-05-21T01:39:14.000Z","size":9796,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T08:00:18.140Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/howardsun-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-18T18:12:29.000Z","updated_at":"2026-05-21T01:39:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/howardsun-dev/quickchat","commit_stats":null,"previous_names":["howardsun-dev/quickchat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/howardsun-dev/quickchat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardsun-dev%2Fquickchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardsun-dev%2Fquickchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardsun-dev%2Fquickchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardsun-dev%2Fquickchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howardsun-dev","download_url":"https://codeload.github.com/howardsun-dev/quickchat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardsun-dev%2Fquickchat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33499304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-26T01:08:08.940Z","updated_at":"2026-05-26T01:08:09.839Z","avatar_url":"https://github.com/howardsun-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuickChat\n\n[![Live Demo](https://img.shields.io/badge/Live%20Demo-Sevalla-6C5CE7)](https://quickchat-v72jh.sevalla.app/)\n[![MIT License](https://img.shields.io/badge/License-MIT-green)](./LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue)](https://www.typescriptlang.org/)\n\nA full-stack real-time chat application with JWT authentication, optimistic UI updates, online presence detection, and secure media uploads.\n\n\u003e Built with React, Node.js, Express, Socket.IO, MongoDB, and TypeScript.\n\n---\n\n## Features\n\n- **Real-time messaging** — WebSocket-powered chat via Socket.IO with sub-second delivery\n- **JWT authentication** — Secure login, signup, session management, and password reset flow\n- **Optimistic UI updates** — Messages appear instantly in the UI before the server confirms delivery\n- **Online presence** — Real-time online/offline detection with `lastSeen` tracking\n- **Media uploads** — Image and file attachments stored via Cloudinary\n- **Rate limiting \u0026 bot protection** — Arcjet shields the API from abuse\n- **Responsive design** — Tailwind CSS + DaisyUI, works on desktop and mobile\n- **Keyboard sound effects** — Optional audio feedback while typing\n- **Forgot / reset password** — Email-based password recovery via Resend\n\n## Architecture\n\n▶ **[View Interactive Architecture Diagram on Excalidraw](https://excalidraw.com/#json=JwKDclbwls3OlS8_aU59l,4iiiypHTpFIY25fQ3lx1sw)**\n\n### Overview\n\n```\n┌──────────────┐    HTTP REST    ┌──────────────┐    Mongoose    ┌────────────┐\n│   React App  │ ◄──────────────► │  Express API  │ ◄────────────► │  MongoDB   │\n│   (Vite)     │                  │  (Node.js)    │               │  (Atlas)   │\n│              │    WebSocket     │               │               └────────────┘\n│  Zustand +   │ ◄──────────────► │  Socket.IO    │ ┌──────────────────────────┐\n│  Socket.IO   │                  │  (presence)   │ │  Cloudinary · Resend ·   │\n│  Client      │                  │               │ │  Arcjet (external svcs)  │\n└──────────────┘                  └──────────────┘ └──────────────────────────┘\n```\n\n### Frontend\n\n| Layer | Technology | Purpose |\n|---|---|---|\n| Framework | React 19 + Vite + TypeScript | SPA with fast HMR |\n| State | Zustand | Global stores for auth and chat state |\n| Routing | React Router | Client-side navigation |\n| HTTP | Axios | REST API calls with cookies |\n| Real-time | Socket.IO Client | WebSocket messaging, presence |\n| Styling | Tailwind CSS + DaisyUI | Responsive, component-ready UI |\n| Auth | useAuthStore | JWT token handling, session check |\n\n### Backend\n\n| Layer | Technology | Purpose |\n|---|---|---|\n| Server | Node.js + Express | REST API, static file serving (prod) |\n| Database | MongoDB + Mongoose | User profiles, messages |\n| Real-time | Socket.IO | Bidirectional event-based communication |\n| Auth | JWT (jsonwebtoken) | Token-based authentication with cookies |\n| Email | Resend | Password reset emails |\n| Media | Cloudinary | Image/file uploads and transformations |\n| Security | Arcjet | Rate limiting, bot detection |\n| Validation | Zod (via Arcjet) | Request validation |\n\n### Data Flow (Sending a Message)\n\n1. User types and sends → React updates UI **optimistically** via Zustand\n2. Axios POSTs to `/api/messages/send/:id`\n3. Express stores the message in MongoDB via Mongoose\n4. Socket.IO emits `newMessage` event to the recipient\n5. Recipient's app receives the event → Zustand updates → UI re-renders\n\nOnline status, typing indicators, and unread counts all flow through the same Socket.IO channel.\n\n## Project Structure\n\n```\n/\n├── backend/               # Express API server\n│   └── src/\n│       ├── controllers/   # Route handlers (auth, messages, users)\n│       ├── middlewares/    # JWT auth, socket auth, Arcjet\n│       ├── models/        # Mongoose schemas (User, Message)\n│       ├── routes/        # Express route definitions\n│       ├── lib/           # DB, Socket.IO, Cloudinary, email config\n│       └── server.ts      # Entry point\n├── frontend/              # React SPA\n│   └── src/\n│       ├── pages/         # Route-level components\n│       ├── components/    # Reusable UI components\n│       ├── store/         # Zustand stores (auth, chat)\n│       ├── hooks/         # Custom hooks (keyboard sounds)\n│       ├── lib/           # Axios instance, error helpers\n│       └── App.tsx        # Root component with routing\n├── package.json           # Root scripts (build, start, test)\n└── README.md\n```\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 20+\n- MongoDB instance (local or [Atlas](https://www.mongodb.com/atlas))\n- [Cloudinary](https://cloudinary.com/) account\n- [Arcjet](https://arcjet.com/) account\n- [Resend](https://resend.com/) account (for password reset emails)\n\n### Environment Variables\n\nCopy the example file and fill in your local credentials:\n\n```bash\ncp backend/.env.example backend/.env\n```\n\nThe backend reads environment variables from `backend/.env`. The most important values are:\n\n```bash\nMONGO_URI=             # MongoDB connection string\nJWT_SECRET=            # Secret key for JWT signing\nCLOUDINARY_CLOUD_NAME= # Cloudinary cloud name\nCLOUDINARY_API_KEY=    # Cloudinary API key\nCLOUDINARY_API_SECRET= # Cloudinary API secret\nARCJET_KEY=            # Arcjet API key\nPORT=                  # Server port (default: 3000)\nCLIENT_URL=            # Frontend origin, e.g. http://localhost:5173\n```\n\nOptional password-reset email values:\n\n```bash\nRESEND_API_KEY=\nEMAIL_FROM=\nEMAIL_FROM_NAME=\n```\n\nSee [`backend/.env.example`](./backend/.env.example) and `backend/src/lib/env.ts` for the full list of supported variables.\n\n### Install \u0026 Run\n\n```bash\n# Install all dependencies\nnpm install\n\n# Start in production mode (serves frontend from backend)\nnpm start\n```\n\n**Development mode** (separate terminals):\n\n```bash\n# Terminal 1 — Backend\ncd backend\nnpm install\nnpm run dev\n\n# Terminal 2 — Frontend\ncd frontend\nnpm install\nnpm run dev\n```\n\nThe backend must be running before starting the frontend. In development, the frontend proxies API calls to `localhost:3000`.\n\n## API Endpoints\n\n### Authentication — `/api/auth`\n\n| Method | Endpoint | Auth | Description |\n|---|---|---|---|\n| POST | `/signup` | No | Create a new account |\n| POST | `/login` | No | Sign in |\n| POST | `/logout` | No | Clear session |\n| GET | `/check` | JWT | Verify active session |\n| POST | `/forgot-password` | No | Send reset email |\n| POST | `/reset-password/:token` | No | Reset password with token |\n| POST | `/change-password` | JWT | Change password (authenticated) |\n| PUT | `/update-profile` | JWT | Update display name, avatar, etc. |\n\n### Messages — `/api/messages`\n\n| Method | Endpoint | Auth | Description |\n|---|---|---|---|\n| GET | `/contacts` | JWT | List all contacts |\n| GET | `/chats` | JWT | List recent conversations |\n| GET | `/:id` | JWT | Get messages with a specific user |\n| POST | `/send/:id` | JWT | Send a message to a user |\n\n### Users — `/api/user`\n\n| Method | Endpoint | Auth | Description |\n|---|---|---|---|\n| GET | `/status/:id` | JWT | Get user online/lastSeen status |\n\n## Testing\n\n```bash\nnpm test\n```\n\nTests are run with [Vitest](https://vitest.dev/).\n\n## Deployment\n\nQuickChat is deployed on [Sevalla](https://sevalla.app/). The production build serves the React frontend as static files from the Express server.\n\n## License\n\nMIT — see [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardsun-dev%2Fquickchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowardsun-dev%2Fquickchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardsun-dev%2Fquickchat/lists"}