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
18# Run both services with concurrently
19concurrently -k -n APP,WORKER -c blue,green \
20 "dotenv -e .env.local -- concurrently -k -n TYPE,APP -c red,blue \"tsc --noEmit --watch\" \"tsup --watch --onSuccess='node dist/index.js'\"" \
21 "dotenv -e .env.local -- concurrently -k -n WORKER -c green \"tsup --watch --onSuccess='node dist/workers/feed-worker.js'\""
22
23# Cleanup after concurrently exits
24cleanup_postgres
25cleanup_redis