================================================================
  ONLINE STUDY BIBLE - BLOG  ·  PRODUCTION DEPLOYMENT PACKAGE
  (onlinestudybible.in/blog  +  admin at onlinestudybible.in/blog/os)
================================================================

WHAT IS IN THIS FOLDER
----------------------
  server.js        Start file (run with: node server.js)
  .next/           Pre-built production app (do NOT edit)
  node_modules/    Runtime dependencies (already included - no npm install needed)
  public/          Brand logo, favicons, uploaded images (public/uploads)
  db/custom.db     SQLite database WITH your current content:
                   5 posts (4 published, 1 draft), categories, tags,
                   settings, media
  prisma/          Database schema (only needed for future DB work)
  .env             DATABASE_URL (relative - works anywhere, no edits needed)

REQUIREMENTS
------------
  - Node.js 20 or newer  (check with: node -v)
  - That is all. No npm install, no build step - it is pre-built.

QUICK START (any server / VPS)
------------------------------
  1. Upload this whole folder to e.g. /home/USER/osb-blog
  2. From inside the folder run:   node server.js
     (optional: PORT=3000 node server.js  - default port is 3000)
  3. Open http://YOUR-SERVER-IP:3000/blog

FIRST THINGS TO DO AFTER DEPLOY
-------------------------------
  1. Go to  https://onlinestudybible.in/blog/os  and sign in:
        username: admin
        password: admin123
  2. IMMEDIATELY change the password:
        Admin > Database & Website > Admin Account
  3. Admin > Site Settings > set Site URL to your final URL
        (it controls sitemap, RSS, canonical links and share buttons)

PUTTING IT ON onlinestudybible.in/blog (SAME DOMAIN AS MAIN SITE)
------------------------------------------------------------------
  The app already uses /blog/... internally, so point your web server's
  reverse proxy to it. Forward THESE PATHS to the app (the app port,
  e.g. 3000):

    /blog   /api   /_next   /brand   /uploads
    /icon.png   /apple-icon.png
    /sitemap.xml   /robots.txt   /rss.xml   /llms.txt

  NGINX example:
    location /blog  { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; }
    location /api   { proxy_pass http://127.0.0.1:3000; }
    location /_next { proxy_pass http://127.0.0.1:3000; }
    location /brand { proxy_pass http://127.0.0.1:3000; }
    location /uploads { proxy_pass http://127.0.0.1:3000; }
    location = /icon.png      { proxy_pass http://127.0.0.1:3000; }
    location = /apple-icon.png{ proxy_pass http://127.0.0.1:3000; }
    location = /sitemap.xml   { proxy_pass http://127.0.0.1:3000; }
    location = /robots.txt    { proxy_pass http://127.0.0.1:3000; }
    location = /rss.xml       { proxy_pass http://127.0.0.1:3000; }
    location = /llms.txt      { proxy_pass http://127.0.0.1:3000; }

  APACHE (.htaccess) example:
    RewriteEngine On
    RewriteRule ^blog-api-guard - [L]
    ProxyPreserveHost On
    ProxyPass /blog http://127.0.0.1:3000/blog
    ProxyPassReverse /blog http://127.0.0.1:3000/blog
    ProxyPass /api http://127.0.0.1:3000/api
    ProxyPass /_next http://127.0.0.1:3000/_next
    ProxyPass /brand http://127.0.0.1:3000/brand
    ProxyPass /uploads http://127.0.0.1:3000/uploads
    (plus the single files listed above with ProxyPass lines)

  EASIEST ALTERNATIVE: put the app on a subdomain
  (e.g. blog.onlinestudybible.in), no proxy path list needed - then
  update Site URL in admin settings to match.

  cPanel "Setup Node.js App" (Passenger) users:
    - Create the application on a SUBDOMAIN root (not as a sub-URI of
      your main site - Passenger strips sub-URI prefixes, which would
      break the /blog paths).
    - Application root: the uploaded folder
    - Application startup file: server.js
    - No npm install / build needed.

KEEP IT RUNNING (VPS)
---------------------
    npm install -g pm2
    pm2 start server.js --name osb-blog
    pm2 save

UPLOADS / MEDIA
---------------
  Images you upload in the admin are written to public/uploads/ inside
  this folder and stored in the database. Back up the folder
  (or use Admin > Database & Website > Backup to download a JSON backup).

TROUBLESHOOTING
---------------
  - Port already in use:  PORT=4000 node server.js
  - Database errors: make sure the folder db/ sits next to server.js
    (or set DATABASE_URL=file:/absolute/path/to/custom.db in .env)
  - After changing .env, restart the app.
================================================================
