{"id":23491481,"url":"https://github.com/sarwar-asik/study-live-server","last_synced_at":"2026-04-11T17:38:24.199Z","repository":{"id":251459761,"uuid":"835928833","full_name":"sarwar-asik/study-live-server","owner":"sarwar-asik","description":"Realtime WebRTC Backend about chat/audio/video","archived":false,"fork":false,"pushed_at":"2025-01-10T06:59:30.000Z","size":7427,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T01:45:58.200Z","etag":null,"topics":["docker","express","multer","nodejs","postgresql","prisma","socket-io","swagger","webrtc"],"latest_commit_sha":null,"homepage":"https://study-live-server-2.onrender.com/api-docs","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/sarwar-asik.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":"2024-07-30T20:05:47.000Z","updated_at":"2025-01-10T06:59:33.000Z","dependencies_parsed_at":"2025-01-10T07:37:04.966Z","dependency_job_id":null,"html_url":"https://github.com/sarwar-asik/study-live-server","commit_stats":null,"previous_names":["sarwar-asik/study-live-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sarwar-asik/study-live-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fstudy-live-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fstudy-live-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fstudy-live-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fstudy-live-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarwar-asik","download_url":"https://codeload.github.com/sarwar-asik/study-live-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fstudy-live-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519255,"owners_count":22870327,"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":["docker","express","multer","nodejs","postgresql","prisma","socket-io","swagger","webrtc"],"created_at":"2024-12-25T01:27:59.846Z","updated_at":"2026-04-11T17:38:19.181Z","avatar_url":"https://github.com/sarwar-asik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Study Live Server \n\n\u003cdiv align=\"center\"\u003e\n\n[![Node.js](https://img.shields.io/badge/Node.js-v18.x-green.svg)](https://nodejs.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-v4.x-blue.svg)](https://www.typescriptlang.org)\n[![Socket.IO](https://img.shields.io/badge/Socket.IO-v4.x-black.svg)](https://socket.io)\n[![Kafka](https://img.shields.io/badge/Kafka-Latest-red.svg)](https://kafka.apache.org)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-v14.x-blue.svg)](https://www.postgresql.org)\n\n\u003c/div\u003e\n\n## Overview\n\nA powerful real-time communication server supporting audio/video calls, chat, and file sharing. Built with modern technologies and best practices for scalability and performance.\n\n## Features\n\n### Authentication \u0026 Security\n- JWT-based authentication\n- Role-based access control\n- Secure password hashing\n- CORS protection\n\n### Real-Time Communication\n- Text chat with typing indicators\n- Audio/Video calls using WebRTC\n- File sharing \u0026 image uploads\n- Presence detection\n\n### Scalability\n- Kafka integration for distributed events\n- Socket.IO for real-time communication\n- Horizontal scaling support\n- Redis for session management\n\n### Developer Experience\n- TypeScript for type safety\n- Swagger API documentation\n- Prisma ORM for database operations\n- Husky for git hooks\n\n## Quick Start\n\n### Prerequisites\n\n- Node.js (v18.x or later)\n- PostgreSQL (v14.x or later)\n- Kafka cluster\n- Redis (optional, for session storage)\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/sarwar-asik/study-live-server\n   cd study-live-server\n   ```\n\n2. **Install dependencies**\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables**\n   Create a `.env` file in the root directory (see Environment Variables section below)\n\n4. **Run database migrations**\n   ```bash\n   npx prisma migrate dev\n   ```\n\n5. **Start the server**\n   ```bash\n   # Development\n   npm run dev\n\n   # Production\n   npm run build\n   npm start\n   ```\n\n## Environment Variables\n\nCreate a `.env` file in the root directory with the following variables:\n\n```env\n# Server Configuration\nPORT=5000\nNODE_ENV=development\nSERVER_NAME=study-live-server\n\n# Database\nDATABASE_URL=\"postgresql://user:password@localhost:5432/dbname\"\n\n# Authentication\nJWT_SECRET=your-jwt-secret\nJWT_EXPIRES_IN=7d\nBCRYPT_SALT_ROUNDS=12\n\n# Admin Credentials\nSUPER_ADMIN_EMAIL=admin@example.com\nSUPER_ADMIN_PASSWORD=admin123\nDEFAULT_STUDENT_PASS=student123\n\n# Cloudinary Configuration\nCLOUDINARY_CLOUD_NAME=your-cloud-name\nCLOUDINARY_API_KEY=your-api-key\nCLOUDINARY_API_SECRET=your-api-secret\n\n# Kafka Configuration\nKAFKA_CLIENT_ID=study-live-server\nKAFKA_BROKERS=kafka://kafka-0.kafka.svc.cluster.local:9092,kafka-1.kafka.svc.cluster.local:9092\n\n# Frontend URL (CORS)\nFRONTEND_URL=http://localhost:3000\n```\n\n## API Documentation\n\n### REST Endpoints\n\n#### Authentication\n- `POST /api/auth/sign-up` - Register new user\n- `POST /api/auth/login` - User login\n- `GET /api/auth/profile` - Get user profile\n- `GET /api/user/:id` - Get user details\n\n#### Messaging\n- `POST /api/messages` - Send message\n- `POST /api/messages/image` - Send message with image\n- `GET /api/messages` - Get conversation history\n\n### Socket.IO Events\n\n#### Chat Events\n- `send-message` - Send chat message\n- `new-message` - Receive new message\n- `typing` - User typing indicator\n\n#### Video Chat Events\n- `join-room` - Join video chat room\n- `offer` - WebRTC offer\n- `answer` - WebRTC answer\n- `ice-candidate` - ICE candidate exchange\n\n### Kafka Topics\n- `room-join` - Room join events\n- `room-leave` - Room leave events\n- `webrtc-offer` - WebRTC offers\n- `webrtc-answer` - WebRTC answers\n- `ice-candidate` - ICE candidates\n\n## Security Features\n\n- JWT authentication\n- Request validation using Zod\n- CORS protection\n- Rate limiting\n- Secure password hashing\n- Input sanitization\n\n## Testing\n\n```bash\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n```\n\n## Production Deployment\n\n1. Build the application:\n   ```bash\n   npm run build\n   ```\n\n2. Start the production server:\n   ```bash\n   npm start\n   ```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## Support\n\nFor support, email support@studylive.com or join our Slack channel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarwar-asik%2Fstudy-live-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarwar-asik%2Fstudy-live-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarwar-asik%2Fstudy-live-server/lists"}