playbattleship.com is a full-stack web application for playing the classic strategy game, Battleship, in the browser. This application was developed as part of the Full-Stack Web Development course at Portland State University.
- React - Front end framework
- Express - Backend Server
- Typescript - Typed Javascript
- Socket.io - Web socket library
- Firebase - Hosting and platform service
Before we can setup the project locally we need to install some dependencies.
- Node.js and npm
- yarn Note: This is required since this project uses yarn workspaces to manage linked dependencies
With the prerequisites dealt with, we can clone the repo and install the project:
git clone https://github.com/AlexanderJDupree/Battleship
cd Battleship
yarn install
See the package.json
file for a full list of commands but the primary commands we will use are:
- Build the common library, always run this first
yarn run build-common
- Run the client development server with live reloading at
localhost:3000
yarn run client
- Run the Battleship websockets server with live reloading at
localhost:8080
.yarn run server
- Run both client and server concurrently
yarn start
.
├───.github <-- CI stuff
│ └───workflows
|
├───client <-- React application frontend
│ ├───public <-- Static assets
│ └───src
│ ├───components <-- Reusable React components
│ ├───contexts <-- Shareable data between components
│ ├───pages <-- Main routes for the site
│ ├───styles <-- Site and individual css themes
│ └───utils <-- Utility functions
|
├───common <-- Server/Client shared code e.g. Game logic, event types
│ └───lib
├───docs <-- Documentation
|
└───server <-- Battleship express server
└───src
Recommended VScode extensions for development: