{"id":20298979,"url":"https://github.com/dofy/battleship","last_synced_at":"2026-04-13T14:30:59.789Z","repository":{"id":141383736,"uuid":"407150800","full_name":"dofy/battleship","owner":"dofy","description":"Battleship online game. (NOT FINISHED YET)","archived":false,"fork":false,"pushed_at":"2021-09-16T18:43:24.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T06:13:47.659Z","etag":null,"topics":["battleship","game","javascript","nextjs","nodejs","tailwindcss","webgame"],"latest_commit_sha":null,"homepage":"https://github.com/dofy/battleship","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dofy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-09-16T12:10:28.000Z","updated_at":"2021-09-17T10:27:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"38ae6dfb-4431-4150-a055-0240b0f66a2c","html_url":"https://github.com/dofy/battleship","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dofy/battleship","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fbattleship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fbattleship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fbattleship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fbattleship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dofy","download_url":"https://codeload.github.com/dofy/battleship/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fbattleship/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272936422,"owners_count":25018160,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["battleship","game","javascript","nextjs","nodejs","tailwindcss","webgame"],"created_at":"2024-11-14T16:13:00.711Z","updated_at":"2026-04-13T14:30:59.771Z","avatar_url":"https://github.com/dofy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚓ Battleship — 1v1 Multiplayer Naval Combat\n\nReal-time multiplayer Battleship game. Create or join a room, place your fleet, and sink the enemy.\n\n## Tech Stack\n\n- **Next.js 14** — Pages Router + Custom Server\n- **Socket.IO 4** — Real-time bidirectional communication (shared HTTP server)\n- **Tailwind CSS v3** — Styling with metallic zinc/sky/teal palette\n- **Share Tech Mono** — Monospace Google Font for military terminal aesthetics\n- **In-memory state** — Game state stored in Node.js process memory (`Map`), no external database\n\n## Features\n\n- Create public/private rooms, or join via 6-character room code\n- Public room lobby with live status\n- Placement phase: manually or randomly deploy ships, 90-second countdown (auto-random on timeout)\n- Turn-based combat with 12-second per-turn countdown (auto random attack on timeout)\n- Hit / miss / sunk feedback with coordinate labels (e.g. `B4 — Direct hit!`)\n- Visual attack animations: 💥 explosion for hits, ripple rings for misses — on both offense and defense boards\n- Full-screen Victory / Defeat overlay with confetti and animations\n- Rematch voting after game ends\n- Auto win on opponent disconnect\n- Local `localStorage` win/loss record\n\n## Fleet Configuration\n\n| Ship | Cells | Count |\n|------|-------|-------|\n| Carrier | 5 | 1 |\n| Battleship | 4 | 1 |\n| Cruiser | 3 | 1 |\n| Destroyer | 3 | 1 |\n| Submarine | 2 | 1 |\n\n## Quick Start\n\n```bash\n# Install dependencies\nnpm install\n\n# Development\nnpm run dev\n\n# Production\nnpm run build \u0026\u0026 npm start\n```\n\nOpen `http://localhost:3000` to play.\n\n## Project Structure\n\n```\nbattleship/\n├── server.js                   # Next.js Custom Server + Socket.IO init\n├── lib/\n│   ├── gameStore.js            # In-memory game state management\n│   ├── socketHandlers.js       # Socket.IO event handlers\n│   ├── shipUtils.js            # Core game logic (ship placement, hit detection)\n│   └── socket.js               # Client-side Socket.IO singleton\n├── pages/\n│   ├── _app.js                 # Global font, favicon\n│   ├── index.js                # Lobby (create/join room, combat record)\n│   └── room/[id].js            # Game room (placement + combat)\n├── components/\n│   ├── Board.js                # 10×10 grid with attack animations\n│   ├── ShipPlacer.js           # Drag-and-drop fleet placement\n│   ├── LobbyTable.js           # Public room list\n│   ├── GameStats.js            # Combat sidebar (fleet status, shot stats)\n│   └── GameOverOverlay.js      # Full-screen Victory/Defeat animation\n├── hooks/\n│   └── useLocalStats.js        # localStorage win/loss hook\n└── public/\n    └── favicon.svg             # Anchor icon in sky/zinc palette\n```\n\n## Tests\n\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdofy%2Fbattleship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdofy%2Fbattleship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdofy%2Fbattleship/lists"}