The Developmental Research Database (DRDB) is a secure, laboratory management system designed specifically for developmental psychology and cognitive science research labs. It provides a centralized, modern interface to streamline participant recruitment, longitudinal study tracking, scheduling, and personnel management.
Built with a robust Vue 3 frontend and a Node.js/MySQL backend, DRDB eliminates the friction of decentralized spreadsheets and legacy databases, allowing Principal Investigators (PIs) and Research Assistants (RAs) to focus on science rather than administrative overhead.
- Demo Videos & Instructions (v2, to be updated): System Overview
- Documentation (v1, obsolete): drdb.readthedocs.io
- Vue 3 Frontend: The client (
client/) has been rebuilt with Vue 3, Vite, and Pinia. - Testing Rooms: Dedicated rooms (e.g., Eye Tracking, fNIRS) linked to independent Google Calendars.
- Advanced Study Logistics: Prerequisites, exclusions, multiple age groups, and condition-specific criteria (ASD, Premature, Vision/Hearing loss).
- Automated Emails: Template-based confirmation, reminder, and follow-up emails organized via Gmail labels.
| Layer | Technology |
|---|---|
Backend (server/) |
Express.js, Sequelize ORM, MySQL/MariaDB, Google APIs |
Frontend (client/) |
Vue 3, Vite, Pinia, Vuetify |
| Process Manager | PM2 |
| Web Server | Nginx (reverse proxy) |
A guide on changing colors, logo, and fonts is available in client/README.md.
Caution
Take a full database backup before proceeding. V3 includes significant database structure changes.
A detailed, step-by-step migration guide is available in migration_guide_v2_to_v3.md.
Summary of steps:
- Pull the latest code and backup the database (
mysqldump). - Run the SQL patches from the
MySQL/directory (databasePatch1.01.sql,migrate_age_groups.sql). - Configure the backend environment (
.env). - Set up Google OAuth credentials (see below).
- Build the frontend (
npm run buildinclient/) and deploy to Nginx.
Google Calendar and Gmail integration is a core feature of DRDB. Without correctly configured credentials, email reminders and calendar sync will not function.
- Go to the Google Cloud Console.
- Create a new project (or select an existing one).
Navigate to APIs & Services > Library and enable:
- Gmail API
- Google Calendar API
- Go to APIs & Services > OAuth consent screen.
- Choose User Type:
- Internal — if all users are within a Google Workspace organization (no verification needed).
- External — if users have regular
@gmail.comaccounts.
- Fill in the required app information (name, support email).
- Under Scopes, add the following (or they will be requested automatically):
https://mail.google.com/https://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.composehttps://www.googleapis.com/auth/gmail.settings.basichttps://www.googleapis.com/auth/gmail.labelshttps://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/calendar.events
Warning
If the consent screen is set to "Testing" (not published), only emails explicitly listed under Test users can authorize the app. You will get a 403: access_denied error for any email not on that list.
-
Go to APIs & Services > Credentials.
-
Click Create Credentials > OAuth client ID.
-
Application type: Web application (do NOT choose "Desktop app" for production servers).
-
Under Authorized redirect URIs, add your callback URL:
https://yourdomain.com/oauth/callbackFor example:
https://ccd.tau.ac.il/oauth/callback.For local development, also add:
http://localhost:5173/oauth/callback. -
Click Create and download the JSON file.
- Rename the downloaded file to
credentials.json. - Place it on the server at:
server/api/google/general/credentials.json - The file should have a
"web"key (not"installed"). Example structure:{ "web": { "client_id": "xxxx.apps.googleusercontent.com", "project_id": "your-project-id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "GOCSPX-xxxx", "redirect_uris": ["https://yourdomain.com/oauth/callback"] } }
Important
The backend code supports both "web" and "installed" credential formats. However, "web" is required for production because Google blocks "installed" (Desktop) credentials from using redirect URIs with real domains.
- Log in to DRDB as an Admin.
- Go to Settings.
- Click Setup Google Account (for lab email) or Setup Admin Account (for admin email).
- A Google sign-in window will open — authorize with the intended Gmail account.
- Paste the authorization code back into the dialog in DRDB.
- On success, the email address will appear next to the setup button.
| Error | Cause | Fix |
|---|---|---|
redirect_uri_mismatch |
The redirect URI sent by the server doesn't match any URI registered in Google Cloud Console. | Add the exact URI (e.g., https://yourdomain.com/oauth/callback) to Authorized redirect URIs in the Cloud Console, and ensure credentials.json contains it. |
403: access_denied |
The consent screen is in "Testing" mode and the email is not listed as a test user. | Add the email to Test users in the OAuth consent screen, or publish the app. |
invalid_client |
The client_id or client_secret in credentials.json is wrong or the credential was deleted. |
Re-download the JSON from Google Cloud Console. |
The backend reads configuration from server/.env. Key variables (see server/config/general.js for defaults):
JWT_KEY=your_jwt_secret
DB_NAME=DRDB
DB_USER=root
DB_PASS=your_db_password
DB_HOST=localhost
DB_DIALECT=mariadb
TIMEZONE=America/Toronto
FRONTEND_URL=https://yourdomain.comNote
FRONTEND_URL controls the CORS allowed origins. Set it to your production domain. Multiple origins can be comma-separated (e.g., https://yourdomain.com,http://localhost:5173).
Cron jobs are defined in server/jobs/scheduler.js and registered from server/server.js.
| Time | Task |
|---|---|
| 00:05 AM | Update all children's ages |
| 00:15 AM | Auto-complete past confirmed appointments; reject stale tentative ones |
| 00:35 AM | Reset daily RTU counters |
| 06:00 AM | Release families from completed schedules |
| 09:30 AM | Remind primary experimenters about studies pending completion |
| 09:35 AM | Remind recruiters to follow up with contacted families |
| 04:00 PM | Send reminder emails to experimenters for next-day studies |
| 05:00 PM | Send reminder emails to parents for next-day studies |
| 10:46 PM | Update monthly/weekly study appointment summaries |
- Locking: When a family is scheduled for a study, they are locked to that lab to prevent double-booking across labs.
- Auto-Release: Families are automatically released when:
- Their confirmed appointment has passed and is marked completed.
- A tentative schedule has had no update for 2 weeks (auto-rejected).
- Completion: Schedules move to "Completed" status automatically based on appointment time and confirmation status.