{"id":19526226,"url":"https://github.com/sutac/connect4","last_synced_at":"2026-04-04T00:04:31.593Z","repository":{"id":207840132,"uuid":"718600618","full_name":"sutaC/Connect4","owner":"sutaC","description":"Connect4 is a project aimed at implementing the classic game of the same name using web technologies. ","archived":false,"fork":false,"pushed_at":"2024-12-19T18:03:02.000Z","size":521,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-19T18:37:45.348Z","etag":null,"topics":["css-modules","expressjs","mongodb","nextjs","nextjs14","nodejs","typescript","websocket"],"latest_commit_sha":null,"homepage":"https://connect4.sutac.pl/","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/sutaC.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-11-14T12:27:21.000Z","updated_at":"2024-12-19T18:08:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"52e29a44-5a4c-4066-b73e-8c04e661979c","html_url":"https://github.com/sutaC/Connect4","commit_stats":null,"previous_names":["sutac/connect4"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sutaC%2FConnect4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sutaC%2FConnect4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sutaC%2FConnect4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sutaC%2FConnect4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sutaC","download_url":"https://codeload.github.com/sutaC/Connect4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233050952,"owners_count":18617356,"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":["css-modules","expressjs","mongodb","nextjs","nextjs14","nodejs","typescript","websocket"],"created_at":"2024-11-11T01:08:43.519Z","updated_at":"2026-04-04T00:04:31.578Z","avatar_url":"https://github.com/sutaC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect4 Project\n\nConnect4 is a project aimed at implementing the classic game of the same name using web technologies.\n\nThe application is intended to enable gameplay in three modes, both locally and over the network. Additionally, the application will be adapted to function as a native app using Progressive Web App (PWA) technology.\n\n## Used technologies\n\n- Next.js\n- Typescript\n- CSS Modules\n- Express.js\n- MongoDB\n- Web Sockets (ws)\n- PWA\n- Docker\n\n## Self-hosting\n\n### Requiraments\n\n- Docker\n- Docker compose\n- Cron (optional, required for automated cleanup in production)\n\n### Enviroment configuration\n\nAn environment file is required for the application to run.\n\n1. Copy the example file:\n\n```bash\ncp .env.example .env\n```\n\n2. Fill in required values described in `.env.example`\n\n### Development\n\nDevelopment uses Docker with:\n\n- bind-mounted source code\n\n- live reload for the web server and client\n\n---\n\nTo run dev:\n\n1. Install dependencies: (For IDE support)\n\n```bash\ncd ./client\nnpm install\ncd ../server\nnpm install\n```\n\n2. Build images:\n\n```bash\ndocker build -t connect4-client ./client\ndocker build -t connect4-server ./server\n```\n\n3. Start the app (dev mode):\n\n```bash\ndocker compose up\n```\n\n4. Cleanup worker (manual):\n\n```bash\n./scripts/run_cleanup.sh\n```\n\n### Production\n\nProduction uses the same image with stricter settings.\n\n---\n\nTo run production:\n\n1. Build images:\n\n```bash\ndocker build -t connect4-client ./client\ndocker build -t connect4-server ./server\n```\n\n2. Setup cron jobs:\n\n```bash\n./scripts/setup_cron.sh\n```\n\n\u003e Schedules the cleanup worker to run once per day via cron.\n\n3. Start the app:\n\n```bash\ndocker compose -f docker-compose.yml up\n```\n\n### Configuring project with NGINX\n\nExample NGINX configuration for this project:\n\n```nginx\n\nhttp {\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n\n    limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=5r/s;\n}\n\nserver {\n    server_name _;\n    listen 80;\n    # In production you should use `listen 443 ssl;` for HTTPS connections.\n\n    location / {\n        limit_req zone=req_limit_per_ip burst=10 nodelay;\n        proxy_pass http://127.0.0.1:3000;\n        proxy_http_version 1.1;\n    }\n\n    location /api {\n        limit_req zone=req_limit_per_ip burst=10 nodelay;\n        proxy_pass http://127.0.0.1:3010;\n        proxy_http_version 1.1;\n\n    }\n    location /server/ws {\n        limit_req zone=req_limit_per_ip burst=10 nodelay;\n        proxy_pass http://127.0.0.1:3020;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection \"upgrade\";\n        # For WS configuration\n    }\n}\n```\n\n### Removing production systems\n\nTo completely remove the production setup, use the provided helper scripts:\n\n- `remove_cron.sh`\n\n    \u003e Removes the scheduled cron job responsible for running the cleanup worker.\n\n---\n\n**Recommended order:**\n\n1. Stop the running containers:\n\n```bash\ndocker compose down\n```\n\n2. Remove the cron job:\n\n```bash\n./scripts/remove_cron.sh\n```\n\nAfter these steps, the production environment will be fully removed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsutac%2Fconnect4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsutac%2Fconnect4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsutac%2Fconnect4/lists"}