Follow these steps to host your Fake Review Detection API for free on Render.
- Ensure all project files are in your GitHub repository.
- IMPORTANT: Make sure the serialized model files (
fake_review_model.pklandscaler.pkl) are in thenotebooks/directory of your repo. - The root of your repo should contain:
api.py,requirements.txt,Procfile, andrender.yaml.
- Log in to Render.com.
- Click New + and select Web Service.
- Connect your GitHub repository.
- Name:
fake-review-api(or any name you like). - Environment:
Python. - Region: Choose the one closest to you.
- Branch:
main(or your default branch). - Build Command:
pip install -r requirements.txt. - Start Command:
gunicorn api:app. - Plan: Select Free.
- Click Create Web Service.
- Wait for the build to complete.
- Once the status is "Live", copy the Render URL (e.g.,
https://fake-review-api.onrender.com).
- In your React/Dashboard app, find where the API URL is defined.
- Replace
http://localhost:5000with your new Render URL. - Deploy your React app (e.g., to Vercel or Render Static Site).
Note on Free Tier: Render's free instances spin down after 15 minutes of inactivity. The first request after a break might take 30-60 seconds to respond as the server boots up.