Skip to main content

Getting Started

Prerequisites

  • Node.js (v14+ recommended)
  • PostgreSQL (v15+ recommended)
  • npm or yarn package manager

Installation

# 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:

  3. Initialize Database:

    # Run migrations if available
    # The application uses Sequelize ORM
    

Running the Application

# 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:

{
  "message": "This backend osas works well for now"
}