This API is built in NodeJS and ExpressJS to find complete recipe of most of the Indian food. The dataset is taken from - https://www.kaggle.com/kanishk307/6000-indian-food-recipes-dataset in a CSV file separated by pipe and imported the same in SQLite3 database.
- To run this API, clone this repository in your server or download and extract the zip in server path.
- Run the commands in terminal - npm install followed by npm i sqlite3
- Create a SQLite3 database using command - sqlite3 recipe.sqlite (Name anything for your database)
- Create a table to hold recipe details with below query -
CREATE TABLE recipe (
Srno INTEGER,
RecipeName TEXT,
TranslatedRecipeName TEXT,
Ingredients TEXT,
TranslatedIngredients TEXT,
PrepTimeInMins INTEGER,
CookTimeInMins INTEGER,
TotalTimeInMins INTEGER,
Servings TEXT,
Cuisine TEXT,
Course TEXT,
Diet TEXT,
Instructions TEXT,
TranslatedInstructions TEXT,
URL TEXT
);
- Import the data of CSV file to SQLite3 database using below query in SQLite3 database -
.mode csv
.header on
.separator ","
.import IndianFoodDataset.csv recipe
- You can test the data by running select queries eg. SELECT * FROM recipe LIMIT 5;
- You may notice that the first row contain the header data. You can delete the first row using below query -
DELETE FROM recipe WHERE Srno in (SELECT Srno FROM recipe LIMIT 1);
- Come out of SQLite3 database and run the script with command - npm start Note: port is 3000 you can change from it bin/www.
You can run the app on port defined in bin/www file and search for the recipe with parameter q. End URL would look like - ?q=tomato