# Install Scalping Space on a Linux VPS

The bundle contains the Scalping Space website and Node service, the branded review HTML, and the editable brand assets. A new installation starts with an empty database. To upgrade an existing installation, back up the SQLite database and rerun the installer from this ZIP. The standalone review HTML contains sample data and lets you switch demo roles. To try the subscriber workspace, open the HTML in a browser and choose **Open workspace** or **Menu → Subscriber**. The live VPS uses **Subscriber login** with a real account.

Use an SSH account with sudo or root access. Upload `Scalping-Space-VPS-Install.zip` to a private working directory on the VPS. The application runs as a system service.

## 1. Set DNS

At the registrar or DNS provider for `scalping.space`, create an **A** record for `@` pointing to your VPS public IPv4 address. Add an **AAAA** record only if the VPS is configured to serve IPv6. This setup uses `scalping.space` as the canonical hostname. Keep any mail records you already use. Check the record before requesting a certificate:

```sh
dig +short A scalping.space
dig +short AAAA scalping.space
```

Allow inbound ports 80 and 443 in your VPS firewall and provider firewall. The app listens on 127.0.0.1:4815. Keep port 4815 private.

## 2. Install the application

Use a system installation of **Node.js 24**, plus systemd and a reverse proxy. Install Node.js 24 from a trusted system package or official release. This app has no npm dependencies. On an upgrade, back up the SQLite database before running the installer. [Node.js release and LTS information](https://nodejs.org/en/about/previous-releases)

Start in the directory containing the ZIP.

```sh
unzip Scalping-Space-VPS-Install.zip
cd Scalping-Space
node --version
sudo ./install.sh
curl -fsS -H 'Host: scalping.space' http://127.0.0.1:4815/healthz
```

The service runs as the `scalping-space` user. The installer copies code to `/opt/scalping-space/app` and writes application data to `/var/lib/scalping-space`. The database and an existing `/etc/scalping-space.env` survive re-running the installer. If Node is installed in a different system location, run `sudo SCALPING_NODE_BIN=/absolute/path/to/node ./install.sh`.

## 3. Connect the reverse proxy and enable HTTPS

For a VPS with **Nginx** managing virtual hosts, copy `deploy/scalping.space.nginx.conf` into an active Nginx configuration directory. On a typical Nginx install using `conf.d`:

```sh
sudo install -m 644 deploy/scalping.space.nginx.conf /etc/nginx/conf.d/scalping.space.conf
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d scalping.space --redirect
curl -fsS https://scalping.space/healthz
```

Install Certbot using the instructions for your operating system. Add the proxy settings to the existing Nginx virtual host when it already serves the domain. [Certbot setup instructions](https://certbot.eff.org/instructions)

### WHM/cPanel with EasyApache 4

Use this path if Apache manages the domain. Keep the existing cPanel virtual host, ports and AutoSSL certificate.

1. Add `scalping.space` to the intended cPanel account. Point DNS to the VPS and run AutoSSL in WHM. Confirm the domain has a valid HTTPS virtual host. [WHM AutoSSL documentation](https://docs.cpanel.net/whm/ssl-tls/manage-autossl/)
2. As root, confirm Apache has `proxy`, `proxy_http`, `headers` and `rewrite` loaded with `apachectl -M`. Replace `CPANELUSER` with the domain owner’s cPanel username in the paths below.
3. Create `/etc/apache2/conf.d/userdata/ssl/2_4/CPANELUSER/scalping.space/scalping-space.conf` with these directives. [Domain-specific Apache includes](https://docs.cpanel.net/ea4/apache/modify-apache-virtual-hosts-with-include-files/) · [Apache reverse proxy](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html)

```apache
ProxyRequests Off
ProxyPreserveHost On
ProxyPass "/.well-known/" "!"
ProxyPass "/" "http://127.0.0.1:4815/" timeout=95
ProxyPassReverse "/" "http://127.0.0.1:4815/"
RequestHeader set X-Client-IP "expr=%{REMOTE_ADDR}"
LimitRequestBody 22020096
```

4. Create `/etc/apache2/conf.d/userdata/std/2_4/CPANELUSER/scalping.space/scalping-space.conf` for the HTTP redirect. Leave the validation paths available to AutoSSL.

```apache
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/
RewriteRule ^ https://scalping.space%{REQUEST_URI} [R=301,L]
```

5. Rebuild Apache’s configuration, test it before restarting, then check the public endpoint. If a managed proxy sits in front of Apache, confirm its HTTPS host, cache bypass for authenticated requests, and upload limit for this domain.

```sh
sudo /usr/local/cpanel/scripts/rebuildhttpdconf
sudo apachectl -t
sudo /usr/local/cpanel/scripts/restartsrv_httpd
curl -fsS https://scalping.space/healthz
```

If `apachectl -t` reports an error, correct it before restarting. For any proxy setup, preserve the original Host header. Derive `X-Client-IP` from the trusted connection and overwrite incoming values.

## 4. Set up the administrator

On a fresh installation, wait for HTTPS to work and replace the example address with your real admin email. For upgrades, use your existing admin account. Use the same Node binary as the service.

```sh
sudo -u scalping-space env SCALPING_ORIGIN=https://scalping.space SCALPING_DB=/var/lib/scalping-space/state.sqlite \
  /usr/bin/node /opt/scalping-space/app/server.mjs init-admin owner@example.com
```

Open the printed, one-time link in your browser to set a password. The link expires in 24 hours. Keep it private. For admin account recovery, use `reset-admin` with the same email. Redeeming a reset link ends the account’s prior sessions.

The sign-in pages are `/admin-login` and `/subscriber-login`. The demo role switch belongs to the standalone review HTML. In **Members**, you can also invite a member or issue a replacement setup link. Send setup links privately.

## 5. Configure subscriptions and checkout

Checkout receipts, account history, admin screens and order notifications use a short reference such as `SUB001234`. The sequence covers subscriptions and Academy orders. Existing orders receive short references on upgrade. Their payment records and internal IDs are preserved.

1. Open **Subscriptions → Term pricing** and set INR prices for Monthly, 6 months, 1 year and Lifetime. A zero price hides that term. Review the markets and features in **Plans & access**. On an existing database, select **MCX Commodities** and **Delta Crypto** for the desks that should see those calls and rooms.
2. Open **Site settings → Checkout & UPI QR**. Enter your merchant UPI ID and registered payee name, enable checkout, and add a WhatsApp support number if needed. Keep public plans enabled in **Website & support**. Selecting a priced term shows a QR for the quoted amount after any coupon. Buyers can scan it or try **Open UPI app** on mobile. Checkout records the buyer’s UTR for manual verification. Confirm the payee and amount with your UPI provider before launch.
3. Create percentage or fixed-amount coupons. Configure desk, term, expiration date and usage limit as needed. The site calculates and checks totals on the server. The **Special offers** editor can feature one enabled coupon. Use the same code or disable an old coupon to update a promotion.
4. Under **Site settings → SEBI & market risk disclosure**, enter the legal name, registered address, verified registration details if applicable, and grievance contact. The public warning and disclosure page are always available. Checkout stores the accepted disclosure and timestamp with the order. [SEBI Master Circular for Research Analysts](https://www.sebi.gov.in/legal/master-circulars/feb-2026/master-circular-for-research-analysts_99571.html)
5. In **Subscriptions → Orders**, match the reference and amount to the payment received, choose **Verify payment**, and then choose **Approve access**. A first-time subscriber gets a 24-hour password setup link. A same-desk renewal extends the future expiry. A desk change starts the new term at approval. Lifetime access has no expiry. The checkout records UPI references for manual verification. Automatic collection, renewals and refunds require a payment gateway.

## 6. Configure email, WhatsApp and market data

Use **Site settings → Live market data** to save an Upstox access token, enable the Delta public feed, choose the default market and refresh interval, and test each provider. Blank token input preserves the saved value. The clear option removes the saved token and suppresses the environment fallback. The in-app token is encrypted in SQLite with a service-readable key at `${SCALPING_DB}.settings-key`. For migration, move that key securely and separately, or re-enter the Upstox token on the new server.

**Site settings → TradingView charts** controls allowed audience, initial symbols, theme, chart type, timezone, interval, auto-loading, symbol search and toolbar. The first listed symbol is the default. [TradingView advanced chart widget](https://www.tradingview.com/widget-docs/widgets/charts/advanced-chart)

Edit `/etc/scalping-space.env` privately for email, WhatsApp and optional feed defaults. The bundled `deploy/scalping-space.env.example` lists the keys. The installer preserves existing environment files, so copy in the needed keys when upgrading. Run `sudo systemctl restart scalping-space` after editing.

| Feature | Configuration |
| --- | --- |
| Email | Set `SCALPING_RESEND_KEY` and `SCALPING_EMAIL_FROM` with a verified sender. **Email library** has editable subjects, bodies and supported variables for order submission, payment verification, approval, rejection and trade events. Use **Site settings → Call email triggers** to control new calls, entry, stop-loss hit, target hit, stop-loss trail, target trail, close and cancellation. Recording a supported call update queues the corresponding template for eligible subscribers. Its delivery queue shows queued, sent and review-needed statuses. [Resend email API](https://resend.com/docs/api-reference/emails/send-email) |
| WhatsApp | Set `SCALPING_WA_GRAPH_VERSION`, `SCALPING_WA_PHONE_ID`, `SCALPING_WA_TOKEN`, `SCALPING_WA_ORDER_TEMPLATE` and the template language. Use an approved utility template with three body variables in this order: order ID, order status, total. Only buyers who opt in receive automated order updates. [Meta WhatsApp template API](https://www.postman.com/meta/whatsapp-business-platform/request/lwtlz1k/send-message-template-interactive) |
| NSE, BSE and MCX | Save a token in Site settings, or set `SCALPING_UPSTOX_TOKEN` as the initial fallback. Use a token with the provider entitlements for the data and margins you use. Renew the token when it expires. NSE uses the option-chain endpoint. BSE and MCX use the instrument catalogue and full quotes. OI, volume and Greeks are displayed where available. [Instruments](https://upstox.com/developer/api-documentation/instruments/) · [NSE chain](https://upstox.com/developer/api-documentation/get-pc-option-chain/) · [Full quotes](https://upstox.com/developer/api-documentation/get-full-market-quote/) · [Margin](https://upstox.com/developer/api-documentation/margin/) |
| Delta Exchange India | Enable the feed in Site settings, or set `SCALPING_DELTA_ENABLED=true` for an initial default. This enables the exchange’s public asset catalogue and available option chains. BTC, ETH and additional underlyings come from the feed. Assets without listed options can have no expiries. Delta payoff is in the quote currency. Broker basket margin is supported through Upstox. Delta supports payoff calculations. [Delta Exchange India API](https://docs.delta.exchange/) |

Confirm your provider entitlement covers display to your subscribers before opening the market feeds. The screener requests snapshots when loaded, when refreshed, and periodically while visible. It shows the fetch time and provider. The payoff builder supports up to 12 option legs on the same underlying and expiry. Enter the contract’s payoff units per lot if the feed lacks them, including for MCX. Use exact Upstox instrument keys for broker margin and check that the broker supports the contract. Admins can add structured option details when publishing a call to prefill the strategy builder. Older calls can start with a manual leg.

Before launch, use a test order and check provider receipt in **Email library → Delivery queue**. If a setup-link email could not be sent, issue a fresh link in **Members**. Use a test subscriber to confirm the option chain and margin response with your enabled providers.

## Pro Desk chat

**Pro Desk** combines messages from the rooms allowed by the Pro plan plus posts addressed to Pro Desk itself. Mirrored messages retain their original room, so updates, deletions and files follow that room and a reply opens the original conversation. Other plans see their own subscribed rooms. Existing General desk messages appear under Pro Desk after upgrade. The admin can adjust the markets available to each plan in **Plans & access**.

## 7. Verify and maintain

- Test with a separate subscriber account. Confirm they can see only the eligible calls and rooms, then enter a sample portfolio and verify that a different subscriber cannot see it.
- Verify a trade call, a chat message, an attachment and a private journal entry through HTTPS. Use **Member portfolios** for admin review.
- Follow your applicable research-analyst requirements before launching regulated calls or services. Configure the disclosures and policies applicable to your business before a public launch. Reference: [SEBI Research Analyst FAQ](https://www.sebi.gov.in/sebi_data/faqfiles/jul-2025/1753269723942.pdf).
- Use `sudo journalctl -u scalping-space -n 100 --no-pager` to diagnose startup.
- Back up the SQLite database before updating. Run the backup script as the service user with a new path in a private directory, then copy it to protected backup storage.

```sh
sudo -u scalping-space /usr/bin/node /opt/scalping-space/app/backup.mjs \
  /var/lib/scalping-space/backup-$(date +%F-%H%M).sqlite
```

If you use Certbot, validate renewals with `sudo certbot renew --dry-run`. WHM installations use AutoSSL.

The database contains accounts, sessions, calls, attachments, and private journals. Restrict access to the database and backups. The single-instance Node service is intended for a VPS behind HTTPS. Published provider links and streams use the provider’s own access controls. Payment gateway processing and MFA are separate launch work. Keep provider credentials out of ZIP archives and backups you share.

## Academy

- Go to **Admin console → Manage Academy → Courses** to publish a course, set its price and choose whether active calls subscribers receive that course. Set its price to zero for free registration. Archiving closes registration and preserves access for existing enrollments.
- In **Sessions**, choose a course or the shared Academy audience. To publish a live session, enter its date and time in IST and its HTTPS meeting or stream link. The join action appears when the admin sets the session to **Live**. Add the replay as a **Recording** with its HTTPS video URL. Configure access controls with your meeting or video host as needed. YouTube embeds and direct MP4/WebM links use the existing viewer. Other HTTPS links open with the host.
- In **Library**, publish PDFs, TXT files, DOCX, XLSX or PPTX documents up to 10 MB. Shared files are available to approved course learners and active calls subscribers. A course-specific file follows that course’s access. The installer includes **Pre-trade risk checklist** and **Trade review worksheet** as shared resources.
- In **Enrollments**, approve free registrations directly. For paid courses, verify the UPI payment reference and then approve. The first approval for a new learner creates their account and queues the Academy setup link. Existing accounts gain enrollment on their current login. Update or withdraw course access in the same panel. Academy registration and approvals use the existing delivery configuration with Academy-specific templates.
- Real classes and replays use the links you publish. The standalone preview includes a short sample recording, sample courses and both starter worksheets.

## Review HTML

Open `app/Scalping-Space-Review.html` in a browser for a standalone demo. Try **Offers → Choose a plan** with `LEARN10`, see the sample QR and acknowledge the disclosure, then review and approve the sample order in **Admin console → Subscriptions**. Open **Site settings** to review the controls, then open **Email library** to test placeholders with sample data. In **Subscriber**, open **Option chain** or **Strategy builder**. From **Academy**, try a free registration or a priced course. Review the order under **Admin console → Manage Academy → Enrollments**. In the demo, use **Subscriber login → Open demo learner** to see the learning workspace. The demo uses sample prices and does not send messages or process payments.

## Brand assets

Open `brand/Brand-Guide.html` for the “Learn & Grow Together” logo and its colour values. The folder includes the supplied light and dark SVG and transparent PNG files, plus a browser icon made from the logo’s candlesticks.
