{"id":23447210,"url":"https://github.com/drewcook/ts-battleship","last_synced_at":"2026-03-14T05:05:47.965Z","repository":{"id":57156427,"uuid":"385088583","full_name":"drewcook/ts-battleship","owner":"drewcook","description":"The game of Battleship, written in TypeScript.","archived":false,"fork":false,"pushed_at":"2024-08-29T05:05:33.000Z","size":3440,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-15T23:22:07.769Z","etag":null,"topics":["battleship","koa","nodejs","react","typescript"],"latest_commit_sha":null,"homepage":"https://ts-battleship.herokuapp.com/","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/drewcook.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":"2021-07-12T01:13:42.000Z","updated_at":"2024-08-29T05:05:37.000Z","dependencies_parsed_at":"2024-08-28T22:23:19.011Z","dependency_job_id":"c5e46d07-6ab0-493e-84b9-9074fb8a516b","html_url":"https://github.com/drewcook/ts-battleship","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewcook%2Fts-battleship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewcook%2Fts-battleship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewcook%2Fts-battleship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewcook%2Fts-battleship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drewcook","download_url":"https://codeload.github.com/drewcook/ts-battleship/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231019112,"owners_count":18315919,"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":["battleship","koa","nodejs","react","typescript"],"created_at":"2024-12-23T21:16:49.130Z","updated_at":"2025-12-16T04:43:31.483Z","avatar_url":"https://github.com/drewcook.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Battleship\n\nPlay the [Demo App](https://ts-battleship.herokuapp.com/).\n\nThis is the classic game of battleship.  It is a full-stack web application writtin in TypeScript. It follows object-oriented design patterns and principals. It was inspired by [this design](https://www.cs.nmsu.edu/~rth/cs/cs187/f97/battleshipdesign.html) and [SOLID Principles](https://en.wikipedia.org/wiki/SOLID).  The AI behavior is inspired by [this article](https://www.datagenetics.com/blog/december32011/) which contains some techniques for random placements and guessing.\n\nThis project includes the following tech:\n\n- TypeScript\n- Node.js with [Koa](https://koajs.com/) for route handling via a web server\n- React single-page application from [Create React App](https://create-react-app.dev/)\n- Prettier for linting with [altheajs-prettier-config](https://www.npmjs.com/package/altheajs-prettier-config)\n\n## Types\n\nThis project also serves as a host for the `battleship-types` package hosted on [npmjs.org](https://www.npmjs.com/package/battleship-types), which includes type definitions of a typical game of Battleship, and is used throughout this project. It serves the purpose of having a single, shared set of types that can be used across both server and client applications, reducing duplication of definitions in both frontend and backend, and easing the maintainability of changes to the schema over time.\n\nInherently, the `battleship-types` package code is located under the `./types` directory.\n\n## How To Run\n\nThe project must be compiled before running, and the dist directory is not checked into git. To run the project locally, use the following command:\n\n### Install Dependencies\n\n```bash\n# server\ncd ./server \u0026\u0026 npm i\n# or\ncd ./server \u0026\u0026 yarn install\n\n# client\ncd ./client \u0026\u0026 npm i\n# or\ncd ./client \u0026\u0026 yarn install\n```\n\n### Build in Development Mode\n\n```bash\n# server\ncd ./server\nnpm run dev\n\n# client\ncd ./client\nyarn start\n```\n\n### Build in Production Mode\n\n```bash\n# server\ncd ./server\nnpm build\n\n# client\ncd ./client\nyarn build\n```\n\nThis will compile the TypeScript into JavaScript into a `dist/` directory, and it will run the code with `nodemon`.\n\n### Ways To Play\n\n- Player vs Computer\n- Player vs Player\n- Computer vs Computer - AI game siumlation\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://visitor-badge.glitch.me/badge?page_id=drewcook.ts-battleship\" alt=\"visitor count\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewcook%2Fts-battleship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrewcook%2Fts-battleship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewcook%2Fts-battleship/lists"}