Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 3.09 KB

File metadata and controls

69 lines (52 loc) · 3.09 KB

Fin-Trust - Deployment Guide

This document describes how to deploy Fin-Trust to production hosting platforms.


💻 Frontend Deployment (Vercel)

The React frontend compiles to a static bundle using Vite and can be hosted on Vercel or Netlify.

Step 1: Push Frontend to GitHub

Ensure the frontend/ folder is committed to your repository root.

Step 2: Configure Vercel Project

  1. Log in to Vercel and import your repository.
  2. Select Vite as the Framework Preset.
  3. Configure directories:
    • Root Directory: frontend
  4. Expand Environment Variables and add:
    • VITE_API_URL: Your deployed backend API URL (e.g. https://fin-trust-backend.onrender.com/api)
  5. Click Deploy. Vercel will automatically run npm run build and provision an SSL certificate.

⚙️ Backend Deployment (Render)

The backend runs as a continuous Node.js server. We recommend deploying to Render as a Web Service.

Step 1: Create a Web Service

  1. Log in to Render and link your GitHub account.
  2. Click New + and select Web Service.
  3. Select your repository.
  4. Configure service parameters:
    • Name: fin-trust-backend
    • Root Directory: backend
    • Runtime: Node
    • Build Command: npm install
    • Start Command: npm start
    • Instance Type: Free (or higher)

Step 2: Add Environment Variables

Add the following key-value pairs in the Environment settings tab of your Render service:

Variable Recommended Value Purpose
NODE_ENV production Enables production mode rules and disables debug alerts.
PORT 5000 Port for the backend. Render automatically binds this.
MONGO_URI mongodb+srv://... MongoDB connection string.
JWT_SECRET your_long_random_secret_string Used to sign stateless user tokens.
CLIENT_URL https://fintrustinternshipproject.vercel.app Target for CORS verification matches.
BREVO_API_KEY xkeysib-... (Optional) Bypasses SMTP ports blocked by Render.
EMAIL_USER anupkodase@gmail.com Email user login credentials (Gmail App password).
EMAIL_PASS xxxx xxxx xxxx xxxx App password.
GEMINI_API_KEY your_gemini_developer_key Used for generating trust score explanations.

🛡️ Firewall & Email Port Blocking Fallbacks

Many hosting providers (including Render and Heroku) block outbound SMTP ports (25, 465, 587) by default to prevent spam. This can cause standard Nodemailer configurations using Gmail/Outlook SMTP to timeout.

To resolve this issue, Fin-Trust implements two levels of HTTP-based email API delivery fallbacks that run over standard HTTPS port 443 (which is never blocked):

  1. Brevo (Sendinblue) API:
    • If BREVO_API_KEY is configured in the environment, the app automatically delivers verification emails via Brevo's HTTP client endpoint.
  2. Resend API:
    • If RESEND_API_KEY is set, the app will fallback to the Resend HTTP API client.
  3. SMTP Fallback:
    • If neither API key is set, the app falls back to SMTP Nodemailer.