This is the source code for Set with Friends, anonline, multiplayer implementation of the real-time card gameSet. Your goal is to findtriplets of cards that follow a certain pattern as quickly as possible.
This app was built on a serverless stack primarily using theFirebase Realtime Database, alongwith Firebase Cloud Functions formore complex or sensitive operations. The frontend was built withReact, with components fromMaterial UI.
Code for the frontend is written in JavaScript and located in the src/
folder,while serverless functions are written in TypeScript and located in thefunctions/
folder.
The latest development version of the code is on the main
branch. We useGitHub Actions to automate our build and deployment process on Netlify, after anew release is created with version number vA.B.C
.
This game is in active development, and we welcome contributions from developersof all backgrounds. I would recommend talking to us on Discord (link above) orsubmitting an issue if you want to see a new feature added. If you would like tohelp by contributing code, that's great – we would be happy to set up a time tochat!
To build the site for development:
npm install -g firebase-tools
to globally install the Firebase CLI.npm install
in the root folder to get dependencies.npm install
in the functions
folder.npm run dev
. This runs a script, which isresponsible for doing several things concurrently:
You should also be able to access the Emulator UI at http://localhost:4000
,which contains useful information and allows you to inspect/modify the databaseduring development. Changes to client code in src
should be immediatelyvisible, as well as changes to code in functions
.
Please make all pull requests with new features or bugfixes to the main
branch. We are formatting code using Prettier, so youshould run npm run format
on your code before making a pull request.
As mentioned above, the latest changes to the main
branch are deployedautomatically to Netlify using the npm run build
script. If you try to runthis locally, it will not work due to protections on the production database.Instead, you can preview a release build configured to connect to the localemulator suite using the npm run build:dev
script.
The other parts of the app (serverless functions, database rules) are deployedto production using GitHub Actions on the main
branch. Thestaging environment gets automatic deploypreviews when CI on the main
branch passes. It is useful for seeing the latestversion of the app and making sure that nothing is broken before releasing toproduction.
Built by Eric Zhang andCynthia Du.
All source code is available under the MIT License. We are notaffiliated with Set Enterprises, Inc., or the SET® card game.