POSTGRESQL SETUP GUIDE FOR SIYANTRANSIT EXPRESS (WINDOWS) ========================================================== AFTER POSTGRESQL INSTALLATION IS COMPLETE: STEP 1: VERIFY INSTALLATION --------------------------- 1. Open Command Prompt or PowerShell as Administrator 2. Type: psql --version 3. Should show PostgreSQL version (e.g., psql 15.x) STEP 2: CONNECT TO POSTGRESQL ----------------------------- 1. Open pgAdmin (PostgreSQL GUI tool) - should be installed with PostgreSQL OR 2. Use Command Line: - Open Command Prompt - Type: psql -U postgres - Enter the password you set during installation STEP 3: CREATE DATABASE FOR SIYANTRANSIT ---------------------------------------- In pgAdmin: 1. Right-click "Databases" → Create → Database 2. Name: siyantransit 3. Click Save OR in Command Line: 1. After connecting to psql, type: CREATE DATABASE siyantransit; 2. Type: \l to list databases and verify creation 3. Type: \q to quit STEP 4: CREATE .env FILE IN YOUR PROJECT ---------------------------------------- Create a file named ".env" in your siyantransit folder with: DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@localhost:5432/siyantransit" Replace YOUR_PASSWORD with the password you set during PostgreSQL installation. STEP 5: INSTALL CROSS-ENV FOR WINDOWS ------------------------------------- In your project folder, run: npm install --save-dev cross-env STEP 6: UPDATE PACKAGE.JSON --------------------------- Change this line in package.json: FROM: "dev": "NODE_ENV=development tsx server/index.ts" TO: "dev": "cross-env NODE_ENV=development tsx server/index.ts" STEP 7: RUN THE APPLICATION -------------------------- 1. npm run db:push (creates database tables) 2. npm run dev (starts the application) APPLICATION WILL RUN ON: - Frontend: http://localhost:5173 (website) - Backend: http://localhost:5000 (API) TROUBLESHOOTING: --------------- - If password error: Check password in .env file - If connection error: Make sure PostgreSQL service is running - If port error: Close other applications using port 5000/5173 COMMON POSTGRESQL COMMANDS: -------------------------- - Connect: psql -U postgres -d siyantransit - List databases: \l - List tables: \dt - Quit: \q Let me know when PostgreSQL installation is complete, and I'll help you with any specific issues!