{"id":15988682,"url":"https://github.com/smirnovlad/socialnetwork","last_synced_at":"2026-04-08T20:46:18.114Z","repository":{"id":214235661,"uuid":"735951054","full_name":"smirnovlad/SocialNetwork","owner":"smirnovlad","description":"HuaoMao social network, developed with Django + React","archived":false,"fork":false,"pushed_at":"2024-03-11T20:17:50.000Z","size":47838,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T20:03:00.428Z","etag":null,"topics":["chat","ci-cd","django","django-channels","django-chat-app","django-rest-framework","djoser","docker","messenger","nginx","react","redux","social-network"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/smirnovlad.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-12-26T14:52:14.000Z","updated_at":"2024-06-22T20:54:32.000Z","dependencies_parsed_at":"2024-10-08T04:20:47.249Z","dependency_job_id":"4737f32e-9458-4fce-af28-622f320f2b85","html_url":"https://github.com/smirnovlad/SocialNetwork","commit_stats":null,"previous_names":["smirnovlad/socialnetwork"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smirnovlad/SocialNetwork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirnovlad%2FSocialNetwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirnovlad%2FSocialNetwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirnovlad%2FSocialNetwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirnovlad%2FSocialNetwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smirnovlad","download_url":"https://codeload.github.com/smirnovlad/SocialNetwork/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirnovlad%2FSocialNetwork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["chat","ci-cd","django","django-channels","django-chat-app","django-rest-framework","djoser","docker","messenger","nginx","react","redux","social-network"],"created_at":"2024-10-08T04:20:38.683Z","updated_at":"2026-04-08T20:46:18.096Z","avatar_url":"https://github.com/smirnovlad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HuaoMao\n\n## Project idea\n\n**HuaoMao** is a social network with the following implemented features:\n\u003col\u003e\n    \u003cli\u003e Site authorization\n    \u003cli\u003e Creation of a personal profile with the ability to edit it (photo, birthday, city of residence)\n    \u003cli\u003e Adding friends\n    \u003cli\u003e Synchronized message exchange\n    \u003cli\u003e Ability to leave feedback about the site\n\u003c/ol\u003e\n\n### Implementation details\n\n- Web application design: [design in Figma](https://www.figma.com/file/hlFAIfFrGb8HHlGH0B2Uy7/HuaoMao?type=design\u0026node-id=0-1\u0026mode=design\u0026t=LrnYanTZAVLeXxYG-0)\n\n- The backend of the application is written in Django. Djoser is used for authentication, and Django Channels for WebSocket notification.\n\n- Frontend is developed using React + Redux.\n\n### Example\n\nAt the time of writing this README, the application is hosted on the server http://158.160.113.82/. The virtual machine (server) is rented on Yandex Cloud.\n#### Regular user\n\n![MVP.gif](samples/MVP.gif)\n\n#### Admin workflow\n\n![AdminWorkflow.gif](samples/AdminWorkflow.gif)\n\nUnauthenticated users can view the following pages:\n\n- http://158.160.113.82/login\n- http://158.160.113.82/profile/\u003cid\\\u003e\n- http://158.160.113.82/users\n- http://158.160.113.82/feedback\n\n## CI/CD\n\nUpon push and pull request to the main branch, a workflow is triggered. It includes testing the application and deploying it to the remote server in case of success. A separate volume is allocated for the database, ensuring that its state remains current (not reset) with each update.\n## How to build\n### Locally\nFirst, update the constants in `backend/backend/settings.py` and `react-app/src/api/config.js`, corresponding to the host and ports.\n1. Apply migrations to data models from the backend directory:\n```\npython3 manage.py migrate\n```\n\n2. Run the server from the backend directory:\n```\npython3 manage.py runserver\n```\n\n3. Start the Docker container for handling sockets with Redis channels:\n```\ndocker run -p 6379:6379 -d redis:5\n```\n\n4. Run the React application from the react-app directory:\n```\nnpm install\nnpm start\n```\n\n\n\n### Dockerization\n#### Local\n1. First, bring up the container. From the project's root folder (where `docker-compose.yml` is located), execute:\n```\ndocker-compose up -d\n```\nTo rebuild images, execute:\n```\ndocker-compose up --build\n```\n2. If the command ends with an error like:\n```\nERROR: for nginx  Cannot start service nginx: Ports are not available: exposing port TCP 0.0.0.0:80 -\u003e 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: address already in use\n```\nCheck which process is occupying port 80:\n```\nsudo lsof -i :80\n```\nTerminate that process using:\n```\nsudo kill -9 \u003cpid\u003e\n```\nIf the port is occupied by the Apache server, run:\n```\n/etc/init.d/apache2 stop\n```\n#### Remote\nAssuming **158.160.113.82** is the IP of the server where we want to run our application.\n1. Create a context for remote SSH:\n```\ndocker context create remoteContext --docker host=ssh://smirnovlad@158.160.113.82\n```\n2. Now, start the container with the remote context:\n```\ndocker-compose --context remoteContext up -d\n```\n\n#### Extra\n\n- To update, for example, the host of the context:\n```\ndocker context update \\\n    --docker \"host=ssh://smirnovlad@158.160.113.82\" \\\n    remoteContext\n```\n\n- To remove the context:\n```\ndocker context rm remoteContext\n```\n\n- Command to stop all containers:\n```\ndocker stop $(docker ps -a -q)\n```\n\n- Command to remove all images:\n```\ndocker system prune -a --volumes\n```\n\n## TODO\n\n1. Devise more comprehensive tests (requests to the remote server, authentication, etc.)\n2. Transition to JWT tokens\n3. Add cryptographic dependencies\n4. Add SEO support\n5. Message notification outside the chat","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmirnovlad%2Fsocialnetwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmirnovlad%2Fsocialnetwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmirnovlad%2Fsocialnetwork/lists"}