{"id":21015191,"url":"https://github.com/leho-dev/chat-server","last_synced_at":"2025-05-15T05:31:45.828Z","repository":{"id":208429226,"uuid":"609537027","full_name":"holedev/chat-server","owner":"holedev","description":"A Flask-based chat server application with OAuth authentication, real-time messaging using SocketIO, and email notifications.","archived":false,"fork":false,"pushed_at":"2025-03-30T15:02:53.000Z","size":102,"stargazers_count":0,"open_issues_count":8,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-30T16:20:13.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/holedev.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":"2023-03-04T13:31:59.000Z","updated_at":"2025-03-30T15:03:39.000Z","dependencies_parsed_at":"2023-12-04T03:26:20.177Z","dependency_job_id":"fa1cde48-e6d1-442c-b390-2d542ff0949c","html_url":"https://github.com/holedev/chat-server","commit_stats":null,"previous_names":["leho-dev/chat-server","holedev/chat-server"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fchat-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fchat-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fchat-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fchat-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holedev","download_url":"https://codeload.github.com/holedev/chat-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254282111,"owners_count":22045095,"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":[],"created_at":"2024-11-19T10:08:54.712Z","updated_at":"2025-05-15T05:31:45.812Z","avatar_url":"https://github.com/holedev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chat Server Application\r\n\r\nA Flask-based chat server application with OAuth authentication, real-time messaging using SocketIO, and email notifications.\r\n\r\n## Features\r\n\r\n- User authentication with Google OAuth\r\n- Real-time chat functionality using SocketIO\r\n- Email notifications\r\n- User profile management\r\n- MySQL database integration\r\n- Multilingual support (Vietnamese)\r\n\r\n## Prerequisites\r\n\r\n- Python 3.x\r\n- MySQL Server\r\n- SMTP server access (Gmail)\r\n- Google OAuth credentials\r\n\r\n## Installation\r\n\r\n1. Clone the repository:\r\n```bash\r\ngit clone \u003crepository-url\u003e\r\ncd chat-server\r\n```\r\n\r\n2. Create and activate a virtual environment:\r\n```bash\r\npython -m venv venv\r\nsource venv/bin/activate  # On Windows use: venv\\Scripts\\activate\r\n```\r\n\r\n3. Install dependencies:\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n4. Configure environment variables:\r\n   - Copy `.env.example` to `.env`\r\n   - Update the following variables with your values:\r\n```\r\nSECRET_KEY=\u003cyour-secret-key\u003e\r\nNAME_DB=chat_server\r\nPW_DB=\u003cyour-database-password\u003e\r\nOAUTH_CLIENT_ID=\u003cyour-google-oauth-client-id\u003e\r\nOAUTH_CLIENT_SECRET=\u003cyour-google-oauth-client-secret\u003e\r\nMAIL_USERNAME=\u003cyour-email\u003e\r\nMAIL_PASSWORD=\u003cyour-email-app-password\u003e\r\n```\r\n\r\n5. Set up the MySQL database:\r\n   - Create a database named 'chat_server'\r\n   - Configure database credentials in `.env`\r\n\r\n6. Configure OAuth:\r\n   - Set up a project in Google Cloud Console\r\n   - Create OAuth 2.0 credentials\r\n   - Add authorized redirect URIs:\r\n     - https://localhost:5001/callback\r\n\r\n## Security Configuration\r\n\r\n1. Enable HTTPS:\r\n   - SSL certificates are located in `chat_server/ssl/`\r\n   - Ensure valid certificates are in place\r\n\r\n2. Environment Security:\r\n   - Never commit `.env` file\r\n   - Use strong, random SECRET_KEY\r\n   - Store sensitive credentials only in environment variables\r\n   - Use app-specific passwords for email services\r\n\r\n## Running the Application\r\n\r\n1. Start the server:\r\n```bash\r\npython -m flask run --port=5001 --cert=chat_server/ssl/cert.pem --key=chat_server/ssl/key.pem\r\n```\r\n\r\n2. Access the application:\r\n   - Open https://localhost:5001 in your browser\r\n   - Login with Google OAuth\r\n\r\n## Project Structure\r\n\r\n```\r\nchat_server/\r\n├── __init__.py          # Application initialization\r\n├── controllers.py       # Route handlers\r\n├── dao.py              # Data access objects\r\n├── decorators.py       # Custom decorators\r\n├── models.py           # Database models\r\n├── static/             # Static files (CSS, JS, images)\r\n├── templates/          # HTML templates\r\n└── ssl/                # SSL certificates\r\n```\r\n\r\n## Development Guidelines\r\n\r\n1. Security:\r\n   - Always use HTTPS in production\r\n   - Keep dependencies updated\r\n   - Follow secure coding practices\r\n   - Never commit sensitive credentials\r\n\r\n2. Code Style:\r\n   - Follow PEP 8\r\n   - Use meaningful variable names\r\n   - Add comments for complex logic\r\n   - Keep functions focused and modular\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleho-dev%2Fchat-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleho-dev%2Fchat-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleho-dev%2Fchat-server/lists"}