Activist Database Project
The following dependencies are required to run this project and will be already installed if using the devcontainer:
- go
- nvm
- docker
Running this command is required to download all the go and node dependencies:
make deps
If you are not using the devcontainer, you can use our Docker Compose configuration to run MySQL locally:
( cd server/ && docker compose up -d )
make dev_db
If you are using the devcontainer, just run this command in the container:
make dev_db
This command will log you into the database if you run the command in the same container as the database:
mysql -u adb_user -padbpassword -h 127.0.0.1
(Note the syntax of the above command is to accept the password after -p
without a space.)
After downloading the dependencies, start the development servers:
make run_all
Access the new frontend (React app) at http://localhost:8080/v2 - or test with http://localhost:8080/v2/test.
React pages auto-update in the frontend development server when you save changes.
Note: The react app can technically be accessed directly on port 3000 locally, but it won't have access to the cookies from :8080 which could cause issues.
Access the Go API server and old frontend (Vue app) at http://localhost:8080/
Access the Members app at members.dxesf.org at http://localhost:8081/
Please run make fmt
before sending a pull request.
Please run make test
before sending a pull request.
Note the tests take several minutes to run, even though some of them finish quickly. To check if any tests are hanging, you can add "-v -p 1" after "go test" args in the Makefile to show individual test names and to run them in serial.
The frontend is being migrated from Vue to React and is split into two applications: the Vue app in /frontend and the React app in /frontend-v2.
This project uses webpack to compile our frontend files. Frontend
files that need to be compiled are in frontend/
, and the compiled
outputs are in frontend/dist/
.
-
package.json: file with all frontend dependencies
-
webpack.config.js: configuration file for webpack, which builds the js
-
make watch
: watch the frontend folder for changes and automatically build the file if anything changes.
The most convenient workflow is to run make watch
in one terminal
and make run
in another one. Then your JS changes will automatically
be built as you edit them.
See frontend-v2/README.md for more information on the React app. See above for instructions on building and running the React app along with other components of ADB.
- ADB_URL_PATH: For example, "http://adb.domain.com"
- PORT: The port to run the webserver on
- MEMBERS_PORT: Port to run the Members webserver on
- DB_USER
- DB_PASSWORD
- DB_NAME
- DB_PROTOCOL: For example, "tcp([host]:[port])"
- PROD: [true or false]
- RUN_BACKGROUND_JOBS: [true or false] should only be true on at most one instance if load balancing
- COOKIE_SECRET: [a random string]
- CSRF_AUTH_KEY: [a random string]
For signing people up to DxE's main mailing list & chapter-specific mailing lists (please reach out to [email protected] to get an API key to sign people up)
- SIGNUP_ENDPOINT
- SIGNUP_KEY
- SYNC_MAILING_LISTS_CONFIG_FILE: relative path to client_secrets.json if syncing with google groups
- SYNC_MAILING_LISTS_OAUTH_SUBJECT: google account to use to sync
- SMTP_HOST
- SMTP_PORT
- SMTP_USER
- SMTP_PASSWORD
- SURVEY_FROM_EMAIL
- SURVEY_MISSING_EMAIL: Email to send survey errors to
- MEMBERS_CLIENT_ID
- MEMBERS_CLIENT_SECRET
ipgeolocation.io key for finding nearby upcoming events based on a user's IP address (used w/ public-facing API):
- IPGEOLOCATION_KEY
- DISCORD_SECRET
- DISCORD_BOT_BASE_URL
- DISCORD_FROM_EMAIL
- DISCORD_MODERATOR_EMAIL
- GOOGLE_PLACES_API_KEY