Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Create a setup script to enable better integration with other projects #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Run database setup scripts
echo "Running database setup scripts..."
cd db/scripts || exit 1
./start-pg
# Check if migrations need to be run
if ! dbmate -d "$DATABASE_URL" status | grep "no migrations found" &> /dev/null; then
echo "Running migrations..."
./migrate
else
echo "No migrations found."
fi
cd ../../

# Install project dependencies
echo "Installing project dependencies..."
npm install

# Copy environment variable file
echo "Copying environment variable file..."
cp .env.example .env

# Start the server
echo "Starting the server..."
npm run server

echo "Server started successfully."
Loading