A social knowledge tool for researchers built on ATProto
1#!/bin/bash
2
3# Source both setup scripts
4source ./scripts/setup-postgres.sh
5source ./scripts/setup-redis.sh
6
7# Function to handle cleanup for both services
8cleanup_and_exit() {
9 echo "Cleaning up services..."
10 cleanup_postgres
11 cleanup_redis
12 exit 0
13}
14
15# Trap SIGINT and SIGTERM to cleanup on exit
16trap cleanup_and_exit SIGINT SIGTERM
17
18echo "Starting development with separate processes (BullMQ + Redis)..."
19
20# Use nodemon instead of tsup --onSuccess for better process management
21concurrently -k -n APP,FEED,SEARCH,BUILD -c blue,green,yellow,red \
22 "dotenv -e .env.local -- nodemon --exec 'node dist/index.js' --watch dist/index.js --delay 1000ms" \
23 "dotenv -e .env.local -- nodemon --exec 'node dist/workers/feed-worker.js' --watch dist/workers/feed-worker.js --delay 1000ms" \
24 "dotenv -e .env.local -- nodemon --exec 'node dist/workers/search-worker.js' --watch dist/workers/search-worker.js --delay 1000ms" \
25 "tsup --watch"
26
27# Cleanup after concurrently exits
28cleanup_postgres
29cleanup_redis