Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .conductor/dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DATABASE_URL=postgres://postgres:postgres@localhost:47821/teerank
REDIS_HOST=localhost
REDIS_PORT=47822
S3_ENDPOINT=http://localhost:47823
PRISMA_BINARY_TARGETS='["native"]'
24 changes: 24 additions & 0 deletions .conductor/dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Conductor run script: docker, worker, scheduler and frontend, from the
# repository root that spotlight testing keeps in sync with the active workspace.
set -euo pipefail

cd "$(dirname "$0")/.."
set -a
. .conductor/dev.env
set +a
cd "${CONDUCTOR_ROOT_PATH:-.}"

export COMPOSE_PROJECT_NAME=teerank

[ -d node_modules ] || npm install

# Wait only for what the apps need; bullboard and pghero can take their time.
docker compose up --detach --wait postgres redis minio
docker compose up --detach

npx prisma migrate deploy --schema=libs/prisma/prisma/schema.prisma
npx prisma generate --sql --schema=libs/prisma/prisma/schema.prisma

# exec so a stop signal reaches nx itself rather than this wrapper shell.
exec node_modules/.bin/nx run-many -t serve -p frontend worker scheduler --output-style=stream
26 changes: 26 additions & 0 deletions .conductor/settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"$schema" = "https://conductor.build/schemas/settings.repo.schema.json"

spotlight_testing = true
environment_variable_files = [ ".conductor/dev.env" ]

[scripts]
setup = ".conductor/setup.sh"
run_mode = "nonconcurrent"

[scripts.run.dev]
command = ".conductor/dev.sh"
available_in = [ "local" ]
default = true
icon = "play"

[[preview_urls]]
name = "Frontend"
url = "http://localhost:47820"

[[preview_urls]]
name = "Bull Board"
url = "http://localhost:47825"

[[preview_urls]]
name = "pghero"
url = "http://localhost:47826"
17 changes: 17 additions & 0 deletions .conductor/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Conductor setup script: make lint, build and test work in the workspace. The
# app itself runs from the repository root, see dev.sh.
set -euo pipefail

cd "$(dirname "$0")/.."
set -a
. .conductor/dev.env
set +a

export COMPOSE_PROJECT_NAME=teerank

npm install
# Only postgres: generate --sql compiles the typed queries against the database.
docker compose up --detach --wait postgres
npx prisma migrate deploy --schema=libs/prisma/prisma/schema.prisma
npx prisma generate --sql --schema=libs/prisma/prisma/schema.prisma
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ node_modules
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vscode

# misc
/.sass-cache
Expand Down
8 changes: 0 additions & 8 deletions .vscode/extensions.json

This file was deleted.

124 changes: 0 additions & 124 deletions .vscode/tasks.json

This file was deleted.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ npm install
docker compose up -d
npx nx run frontend:serve
npx nx run worker:serve
npx nx run scheduler:serve
```

Alternatively, open the projetc on VSCode and run the start building using:
`Command + Shift + B`.
In Conductor, the `dev` run script does all of the above. Spotlight testing
syncs the active workspace into the repository root and the script serves from
there, so every workspace shares one `node_modules`, one docker stack and one
database.

# Legacy

Expand Down
3 changes: 2 additions & 1 deletion apps/frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"defaultConfiguration": "development",
"options": {
"buildTarget": "frontend:build",
"dev": true
"dev": true,
"port": 47820
},
"configurations": {
"development": {
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
postgres:
image: postgres:latest
ports:
- "5452:5432"
- "47821:5432"
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: teerank
Expand All @@ -14,15 +14,15 @@ services:
redis:
image: redis:latest
ports:
- "6399:6379"
- "47822:6379"
restart: always

bullboard:
container_name: bullboard
image: venatum/bull-board
restart: always
ports:
- 3000:3000
- "47825:3000"
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
Expand All @@ -34,7 +34,7 @@ services:
pghero:
image: ankane/pghero
ports:
- "8080:8080"
- "47826:8080"
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/teerank
depends_on:
Expand All @@ -44,8 +44,8 @@ services:
image: minio/minio
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
- "47823:9000"
- "47824:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
Expand Down
Loading