Skip to main content

Development guidelines

Getting started

Prerequisites Node.js: v14.x or higher (LTS recommended) npm: v6.x or higher (comes with Node....

Environment Configuration

Required Environment Variables Create a .env file in the root directory with the following variab...

Database Setup

PostgreSQL Setup Create Database CREATE DATABASE onmarket_db; CREATE USER onmarket_user WITH EN...

Project structure

on-market-landing-api/ │ ├── config/ # Configuration files │ ├── api.js ...

Core modules

1. Store Management Store registration and activation Store profile management Store schedule co...

API Documentation

Interactive API Documentation When running in DEVELOPMENT mode, access interactive API documentat...

Authentication & Authorization

JWT Authentication Login Flow User authenticates through external auth service Receives JWT to...

Features & Integrations

1. Three-Level Referral System Purpose: Incentivize user acquisition through multi-level referral...

Scheduled Tasks

The application runs several scheduled tasks defined in schedulers/scheduledTask.js: 1. Update In...

WebSocket and payment integration

WebSocket/Real-time Features Socket.IO Implementation Server Setup (in index.js): const server = ...

File Upload & Storage

Multer Configuration Local Storage (temporary): // config/multer.js const storage = multer.diskSt...

Testing and deployment

Testing Current Test Setup The project currently has limited automated tests. Main test file: r...

Troubleshooting

Common Issues 1. Database Connection Errors Problem: Cannot connect to PostgreSQL/MongoDB ERROR N...

Best practices

Code Organization Follow MVC Pattern Models: Data structures and database operations Controlle...

Additional Resources

Related Documentation GoSend Integration Guide Referral System Guide OpenAPI Specification ...

Appendix

Environment Variable Reference Variable Type Required Description ENV string Yes Environme...