Architecture
- LeaderOS site (
play.example.com): API, admin panel, payment callbacks. It must keep running. - Theme (
shop.example.com): the address players visit. It pulls data from LeaderOS.
Requirements
1. Prepare the server
2. Get the project onto the server
- With Git
- Uploading files
3. Environment variables
Create/var/www/my-theme/.env.production on the server:
Do not add
.env* files to Git. If you regenerate the key, update this file and restart the app.4. Build and start
3000 by default. For another port: PORT=3100 pm2 start npm --name leaderos-theme -- start.
5. Nginx reverse proxy
/etc/nginx/sites-available/leaderos-theme:
6. SSL (HTTPS)
7. Configure the LeaderOS panel
In Settings → Headless API:1
Frontend URL
Enter
https://shop.example.com. E-mail links and payment returns now come to your theme.2
Page paths
Leave the defaults if you use the template’s; if you changed them, enter the same paths.
3
Origins
Not needed for the template, which uses the proxy. If you call the API directly from the browser, add
https://shop.example.com. “Allow all origins” must be off.8. Payment providers
- Browser return: after paying, the player returns to your theme’s
/payment/successand/payment/errorpages. - Server notifications (callbacks/webhooks) keep arriving at LeaderOS: the PayTR notification URL, Stripe/Shopier webhooks and so on. Do not change your existing settings; they must still point to your LeaderOS site.
- Test the payment flow end to end with a small amount before going live.
