Professional trading business website with a responsive frontend and a Node.js/Express backend for lead capture and email notifications.
trader-website
|
+- frontend
| +- index.html
| +- style.css
| +- script.js
|
+- backend
+- server.js
+- package.json
+- .env.example
- Modern dark-theme trading business website
- Responsive layout for mobile, tablet, and desktop
- Smooth scrolling navigation and animated reveals
- Services, achievements, market, and contact sections
- TradingView advanced chart and live ticker widgets
- Client inquiry form with frontend validation
- Express API with Nodemailer email delivery
- CORS, environment-based configuration, and structured error handling
Open frontend/index.html directly in a browser for design review, or serve it locally with any static server.
If you want a simple local static server with Node installed:
npx serve frontendcd backend
npm install
copy .env.example .envFill the .env values, then start the API:
npm run devThe backend runs by default on http://localhost:5000.
Use backend/.env.example as the template.
PORT: Express server portEMAIL_HOST: SMTP host, for examplesmtp.gmail.comEMAIL_PORT: SMTP port, for example587EMAIL_SECURE:truefor SSL orfalsefor TLS upgradeEMAIL_USER: SMTP usernameEMAIL_PASS: SMTP password or app passwordEMAIL_TO: Trader email that receives inquiriesEMAIL_FROM: Sender address shown in outgoing mailCORS_ORIGIN: Comma-separated list of allowed frontend origins
- Push the project to GitHub.
- If you want to publish only the frontend, place the contents of
frontendin a dedicated branch or configure a build/deploy action that publishes thefrontendfolder. - In your GitHub repository settings, open
Pages. - Select the deployment source and point it to the branch/folder that contains the frontend files.
- After deployment, GitHub Pages will provide a public URL.
- Update the API URL inside frontend/script.js by replacing
https://your-render-service.onrender.comwith your real Render backend URL.
- Sign in to Netlify and click
Add new site. - Import the GitHub repository or drag and drop the
frontendfolder. - If using Git integration, set the publish directory to
frontend. - Deploy the site.
- After deployment, update the production API URL in frontend/script.js if needed.
- Push the project to GitHub.
- In Render, create a new
Web Service. - Connect your GitHub repository.
- Set the root directory to
backend. - Use these values:
- Build command:
npm install - Start command:
npm start
- Build command:
- Add environment variables from backend/.env.example.
- Deploy the service.
- Copy the generated Render URL, for example
https://your-service.onrender.com.
- Open frontend/script.js.
- Find the
productionApiBaseUrlvalue. - Replace
https://your-render-service.onrender.comwith the real Render URL. - Add your frontend domain to the backend
CORS_ORIGINvariable on Render. - Redeploy or refresh both services after the update.
- Confirm the backend health route is working:
https://your-render-service.onrender.com/api/health. - Submit the contact form from the live frontend.
- Verify the success response shown on the page.
- Check the trader inbox configured in
EMAIL_TO. - If no mail arrives, verify SMTP credentials, spam folder, and Render environment variables.
- In GitHub Pages or Netlify, open domain settings.
- Add your domain such as
www.yourtradingbrand.com. - Update DNS records at your domain registrar as instructed by the hosting provider.
- Enable HTTPS once DNS propagation completes.
- In Render, open your web service settings.
- Add an API subdomain such as
api.yourtradingbrand.com. - Point your DNS records to Render as instructed.
- Update frontend/script.js so the production API URL uses the custom API domain.
- Replace placeholder contact details, WhatsApp number, and social links
- Replace demo headlines with your preferred financial news feed if needed
- Update business copy with the trader's real credentials and compliance-approved messaging
- Test the form locally and after deployment
- Verify SMTP provider limits and security requirements