Getting Started
Prerequisites
- Node.js (v14+ recommended)
- PostgreSQL (v12+ 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
-
Database Setup:
- Create two PostgreSQL databases (OSAS and ONMART)
- Update database credentials in
.env
-
Environment Variables:
- Configure all required environment variables (see Environment Variables)
-
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"
}