Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.36 KB

File metadata and controls

62 lines (44 loc) · 1.36 KB

PostgreSQL Setup for MealMate

Installation Steps (Windows)

  1. Download PostgreSQL:

  2. Installation Settings:

    • Port: 5432 (default)
    • Superuser password: Choose a strong password
    • Install pgAdmin 4 (recommended)
    • Default locale settings
  3. Verify Installation:

    psql --version

Database Creation

After PostgreSQL is installed, run these commands:

# Connect to PostgreSQL (will prompt for password)
psql -U postgres

# Create the database
CREATE DATABASE mealmate;

# Connect to the new database
\c mealmate

# Verify connection
\dt

Environment Configuration

Your .env file should have:

DATABASE_URL="postgresql://postgres:your_password@localhost:5432/mealmate"

Replace your_password with the password you set during installation.

Initialize Schema

Once database is created, run:

npm run db:push

This will create all tables from your schema automatically.

Troubleshooting

  • Connection refused: Make sure PostgreSQL service is running
  • Authentication failed: Check username/password in DATABASE_URL
  • Database doesn't exist: Run CREATE DATABASE mealmate; in psql
  • Permission denied: Make sure user has database creation privileges