Skip to content

cj-young/com-chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Com.chess

This is a full-stack chess application built with the MERN stack (MongoDB, Express, React, Node), Socket.io, Passport.js, and Stockfish.

Features

  • User authentication
  • Online chess against other users using Socket.IO
  • Games against Stockfish bots
  • Engine analysis using Stockfish
  • Friend system

Getting Started

This app is currently hosted here. The backend is hosted with a free service, so loading could take up to a minute.

Installation

  1. Clone the repository
  2. Add dependencies to backend:
cd backend
npm i
  1. Add dependencies to frontend:
cd frontend
npm i

Environment Variables

Create a .env file in the backend and frontend and add each of the following variables with their respective values:

Frontend Variables

  • VITE_BACKEND_URL: the base url of your backend server

Backend Variables

  • DB_URI: the uri of your mongodb cluster
  • BACKEND_URL: the base url of your backend server
  • SESSION_SECRET: any secure hexidecimal key used for express session storage
  • GOOGLE_CLIENT_ID: client id for Google Passport authentication Learn More
  • GOOGLE_CLIENT_SECRET: clicent secret for Google Passport authentication Learn More
  • CLIENT_URL: the base url of your frontend server
  • NODE_ENV: the environment of your backend server, set to "development" on localhost.

Running the servers

  1. Start the backend:
cd backend
npm run dev
  1. Start the frontend:
cd frontend
npm run dev