{"id":27125099,"url":"https://github.com/simonstnn/chitchatz","last_synced_at":"2026-05-08T05:33:23.458Z","repository":{"id":286145423,"uuid":"960508982","full_name":"SimonStnn/ChitChatz","owner":"SimonStnn","description":"App made for course IoT Apps @ Vives","archived":false,"fork":false,"pushed_at":"2025-04-08T10:13:42.000Z","size":266,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:09:02.202Z","etag":null,"topics":["cookies","jquery","jwt","nodejs","sass","typescript","ws"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonStnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-04-04T14:57:39.000Z","updated_at":"2025-04-08T10:13:46.000Z","dependencies_parsed_at":"2025-04-07T10:23:18.019Z","dependency_job_id":"4fb6c727-7e0f-4edf-bb08-2486f89c9849","html_url":"https://github.com/SimonStnn/ChitChatz","commit_stats":null,"previous_names":["simonstnn/web-rooms","simonstnn/chitchatz"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FChitChatz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FChitChatz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FChitChatz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2FChitChatz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonStnn","download_url":"https://codeload.github.com/SimonStnn/ChitChatz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125619,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cookies","jquery","jwt","nodejs","sass","typescript","ws"],"created_at":"2025-04-07T14:29:14.399Z","updated_at":"2026-05-08T05:33:23.453Z","avatar_url":"https://github.com/SimonStnn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChitChatz\n\nChitChatz is a real-time chat application built with WebSockets, allowing users to create and join chat rooms, send messages, and communicate in real-time.\n\n![ChitChatz Logo](client/assets/images/logo_full.png)\n\n## Features\n\n- Real-time messaging using WebSockets\n- Create and join chat rooms\n- JWT authentication\n- Responsive design\n- Simple and intuitive user interface\n\n## Architecture\n\nChitChatz follows a client-server architecture:\n\n### Server\n\n- Built with Node.js and WebSocket (ws library)\n- JWT-based authentication\n- Room management (creation, joining, leaving)\n- Real-time message broadcasting\n\n### Client\n\n- Built with TypeScript, SCSS, and jQuery\n- WebSocket communication\n- Responsive UI\n- State management\n\n## Project Structure\n\n```text\nChitChatz/\n├── client/               # Client-side code\n│   ├── assets/           # Static assets (images, etc.)\n│   ├── src/              # Source code\n│   │   ├── components/   # UI components\n│   │   ├── controller/   # Application logic \u0026 state management\n│   │   ├── styles/       # SCSS styles\n│   │   ├── const.ts      # Constants and types\n│   │   ├── index.ts      # Entry point\n│   │   ├── types.ts      # TypeScript type definitions\n│   │   └── utils.ts      # Utility functions\n│   ├── index.html        # Main HTML file\n│   └── package.json      # Client dependencies\n│\n├── server/               # Server-side code\n│   ├── src/              # Source code\n│   │   ├── const.ts      # Constants and types\n│   │   └── index.ts      # Server entry point\n│   └── package.json      # Server dependencies\n│\n├── .env                  # Environment variables\n├── .env.template         # Template for environment variables\n├── tsconfig.json         # TypeScript configuration\n└── README.md             # This file\n```\n\n## Setup and Installation\n\n### Prerequisites\n\n- Node.js (v14+) and npm/yarn (for local development)\n- Docker and Docker Compose (for containerized deployment)\n\n### Docker Setup (Recommended)\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-username/ChitChatz.git\n   cd ChitChatz\n   ```\n\n2. Create a `.env` file from the template:\n\n   ```bash\n   cp .env.template .env\n   ```\n\n3. Edit the `.env` file with your secret key:\n\n   ```text\n   SECRET=your_jwt_secret_key\n   PORT=3000\n   ```\n\n4. Build and start the containers:\n\n   ```bash\n   docker-compose up -d\n   ```\n\n5. Access the application at \u003chttp://localhost\u003e\n\n6. To stop the application:\n\n   ```bash\n   docker-compose down\n   ```\n\n### Manual Setup\n\n### Environment Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-username/ChitChatz.git\n   cd ChitChatz\n   ```\n\n2. Create a `.env` file from the template:\n\n   ```bash\n   cp .env.template .env\n   ```\n\n3. Edit the `.env` file and set the required variables:\n\n   ```text\n   SECRET=your_jwt_secret_key\n   PORT=3000  # Optional, defaults to 3000\n   ```\n\n### Server Setup\n\n1. Navigate to the server directory:\n\n   ```bash\n   cd server\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Start the server:\n\n   ```bash\n   npm start\n   ```\n\n   For development with hot-reload:\n\n   ```bash\n   npm run dev\n   ```\n\n### Client Setup\n\n1. Navigate to the client directory:\n\n   ```bash\n   cd client\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Start the client development server:\n\n   ```bash\n   npm start\n   ```\n\n   For production build:\n\n   ```bash\n   npm run build\n   ```\n\n## Usage\n\n1. Open the client application in your browser (default: \u003chttp://localhost:8080\u003e)\n2. Enter a username to register\n3. Create a new room or join an existing one\n4. Start chatting!\n\n## WebSocket API\n\n### Client to Server Messages\n\n| Event        | Payload                         | Description                    |\n| ------------ | ------------------------------- | ------------------------------ |\n| `register`   | `{ name: string }`              | Register with a username       |\n| `get_room`   | `{ jwt: string }`               | Get current room information   |\n| `get_rooms`  | `{ jwt: string }`               | Get list of available rooms    |\n| `join_room`  | `{ room: string, jwt: string }` | Join a specific room           |\n| `message`    | `{ data: string, jwt: string }` | Send a message to current room |\n| `leave_room` | `{ jwt: string }`               | Leave the current room         |\n\n### Server to Client Messages\n\n| Event      | Payload                                                     | Description               |\n| ---------- | ----------------------------------------------------------- | ------------------------- |\n| `register` | `{ data: {}, jwt?: string }`                                | Registration confirmation |\n| `room`     | `{ data: string \\| null, jwt?: string }`                    | Current room information  |\n| `rooms`    | `{ data: string[], jwt?: string }`                          | List of available rooms   |\n| `message`  | `{ data: { from: string, content: string }, jwt?: string }` | Message from a user       |\n| `error`    | `{ data: string[], jwt?: string }`                          | Error messages            |\n\n## Authentication\n\nChitChatz uses JWT (JSON Web Tokens) for authentication:\n\n- Tokens are issued upon registration\n- Tokens contain the user's name and current room\n- Tokens expire after 1 hour\n- Token renewal is handled automatically by the client\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\n[MIT](LICENSE)\n\n## Acknowledgments\n\n- [ws](https://github.com/websockets/ws) - WebSocket library\n- [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) - JWT implementation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonstnn%2Fchitchatz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonstnn%2Fchitchatz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonstnn%2Fchitchatz/lists"}