Skip to content

Gautamvaishnav-git/pde-relational-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relational-Sync Instructions

This guide provides step-by-step instructions to set up, run, and verify the Document Versioning System.

📋 Prerequisites

Ensure you have the following installed on your machine:

  • Node.js (v18 or higher)
  • npm (Node Package Manager)
  • Docker & Docker Compose (for running PostgreSQL and Redis)

⚙️ Setup

  1. Install Dependencies

    npm install
  2. Start Infrastructure This project uses Docker Compose to manage PostgreSQL and Redis instances.

    docker compose up -d
    • PostgreSQL runs on port 5432
    • Redis runs on port 6379
  3. Environment Variables The project expects a .env file in the root directory. A default one should already be present:

    PG_HOST=localhost
    PG_PORT=5432
    PG_USER=postgres
    PG_PASSWORD=postgres
    PG_DATABASE=postgres
    REDIS_HOST=localhost
    REDIS_PORT=6379
    PORT=3000

🚀 Running the Application

Development Mode

Runs the server using ts-node for hot-reloading (if configured) or direct TypeScript execution.

npm run dev

Production Build

Compiles the TypeScript code to JavaScript in the dist folder and includes necessary assets (like schema.sql).

npm run build
npm start

✅ Verification

To verify that the system correctly handles concurrent version updates (PostgreSQL Row-Level Locking):

  1. Ensure the server is running (in a separate terminal).
  2. Run the verification script:
    npm run npm:verify

Expected Output: The script sends 5 parallel update requests. You should see a success message indicating the final version is 6 (1 initial creation + 5 updates).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors