https://github.com/chetannada/foodfire-server
A FoodFire-Server (Node.js web server) for FoodFire app - A Namaste React Course Project
https://github.com/chetannada/foodfire-server
expressjs foodfire foodfire-app foodfire-server namaste-react nodejs nodejs-server webserver
Last synced: 5 days ago
JSON representation
A FoodFire-Server (Node.js web server) for FoodFire app - A Namaste React Course Project
- Host: GitHub
- URL: https://github.com/chetannada/foodfire-server
- Owner: chetannada
- Created: 2024-01-07T18:01:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T19:11:43.000Z (7 months ago)
- Last Synced: 2025-08-02T01:37:51.012Z (3 months ago)
- Topics: expressjs, foodfire, foodfire-app, foodfire-server, namaste-react, nodejs, nodejs-server, webserver
- Language: JavaScript
- Homepage: https://foodfire.onrender.com
- Size: 152 KB
- Stars: 7
- Watchers: 2
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌐 FoodFire Server
A FoodFire Server (Node.js web server) that fetches data from a third-party (Swiggy) API (Fix the CORS Issue) and exposes it to a client [🚀 FoodFire ](https://foodfire-app.netlify.app/) App 😍.
🍁 [FoodFire App](https://foodfire-app.netlify.app/) is part of [Namaste React Live Course](https://namastedev.com/learn/namaste-react?_aff=946684804112) and Github Repository for this App is [Namaste-React 💜](https://github.com/chetannada/Namaste-React) ️
## 🔥 Clone this Repository
You need to write the following commands on the terminal screen(in vscode) so that you can run this project locally.
```bash
git clone "https://github.com/chetannada/FoodFire-Server.git"
```
Go to the project directory
```bash
cd FoodFire-Server
```
Install dependencies
```bash
npm install
```
Start the server
```bash
npm run start
```
This application should now be running on `localhost`. If you want to Fork repository and want to run locally, follow this guidelines [Fork and Clone Github Repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
💫 Test the FoodFire Server Locally in your FoodFire React App then use this domain name (`http://localhost:5000/`) if the Server is running on a `5000` Port:
```javascript
const response = await fetch(
`http://localhost:5000/api/restaurants?lat=12.9351929&lng=77.62448069999999&page_type=DESKTOP_WEB_LISTING`
);
const data = await response.json();
```
## 🔮 Deploy the FoodFire server
Once you have tested the FoodFire server locally, you can deploy it to a production environment by following these steps.
1. Create an account on [Render](https://render.com/) if you haven't already.
2. Click on the `New +` button and select `Web Service` from the dropdown menu.
3. `Connect` to your own GitHub repository (node server that you have created your own) which you want to deploy.
4. In the `Settings` tab, scroll down to the `Environment Variables` section and add all environment variables from `.env` file.
5. Wait for the deployment to finish. Once it's done, you should see a success message and a link to our server URL. For Instance: `http://YourOwnServerName.onrender.com`
6. Click on the link URL to test our server.
Note: Now that our server is deployed on [Render](https://render.com/) you can change the API URL in react app to the domain in which the server is deployed. For instance: if your server is hosted in `http://YourOwnServerName.onrender.com`, in the react app while sending a request to API, use this domain name :
```javascript
const response = await fetch(
`http://YourOwnServerName.onrender.com/api/restaurants?lat=12.9351929&lng=77.62448069999999&page_type=DESKTOP_WEB_LISTING`
);
```
## 🔗 Let's Connect
[](https://www.linkedin.com/in/chetannada/)
[](https://twitter.com/chetannada)
[](https://discordapp.com/users/916005177838956555)