Skip to content

Latest commit

 

History

History
152 lines (118 loc) · 3.13 KB

local-installation-guide.md

File metadata and controls

152 lines (118 loc) · 3.13 KB

ParkEasy: Local Development Guide

Prerequisites

  • Python 3.8 or higher
  • PostgreSQL 12 or higher
  • pip (Python package manager)
  • Git

PostgreSQL Setup Instructions

Install PostgreSQL and psycopg2

On macOS/Linux

# For Ubuntu/Debian
sudo apt update
sudo apt install postgresql postgresql-contrib

# For macOS (using Homebrew)
brew install postgresql

On Windows

  1. Download and install PostgreSQL from the official website
  2. During installation, note the username (postgres) and password you set

Start PostgreSQL Service

For Linux/macOS (systemd)

sudo systemctl start postgresql
sudo systemctl enable postgresql # Start PostgreSQL on boot

For Windows

  1. Open pgAdmin or use Windows Services (services.msc) to start PostgreSQL
  2. Ensure PostgreSQL Server is running

Create the Database

Log in to PostgreSQL

sudo -i -u postgres
psql

Create Database

CREATE DATABASE parkeasy_db;

Configure User Privileges

ALTER USER postgres WITH PASSWORD 'postgres';
GRANT ALL PRIVILEGES ON DATABASE parkeasy_db TO postgres;

Exit PostgreSQL

\q

Project Setup

📌 1. Clone the Repository

git clone https://github.com/yourusername/parkeasy.git
cd parkeasy

📌 2. Set Up the Virtual Environment

Before running the Django app, create and activate a virtual environment.

For macOS/Linux

python3 -m venv venv
source venv/bin/activate

For Windows (cmd)

python -m venv venv
venv\Scripts\activate

📦 3. Install Dependencies

Ensure all required dependencies are installed.

pip install -r requirements.txt

If new packages were installed, update requirements.txt:

pip freeze > requirements.txt

🔄 4. Apply Migrations

Run the following commands to set up the database:

python manage.py makemigrations
python manage.py migrate

🔑 5. Create a Superuser (Optional)

If you need access to the Django Admin panel:

python manage.py createsuperuser

Follow the prompts to create an admin user.

🚀 6. Run the Development Server

Start the Django app:

python manage.py runserver

Access the app at http://127.0.0.1:8000/

Development Workflow

🧪 Running Tests

Execute the test suite:

python manage.py test

For a specific app:

python manage.py test booking

🛠️ Adding New Dependencies

If you install any new libraries, make sure to update requirements.txt:

pip install <package-name>
pip freeze > requirements.txt

Project Structure

Code Organization

  • ParkEasy: Main ParkEasy orchestration app
  • accounts: To manage accounts
  • listing: For parking spot owners to list and view their parking spots
  • booking: For users to book parking spots, see the spots they booked and manage them

Resources