You can try this live by visiting https://connect4-ks.herokuapp.com/ . To run the game locally:
- Install dependencies.
npm install
- Build the
"src"
directory.
npm run build
- If you want to run the server on a different port modify the
PORT
env (default is3000
).
export PORT=8080
- Run the server.
npm run serve
- Visit
http://localhost:{PORT}
. Create a game and share the link to play with a friend.
- expressjs - Handles http requests.
- lowdb and shortid - For simple database.
- socketio - Real-time game update.
- vuejs - Frontend components.
public/
- The folder which holds the files that we serve on the client.src/index.js
- The main entry point of the application.src/components/
- This folder contains thevue
components.src/libs/
- This folder contains the main logic of the game.src/listeners/
- This folder contains the event handlers that thesocketio client
emits to the server.src/router/
- The registered routes of the single application are in this folder.src/routes/
- The registered api routes are in this folder.src/services/
- This folder contains the service files which the application uses to connect unit files to a single related service.tests/
- The test files.
- Board state persistence.
- Add AI.
- Game setup with more than two players and larger grid.