first commit

This commit is contained in:
2026-02-28 02:44:41 +03:00
commit 97fb289fe7
70 changed files with 11928 additions and 0 deletions

34
scripts/dev-startup.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
set -e
echo "=== Netflix Scraper API Dev Startup ==="
# Set DATABASE_URL from individual POSTGRES_* environment variables
# This overrides the dummy value set during Docker build
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
echo "Database URL configured: postgresql://${POSTGRES_USER}:***@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
# Wait for database to be ready
echo "Waiting for database..."
until nc -z $POSTGRES_HOST $POSTGRES_PORT; do
echo "Database not ready, waiting..."
sleep 2
done
echo "Database is ready!"
# Generate Prisma client
echo "Generating Prisma client..."
npx prisma generate
# Run migrations
echo "Running database migrations..."
npx prisma migrate deploy
# Run seed (optional)
echo "Running seed..."
npx tsx prisma/seed.ts || echo "Seed already run or not needed"
# Start the application in dev mode
echo "Starting application in development mode..."
exec npm run dev