stringplay is a data collection service that aggregates attendee information from your online spreadsheets and surveys, allowing you to effectively track event and membership data. Based on membership-logger.
This repository provides the backend for the stringplay project. For other relevant repositories, check out the following links:
stringplay(Main)stringplay-ui(Frontend)
Note that this project uses MongoDB as its database provider. In order for services to properly run in production, you must have a MongoDB (or MongoDB Atlas) instance up and running.
-
stringplay-core- The core backend functionality for the stringplay project. This package provides the controllers for the API service, sync service, and scheduled tasks services, as well as types used for the services. -
stringplay-gcp- The GCP Cloud Run Functions defined by the project. This package contains definitions for each function to deploy to GCP.
Make sure that Node.js version 20.0.0 or higher is installed on your device.
- Run
npm installto install dependencies for the root package. - Run
npm run buildto transpile ts code and install dependencies for all child packages.
Environment variables are required to be set in order to run the code from the child packages. You can either define these environment variables globally, or create a .env file to define the variables specifically within this repository. Look at .env.temp for information on each environment variable.
The .env file is injected into each command via dotenvx.
The canonical environment variable name for the absolute path to the root of this repository is STRINGPLAY_CORE_PATH.
Before running commands, ensure that you have all necessary environment variables set.
npm start: Runs the API server inpackages/stringplay-gcpnpm test: Runs jest tests inpackages/stringplay-corenpm run build: Transpiles TS code and installs dependencies for all folders in/packagesnpm run ci: Performs a clean install for all packages in the projectnpm run quick: Runs thequick-test.tsfile inpackages/stringplay-core/srcif available. This allows you to run unique, isolated code with access to the functionality provided by the core package.npm run coverage: Runs jest tests inpackages/stringplay-coreand displays test coveragenpm run core-server: Runs the (dev) server created bypackages/stringplay-core
This repository comes with support for the Visual Studio Code debugger.
gcp-server (api) | stringplay-gcpconfiguration - debugsnpm startcore-server | stringplay-coreconfiguration - debugsnpm run core-serverquick-test | stringplay-coreconfiguration - debugsnpm run quick*.spec.ts (tests) | stringplay-coreconfiguration - runs jest in watch mode, and debugs any individual jest test file inpackages/stringplay-core
For more resources on debugging:
- See
.vscode/launch.jsonfor configuration details. - See Debugging in VS Code for how to use the VS Code debugger.