# Getting Started

### Prerequisites

- **Node.js** (v14+ recommended)
- **PostgreSQL** (v15+ recommended)
- **npm** or **yarn** package manager

### Installation

```bash
# Clone the repository
git clone <repository-url>
cd ondelivery-api

# Install dependencies
npm install

# Setup environment variables
# Copy .env.example to .env and configure
cp .env.example .env
```

### Configuration

1. **Database Setup:**
   - Create two PostgreSQL databases (OSAS and ONMART)
   - Update database credentials in `.env`

2. **Environment Variables:**
   - Configure all required environment variables (see [Environment Variables](#environment-variables))

3. **Initialize Database:**
   ```bash
   # Run migrations if available
   # The application uses Sequelize ORM
   ```

### Running the Application

```bash
# Development mode with auto-reload
npm start

# Production mode
node ondeliv-backend.js
```

The server will start on port **4220** (or as configured in `PORT` environment variable).

### Verify Installation

Visit `http://localhost:4220/` - you should see:
```json
{
  "message": "This backend osas works well for now"
}
```