Ru

Instructions for deploying CRYSTAL v2.0 on a local PC and VPC


Project structure:

  • MongoDB v8.0.4.
  • Express.js v4.21.2.
  • React v19.0.0.
  • Node.js v24.0.2.
  • NPM v11.6.4.
  • PM2 v5.4.3.
  • Vite v6.1.0.

VM Specifications:

  • Guaranteed vCPU share: 30%.
  • vCPU: 2.
  • RAM: 4 GB.
  • SSD: 20 GB.
  • OS: Debian 12.
  • Web server: Nginx v1.22.1.

Local PC Specifications:

  • OS: Windows 11 Pro.

Before using CRYSTAL v2.0 or its code in a production environment, it is strongly recommended that you carefully review the implementation and assess the potential cybersecurity risks.


In the instructions from the CRYSTAL v1.0 documentation, the implementation of some env variables differs, since in CRYSTAL v2.0, their structure is frontend and backend are more extensive, but overall the instructions are suitable for CRYSTAL v2.0.


It is necessary to consistently follow all the steps.


1. Deploying to a local PC.

1.1. Create env variables following the corresponding examples for frontend and backend.

1.2. Follow the instructions in paragraph 2, CRYSTAL v1.0 documentation.


2. Deploying to a VPC.

2.1. Create env variables following the corresponding examples for frontend and backend.

2.2. Follow steps 3 through 8 from CRYSTAL v1.0 documentation.
You can upload project files to a VM in a VPC via SFTP in FileZilla instead of GitHub. It is recommended not to move the node_modules folder of the backend project from the local PC to the VM, but to re-run the command - npm install on the VM, as starting the backend may cause a critical error due to bcrypt, which compiles to the binary .node and only works with the operating system in which the command - npm install was originally run.

2.3. Create an administrator account in the MongoDB database on the VM and specify the values ​​in relevant env variables, to perform safe connection to the database.

2.4. Add to Nginx configuration, location /ws rule for WebSocket support, following this example:

location /ws { 
proxy_pass http://127.0.0.1:3000; 
proxy_http_version 1.1; 

# Protocol switching (Upgrade) 
proxy_set_header Upgrade $http_upgrade; 
proxy_set_header Connection "upgrade"; 

#Headings 
proxy_set_header Host $host; 
proxy_set_header X-Real-IP $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 

# Timeout to prevent the connection from dropping too quickly (optional) 
proxy_read_timeout 60s; 
}

CRYSTAL is tested on

BrowserStack

Share

Copy

USDT (TRON (TRC20)): TTvJdwtL3VAZKSHbYi8B2eQEQDxbHUD4Ka

POL (Polygon PoS): 0x97377684b9a589eca92e2c6c8430e6dcf2bae8c2

ETH (Base Mainnet): 0x97377684b9a589eca92e2c6c8430e6dcf2bae8c2

ETH (ERC20): 0x97377684b9a589eca92e2c6c8430e6dcf2bae8c2

BTC (BTC): 12GkhJZWrdn23PUerGerN7nSZXHwWGm59U

Similar posts

This website uses cookies. By clicking the 'Accept' button or continuing to use the website, you agree to the use of cookies.