{"id":27067998,"url":"https://github.com/buvghhj/nestjs-streaming-application","last_synced_at":"2026-04-09T19:47:29.270Z","repository":{"id":284312073,"uuid":"954521025","full_name":"buvghhj/nestjs-streaming-application","owner":"buvghhj","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-16T01:32:39.000Z","size":16529,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T02:41:49.971Z","etag":null,"topics":["ansible-playbook","ci-cd","docker","grafana-dashboard","graphql","jenkins","kubernetes","livekit","nestjs","nextjs","postgresql","prometheus","reactjs","redis","s3-storage","subscription","tailwindcss","telegram-bot","webhook"],"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/buvghhj.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-03-25T07:59:33.000Z","updated_at":"2025-04-16T01:32:43.000Z","dependencies_parsed_at":"2025-04-01T11:27:49.547Z","dependency_job_id":null,"html_url":"https://github.com/buvghhj/nestjs-streaming-application","commit_stats":null,"previous_names":["buvghhj/streaming-application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/buvghhj/nestjs-streaming-application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buvghhj%2Fnestjs-streaming-application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buvghhj%2Fnestjs-streaming-application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buvghhj%2Fnestjs-streaming-application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buvghhj%2Fnestjs-streaming-application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buvghhj","download_url":"https://codeload.github.com/buvghhj/nestjs-streaming-application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buvghhj%2Fnestjs-streaming-application/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263130517,"owners_count":23418293,"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":["ansible-playbook","ci-cd","docker","grafana-dashboard","graphql","jenkins","kubernetes","livekit","nestjs","nextjs","postgresql","prometheus","reactjs","redis","s3-storage","subscription","tailwindcss","telegram-bot","webhook"],"created_at":"2025-04-05T20:17:22.788Z","updated_at":"2025-12-30T18:52:47.835Z","avatar_url":"https://github.com/buvghhj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TanStream Project\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/NestJS-E0234E?style=for-the-badge\u0026logo=nestjs\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/GraphQL-E10098?style=for-the-badge\u0026logo=graphql\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-336791?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Redis-DC382D?style=for-the-badge\u0026logo=redis\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Docker-2496ED?style=for-the-badge\u0026logo=docker\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Next.js-000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/React-61DAFB?style=for-the-badge\u0026logo=react\u0026logoColor=black\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TailwindCSS-38B2AC?style=for-the-badge\u0026logo=tailwindcss\u0026logoColor=white\" /\u003e\n\u003c/p\u003e\n\n## Giới thiệu\nTanStream là một nền tảng streaming cho phép người dùng phát trực tiếp, tương tác với khán giả, quản lý thông báo, thanh toán và đăng ký gói tài trợ.\n\n## Cấu trúc Database\nDưới đây là sơ đồ cấu trúc database của dự án:\n\n![database-diagram](https://github.com/user-attachments/assets/f273f5b3-115d-4ba7-8ba1-c804d0430abf)\n\n### Các bảng chính:\n- **User**: Quản lý thông tin người dùng.\n- **Stream**: Lưu trữ thông tin về các buổi phát trực tiếp.\n- **ChatMessage**: Chứa tin nhắn được gửi trong các buổi stream.\n- **Notification**: Quản lý thông báo gửi đến người dùng.\n- **Transaction**: Lưu thông tin thanh toán và giao dịch.\n- **Token**: Quản lý token xác thực.\n- **Category**: Phân loại nội dung stream.\n- **SponsorshipPlan**: Các gói tài trợ có sẵn cho kênh.\n- **SponsorshipSubscription**: Đăng ký tài trợ của người dùng.\n- **SocialLink**: Liên kết mạng xã hội của người dùng.\n- **Follow**: Quản lý quan hệ theo dõi giữa người dùng.\n- **NotificationSettings**: Cài đặt thông báo cho từng người dùng.\n\n## Cách pull Docker images\nĐể chạy backend và frontend của dự án, pull các Docker images từ Dockerhub:\n\n```sh\n# Pull backend image\ndocker pull maitanchan/tanstream-backend:latest\n\n# Pull frontend image\ndocker pull maitanchan/tanstream-frontend:latest\n```\n\nSau khi pull xong, chạy container từ image này bằng lệnh:\n\n```sh\n# Chạy backend\ndocker run -d -p 8000:8000 --name tanstream-backend maitanchan/tanstream-backend:latest\n\n# Chạy frontend\ndocker run -d -p 3000:3000 --name tanstream-frontend maitanchan/tanstream-frontend:latest\n```\n\n## Hướng dẫn khởi chạy dự án\nDự án sử dụng **PostgreSQL** làm database chính và **Redis** để lưu trữ cache. Bạn có thể sử dụng Docker Compose để chạy toàn bộ hệ thống:\n\n### 1. Khởi chạy database và Redis\n```sh\ndocker-compose up -d postgres redis\n```\nĐiều này sẽ tạo hai container:\n- **PostgreSQL** chạy trên cổng `5432`\n- **Redis** chạy trên cổng `6379`\n\n### 2. Cấu hình biến môi trường, tạo file `.env` và cấu hình các biến môi trường như sau:\nBackend\n```env\nNODE_ENV='development'\n\nAPPLICATION_PORT=4000\nAPPLICATION_URL='http://localhost:${APPLICATION_PORT}'\n\nGRAPHQL_PREFIX='/graphql'\n\nALLOWED_ORIGIN='http://localhost:3000'\n\nCOOKIES_SECRET=''\nSESSION_SECRET=''\nSESSION_NAME=''\nSESSION_DOMAIN=''\nSESSION_MAX_AGE=''\nSESSION_HTTP_ONLY=\nSESSION_SECURE=\nSESSION_FOLDER=':'\n\nPOSTGRES_USER=''\nPOSTGRES_PASSWORD=''\nPOSTGRES_HOST=''\nPOSTGRES_PORT=''\nPOSTGRES_DATABASE=''\nPOSTGRES_URI='postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}'\n\nREDIS_USER=''\nREDIS_PASSWORD=''\nREDIS_HOST=''\nREDIS_PORT=''\nREDIS_URI='redis://${REDIS_USER}:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}'\n\nMAIL_HOST='smtp.gmail.com'\nMAIL_PORT=465\nMAIL_LOGIN=''\nMAIL_PASSWORD=''\n\nS3_AWS_REGION=\"\"\nS3_AWS_ACCESS_KEY_ID=\"\"\nS3_AWS_SECRET_ACCESS_KEY=\"\"\nS3_AWS_BUCKET_NAME=\"\"\n\nLIVEKIT_API_URL=\"\"\nLIVEKIT_API_KEY=\"\"\nLIVEKIT_API_SECRET=\"\"\n\nTELEGRAM_BOT_TOKEN=''\n\nSTRIPE_SECRET_KEY=''\nSTRIPE_WEBHOOK_SECRET=''\n```\n\nFrontend\n```env\nNEXT_PUBLIC_APP_URL='http://localhost:3000'\nNEXT_PUBLIC_SERVER_URL='http://localhost:4000/graphql'\nNEXT_PUBLIC_WEBSOCKET_URL='ws://localhost:4000/graphql'\nNEXT_PUBLIC_LIVEKIT_WS_URL='wss://xxx-xxx.livekit.cloud'\n```\n\n### 3. Khởi chạy backend và frontend\n```sh\ndocker-compose up -d backend frontend\n```\n\nHệ thống sẽ khởi chạy toàn bộ dịch vụ backend, frontend, database và Redis.\n\n---\n**Ghi chú:**\n- Nếu có bất kỳ vấn đề gì khi chạy dự án, vui lòng kiểm tra logs của container bằng:\n```sh\ndocker logs tanstream-backend\ndocker logs tanstream-frontend\n```\n- Backend sử dụng Telegram API, tuy nhiên, Telegram API hiện bị chặn IP tại Việt Nam. Nếu bạn đang triển khai dự án ở Việt Nam, hãy sử dụng VPN hoặc proxy để tránh gián đoạn.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuvghhj%2Fnestjs-streaming-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuvghhj%2Fnestjs-streaming-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuvghhj%2Fnestjs-streaming-application/lists"}