Development Setup
This document outlines the steps required to set up OsmoX for development. By following these steps, you’ll be able to run the application locally.Prerequisites
Before setting up OsmoX for development, ensure you have the following:Node.js v20.x+
Install via NVM:
nvm install 20 && nvm use 20PostgreSQL v16.x+
Database server for storing notifications
Redis v6.x+
Queue backend for Bull
Git v2.x+
Version control system
Verify Services
Ensure Redis and PostgreSQL server are up and running:Getting Started
1
Clone the repository
2
Install dependencies
3
Configure environment
Create a Update the following values in your
.env file from the example:.env file:| Variable | Description |
|---|---|
SERVER_PORT | API server port (default: 3000) |
DB_HOST | PostgreSQL host |
DB_PORT | PostgreSQL port |
DB_NAME | Database name |
DB_USERNAME | Database username |
DB_PASSWORD | Database password |
REDIS_HOST | Redis host |
4
Run database migrations
Ensure your database server is running, then create the tables:
5
Start the development server
http://localhost:3000.Start the Scheduler
Start the scheduler script in a separate terminal:- Process all
Pendingnotifications - Confirm all
Awaiting Confirmationnotifications - Archive completed notifications
- Delete old archived notifications (if enabled)
Docker Alternative
You can also run OsmoX using Docker while using a local database. See the Docker guide inapps/api/docs/use-local-db-instead-of-dockerized-db/README.md for details.