The repository contains:
dockerfor local developmentbackend, the API built in TypeScript and NodeJSfrontend, the application built in Vue3/Nuxt3
The platform includes an automated setup CLI that handles environment configuration, Docker orchestration, and database initialization.
npm run setupThis interactive wizard will:
- Generate environment files (
.env) for root, backend, and frontend - Create required Docker volumes
- Build and start Docker containers
- Run database migrations
- Seed the database with test data
For quick setup with sensible defaults:
npm run setup:express| Command | Description |
|---|---|
npm run setup |
Full interactive setup (config + Docker + database) |
npm run setup:express |
Express mode with minimal prompts |
npm run setup:config |
Generate .env files only (skip Docker) |
npm run setup:docker |
Docker operations only (skip config) |
npm run setup:update |
Update existing configuration |
| Command | Description |
|---|---|
npm run setup:down |
Stop and remove all containers |
npm run setup:rebuild |
Rebuild Docker images and restart |
docker-compose restart |
Restart all services |
docker-compose restart backend |
Restart backend service only |
| Command | Description |
|---|---|
npm run setup:migrate |
Run database migrations |
npm run setup:seed |
Run database seeders |
After running the standard database migrations, execute the user-to-organization data migration:
# Step 1: Preview the migration (dry-run, no changes made)
docker-compose exec backend.dataresearchanalysis.test npm run migrate:users-to-orgs:dry-run
# Step 2: Review the output and verify the organizations that would be created
# Step 3: Execute the actual migration (irreversible)
docker-compose exec backend.dataresearchanalysis.test npm run migrate:users-to-orgs- Run
npm run setup:migrateFIRST to create organization tables - The user-to-organization migration is one-time only
- Dry-run mode previews changes without modifying the database
- Each user gets a personal organization (e.g., "John's Organization")
- All user projects are automatically transferred to their personal organization
- The migration is idempotent (safe to run multiple times - skips already-migrated users)
Migrations and seeders are automatically executed during initial setup, but can be run manually if needed.
| Command | Description |
|---|---|
npm run setup:health |
Run comprehensive health check |
npm run setup:validate |
Validate .env file completeness |
npm run setup:status |
Show status of all services |
npm run setup:statusShows real-time status of all 6 services:
- backend
- frontend
- database
- redis
- mysql-test
- mariadb-test
node setup-cli.js --restart backend
node setup-cli.js --restart frontend
node setup-cli.js --restart database# View last 100 lines (default)
node setup-cli.js --logs backend
# View last N lines
node setup-cli.js --logs backend --tail 50
# Follow logs in real-time
node setup-cli.js --logs backend --follow
node setup-cli.js --logs frontend --follow --tail 100Available services: backend, frontend, database, redis, mysql-test, mariadb-test
| Flag | Description |
|---|---|
--help, -h |
Show help message with all options |
--skip-migrations |
Skip database migrations during setup |
--skip-seeders |
Skip database seeders during setup |
--dry-run |
Preview what would happen without making changes |
--remove-config |
Remove .env files during teardown |
# 1. Clone repository
git clone https://github.com/Data-Research-Analysis/data-research-analysis-platform.git
cd data-research-analysis-platform
# 2. Add hosts entries (REQUIRED - see Manual Setup section below for platform-specific instructions)
# Linux/Mac:
sudo bash -c 'cat >> /etc/hosts << EOF
127.0.0.1 frontend.dataresearchanalysis.test
127.0.0.1 backend.dataresearchanalysis.test
127.0.0.1 database.dataresearchanalysis.test
EOF'
# Windows: Add same entries to C:\Windows\System32\drivers\etc\hosts
# 3. Run automated setup
npm run setup
# 4. Access the application
# Frontend: http://frontend.dataresearchanalysis.test:3000
# Backend: http://backend.dataresearchanalysis.test:3002# Stop everything
npm run setup:down
# Rebuild and restart
npm run setup:rebuild# Check system health
npm run setup:health
# Validate environment files
npm run setup:validate
# Check service status
npm run setup:status
# View backend logs
node setup-cli.js --logs backend --tail 100
# Restart a problematic service
node setup-cli.js --restart backendThe setup CLI generates three .env files:
- Root
.env- Docker and PostgreSQL configuration backend/.env- Backend server and database settingsfrontend/.env- Frontend Nuxt3 application settings
All sensitive values (JWT secrets, encryption keys) are automatically generated with cryptographically secure random values.
Root:
POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DBREDIS_PASSWORD
Backend:
- Database:
POSTGRESQL_HOST,POSTGRESQL_PORT,POSTGRESQL_USERNAME,POSTGRESQL_PASSWORD,POSTGRESQL_DB_NAME - Security:
JWT_SECRET,ENCRYPTION_KEY,PASSWORD_SALT - Server:
NODE_ENV,PUBLIC_BACKEND_URL,FRONTEND_URL,PORT
Frontend:
NUXT_API_URL- Backend API endpointRECAPTCHA_SITE_KEY- Google reCAPTCHA site key
The setup CLI automatically creates required external volumes:
data_research_analysis_postgres_data- PostgreSQL database datadata_research_analysis_redis_data- Redis cache data
Important: External volumes are never automatically deleted. To manually remove:
docker volume ls # List all volumes
docker volume rm data_research_analysis_postgres_data
docker volume rm data_research_analysis_redis_dataBefore starting services, validate your environment:
npm run setup:validateThis checks:
- All required
.envfiles exist - All required environment variables are present
- No placeholder values (like "changeme") remain
- Provides specific remediation steps for issues found
# Show all available commands and options
node setup-cli.js --help
# Or simply
npm run setup -- --helpIf you prefer manual setup or need to customize the process, follow the platform-specific instructions below.
- Add the following entries to your hosts file
c:\windows\system32\drivers\etc\hosts(https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/):Why this is needed: The frontend makes API calls to127.0.0.1 frontend.dataresearchanalysis.test 127.0.0.1 backend.dataresearchanalysis.test 127.0.0.1 database.dataresearchanalysis.testbackend.dataresearchanalysis.testfrom your browser (client-side). Without this hosts entry, your browser cannot resolve the hostname and all API calls will fail with "Failed to fetch" errors. - Clone the repository
https://github.com/Data-Research-Analysis/data-research-analysis-platform.git. - Copy
backend/.env.exampletobackend/.envand update any missing values as necessary. - Copy
frontend/.env.exampletofrontend/.envand update any missing values as necessary. - If the volume named
data_research_analysis_postgres_datais not present in your docker volumes, then you need to create this volume by running the following commanddocker volume create data_research_analysis_postgres_data. This is essential or the project will not build because it is required that the volume be present when the project is built. cd data-research-analysis-platformthendocker-compose build.- Once it is done building, run:
docker-compose up. - In a new terminal window/tab run
cd data-research-analysis-platform/backend. - Run
npm run typeorm migration:generate ./src/migrations/CreateTables -- -d ./src/datasources/PostgresDSMigrations.tsto generate the migration file that creates tables file from the data models. Only run this command if the migration file create tables migration file is not present. - Run
npm run typeorm migration:run -- -d ./src/datasources/PostgresDSMigrations.tsto run the migrations. - (NEW) Multi-Tenant Migration: Run user-to-organization migration:
# Preview migration (dry-run) docker-compose exec backend.dataresearchanalysis.test npm run migrate:users-to-orgs:dry-run # Execute migration after reviewing output docker-compose exec backend.dataresearchanalysis.test npm run migrate:users-to-orgs
- After the migrations have been completed then run
npm run seed:run -- -d ./src/datasources/PostgresDSMigrations.ts src/seeders/*.tsto run the seeders. - Now visit http://frontend.dataresearchanalysis.test:3000 in your browser!
- To revert the migrations run the command
npm run typeorm migration:revert -- -d ./src/datasources/PostgresDSMigrations.ts
- Add the following entries to your hosts file
/etc/hosts:Why this is needed: The frontend makes API calls tosudo bash -c 'cat >> /etc/hosts << EOF 127.0.0.1 frontend.dataresearchanalysis.test 127.0.0.1 backend.dataresearchanalysis.test 127.0.0.1 database.dataresearchanalysis.test EOF'
backend.dataresearchanalysis.testfrom your browser (client-side). Without this hosts entry, your browser cannot resolve the hostname and all API calls will fail with "Failed to fetch" errors. - Clone the repository
https://github.com/Data-Research-Analysis/data-research-analysis-platform.git. - Copy
backend/.env.exampletobackend/.envand update any missing values as necessary. - Copy
frontend/.env.exampletofrontend/.envand update any missing values as necessary. - If the volume named
data_research_analysis_postgres_datais not present in your docker volumes, then you need to create this volume by running the following commanddocker volume create data_research_analysis_postgres_data. This is essential or the project will not build because it is required that the volume be present when the project is built. - Open the project directory in the terminal and run:
docker-compose build. - Once it is done run:
docker-compose up. - In a new terminal window/tab run
cd data-research-analysis-platform/backend. - Run
npm run typeorm migration:generate ./src/migrations/CreateTables -- -d ./src/datasources/PostgresDSMigrations.tsto generate the migration file that creates tables file from the data models. Only run this command if the migration file create tables migration file is not present. - Run
npm run typeorm migration:run -- -d ./src/datasources/PostgresDSMigrations.tsto run the migrations. - (NEW) Multi-Tenant Migration: Run user-to-organization migration:
# Preview migration (dry-run) docker-compose exec backend.dataresearchanalysis.test npm run migrate:users-to-orgs:dry-run # Execute migration after reviewing output docker-compose exec backend.dataresearchanalysis.test npm run migrate:users-to-orgs
- After the migrations have been completed then run
npm run seed:run -- -d ./src/datasources/PostgresDSMigrations.ts src/seeders/*.tsto run the seeders. - Now visit http://frontend.dataresearchanalysis.test:3000 in your browser!
- To revert the migrations run the command
npm run typeorm migration:revert -- -d ./src/datasources/PostgresDSMigrations.ts
On the local instance the following are the login credentials:
- Admin
- Username:
testadminuser@dataresearchanalysis.com - Password:
testuser
- Username:
- Normal Member
- Username:
testuser@dataresearchanalysis.com - Password:
testuser
- Username: