Covey.Town
April 26, 2022 · View on GitHub
Covey.Town provides a virtual meeting space where different groups of people can have simultaneous video calls, allowing participants to drift between different conversations, just like in real life. Covey.Town was built for Northeastern's Spring 2021 software engineering course, and is designed to be reused across semesters. You can view our reference deployment of the app at app.covey.town - this is the version that students built on, and our project showcase highlights select projects from Spring 2021.

The figure above depicts the high-level architecture of Covey.Town.
The frontend client (in the frontend directory of this repository) uses the PhaserJS Game Library to create a 2D game interface, using tilemaps and sprites.
The frontend implements video chat using the Twilio Programmable Video API, and that aspect of the interface relies heavily on Twilio's React Starter App. Twilio's React Starter App is packaged and reused under the Apache License, 2.0.
A backend service (in the services/townService directory) implements the application logic: tracking which "towns" are available to be joined, and the state of each of those towns.
Running this app locally
Running the application locally entails running both the backend service and a frontend.
Setting up the backend
To run the backend, you will need a Twilio account. Twilio provides new accounts with $15 of credit, which is more than enough to get started. To create an account and configure your local environment:
- Go to Twilio and create an account. You do not need to provide a credit card to create a trial account.
- Create an API key and secret (select "API Keys" on the left under "Settings")
- Create a
.envfile in theservices/townServicedirectory, setting the values as follows:
| Config Value | Description |
|---|---|
TWILIO_ACCOUNT_SID | Visible on your twilio account dashboard. |
TWILIO_API_KEY_SID | The SID of the new API key you created. |
TWILIO_API_KEY_SECRET | The secret for the API key you created. |
TWILIO_API_AUTH_TOKEN | Visible on your twilio account dashboard. |
Starting the backend
Once your backend is configured, you can start it by running npm start in the services/townService directory (the first time you run it, you will also need to run npm install).
The backend will automatically restart if you change any of the files in the services/townService/src directory.
Configuring the frontend
When configuring the frontend, you’ll want a Spotify developer app set up. In order to do so, following these steps:
- Go to https://developer.spotify.com/dashboard/ and login with your Spotify account
- Create a new app with an appropriate name and description.
- If building for a development server, add all users that will be used to test the service (name and email are required). Otherwise, request a quota extension request.
- Click “Edit Settings” on the dashboard and add the frontend location followed by “/callback” (probably “http://localhost:3000/callback”) to the list of redirect URIs.
Now, create a .env file in the frontend directory with the following lines:
| Config Value | Description |
|---|---|
REACT_APP_TOWNS_SERVICE_URL | http://localhost:8081 (if you deploy the towns service to another location, put that location here instead) |
REACT_APP_SPOTIFY_CLIENT_ID | (put the client id found on the Spotify dashboard here) |
REACT_APP_SPOTIFY_REDIRECT_URI | http://localhost:3000/callback (this has to be the same as the redirect uri put into the Spotify dashboard) |
REACT_APP_BASE_URL | localhost:3000 (or wherever the frontend location is) |
Running the frontend
In the frontend directory, run npm start (again, you'll need to run npm install the very first time). After several moments (or minutes, depending on the speed of your machine), a browser will open with the frontend running locally.
The frontend will automatically re-compile and reload in your browser if you change any files in the frontend/src directory.