Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubh-Nisar committed Oct 20, 2023
2 parents af6e538 + 139decc commit 28e0f24
Show file tree
Hide file tree
Showing 20 changed files with 1,241 additions and 84 deletions.
13 changes: 10 additions & 3 deletions Code/backend/controllers/recipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Error = require("../errors/error");
* @return {Void} Return Void.*/
async function postRecipes(addRecipeDetails) {
console.log("inside model");
console.log(addRecipeDetails);
console.log(typeof Recipe);
try {
const res = await Recipe.create(addRecipeDetails);
Expand All @@ -38,6 +39,9 @@ async function getRecipes({
let query = {};
console.log("Filters in getRecipes", filters);
if (filters) {
for (const prop in filters) {
console.log(filters[prop], prop);
}
if (filters.CleanedIngredients) {
var str = "(?i)";

Expand All @@ -48,7 +52,11 @@ async function getRecipes({
query.CleanedIngredients = { $regex: str };
console.log("the search string", str);
}
for (const prop in filters) {
console.log(filters[prop] + "pppp" + prop + "oo");
}
var time = parseInt(filters["totalTime"]);
console.log(time, filters["TotalTimeInMins"], typeof filters["totalTime"]);
var budget = parseInt(filters["budget"]);
if (time) {
query.TotalTimeInMins = { $lte: time };
Expand Down Expand Up @@ -166,16 +174,15 @@ async function apiGetRecipes(req, res, next) {
if (req.query.Cuisine && req.query.Cuisine != '""') {
filters.Cuisine = req.query.Cuisine;
}
if (req.query.totalTime) {
filters.totalTime = req.query.totalTime;
if (req.query.TotalTimeInMins) {
filters.totalTime = req.query.TotalTimeInMins;
}
if (req.query.budget) {
filters.budget = req.query.budget;
}
if (req.query.typeOfDiet) {
filters.typeOfDiet = req.query.typeOfDiet;
}

try {
const { recipesList, totalNumRecipes } = await getRecipes({
filters,
Expand Down
2 changes: 0 additions & 2 deletions Code/backend/models/recipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ const recipeSchema = new Schema(
},
typeOfDiet: {
type: String,
enum: ["Vegan", "Vegetarian", "Non-Vegetarian"],
message: "${VALUE} is not a diet type.",
},
user: {
type: mongoose.Schema.Types.ObjectId,
Expand Down
3 changes: 3 additions & 0 deletions Code/backend/utils/parsingRecipeData.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const parsingRecipeData = (req, res, next) => {
console.log(req.body);
req.body.TranslatedRecipeName = req.body.recipe_name;
req.body.CleanedIngredients = req.body.recipe_ingredients;
req.body.Cuisine = req.body.recipe_cuisine;
req.body.TotalTimeInMins = req.body.recipe_time;
req.body.imageUrl = req.body.recipe_url;
req.body.TranslatedInstructions = req.body.recipe_instructions;
req.body.budget = req.body.recipe_budget;
req.body.typeOfDiet = req.body.food_pref;
next();
};

Expand Down
2 changes: 1 addition & 1 deletion Code/frontend/src/components/AddRecipeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Form extends Component {

// this.props.sendRecipeFormData(dict);
console.log(all_val_filled);
if (all_val_filled.length == 6) {
if (all_val_filled.length == 8) {
this.submitToApi(dict);
this.setState({
// cuisine : "Any",
Expand Down
1,046 changes: 1,046 additions & 0 deletions Docs/Proj1_Rubric.csv

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions Docs/Proj2_Rubric.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
,Project,(n) Recipe Recommender,,,
,Links,https://github.com/Shubh-Nisar/Recipe_Recommender,,,
,,Yes / No,Score,Evidence,Notes
,,,,,
,Total Score:,,182,,
,,,,,
,Video,Yes,3,A highly descriptive video that cover the entire project,
,Workload is spread over the whole team,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/graphs/contributors,
,Number of commits,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/graphs/contributors,201 commits
,Number of commits: by different people,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/graphs/contributors,"Slighly Balanced Commits
60, 54, 47, 40"
,Issues reports,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/issues?q=is%3Aopen+is%3Aissue,19 Issues reported in total
,Issues are being closed,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/issues?q=is%3Aissue+is%3Aclosed,16 issues were closed
,DOI badge,Yes,3,https://zenodo.org/badge/latestdoi/429944963,
,"Docs: doco generated, format not ugly",Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender,The documentation is neatly laid out but can be more descriptive
,Docs: what: point descriptions of each class/function (in isolation),Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/Code/frontend/src/components/AddRecipeForm.js,Similar comments for all the files.
,"Docs: how: for common use cases X,Y,Z mini-tutorials showing worked examples on how to do X,Y,Z",Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#work-flow,
,"Docs: why: docs tell a story, motivate the whole thing, deliver a punchline that makes you want to rush out and use the thing",Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/README.md,The entire documentation is laid out in a interesting pattern that raises interest in using the software
,"Docs: short video, animated, hosted on your repo. That convinces people why they want to work on your code.",Yes,3,,
,Use of version control tools,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/.gitignore,Github and Git
,Use of style checkers,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/Code/backend/package.json,Prettier
,Use of code formatters.,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/Code/backend/package.json,Eslint
,Use of syntax checkers.,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/Code/backend/package.json,Eslint
,Use of code coverage,Yes,3,https://codecov.io/gh/Shubh-Nisar/Recipe_Recommender,
,Other automated analysis tools,No,0,,
,Test cases exist,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master/Code/backend/test,
,Test cases are routinely executed,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master/Code/backend/test,
,The files CONTRIBUTING.md lists coding standards and lots of tips on how to extend the system without screwing things up,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/CONTRIBUTING.md,
,Issues are discussed before they are closed,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/issues,
,Chat channel: exists,No,0,,
,Test cases: a large proportion of the issues related to handling failing cases.,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master/Code/backend/test,Handles API test cases
,Evidence that the whole team is using the same tools: everyone can get to all tools and files,Yes,3,,
,"Evidence that the whole team is using the same tools (e.g. config files in the repo, updated by lots of different people)",Yes,3,,
,"Evidence that the whole team is using the same tools (e.g. tutor can ask anyone to share screen, they demonstrate the system running on their computer)",Yes,2,,
,Evidence that the members of the team are working across multiple places in the code base,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/commits/master/Code/frontend,Commits from all the contributors in different domains
,Short release cycles,Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/releases,
,Is your software’s architecture and design modular?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master/Code/Infrastructure,"Component and modular division of code to allow ease of code readability, updates and code re-use"
,Does your software use an accepted coding standard or convention?,Yes,2,https://www.educative.io/answers/how-to-modularize-code-in-react,See directory structure
,"Does your software allow data to be imported and exported using open data formats? (e.g. GIF, SVG, HTML, XML, tar, zip, CSV, JSON, NetCDF, or domain specific ones)",No,1,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/Code/frontend/src/components/AddRecipeForm.js,Text input only.
,Does your software allow communications using open communications protocols?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master/Code/backend/api,Frontend and Backend Communicate using Axios
,Is your software cross-platform compatible?,Yes,3,Web Software is platform independent,
,Does your software adhere to appropriate accessibility conventions or standards?,Yes,2,https://www.educative.io/answers/how-to-modularize-code-in-react,See directory structure
,Is your source code stored in a repository under revision control?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master,
,Is each source code release a snapshot of the repository?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tags,
,Are releases tagged in the repository?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tags,
,Is there a branch of the repository that is always stable?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master,Master Branch
,Do you back-up your repository?,No,0,,
,Do you provide publicly-available instructions for building your software from the source code?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#project-setup-steps,
,"Can you build, or package, your software using an automated tool?",Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/Code/frontend/package.json,npm run build
,Do you provide publicly-available instructions for deploying your software?,No,0,,
,Does your documentation list all third-party dependencies?,No,1,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#execution-steps,Only test depedencies mentioned
,Does your documentation list the version number for all third-party dependencies?,No,0,,
,"Does your software list the web address, and licences for all third-party dependencies and say whether the dependencies are mandatory or optional?",No,0,,
,Can you download dependencies using a dependency management tool or package manager?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#installation,Node Package Manager
,Do you have tests that can be run after your software has been built or deployed to show whether the build or deployment has been successful?,Yes,2,npm test,"Run development tests, no build tests"
,Do you have an automated test suite for your software?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#technology-stack,JEST
,Do you have a framework to periodically (e.g. nightly) run your tests on the latest version of the source code?,No,0,,
,"Do you use continuous integration, automatically running tests whenever changes are made to your source code?",No,0,No CI/CD pipelines,
,Are your test results publicly visible?,Yes,3,"Test Suites: 1 passed, 1 total
Tests: 20 passed, 20 total",
,Are all manually-run tests documented?,No,0,No manually-run tests required.,
,"Does your project have resources (e.g. blog, Twitter, RSS feed, Facebook page, wiki, mailing list) that are regularly updated with information about your software?
e.g. release announcements, publications, workshops, conference presentations",No,0,,
,Does your website state how many projects and users are associated with your project?,No,0,,
,Do you provide success stories on your website?,No,0,,
,Do you list your important partners and collaborators on your website?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#acknowlegements,
,Do you list your project's publications on your website or link to a resource where these are available?,No,0,,
,Do you list third-party publications that refer to your software on your website or link to a resource where these are available?,No,0,,
,Can users subscribe to notifications to changes to your source code repository?,Yes,3,"Github ""watch"" feature",
,"If your software is developed as an open source project (and, not just a project developing open source software), do you have a governance model?",Yes,1,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master#-our-motto-eat-good-be-healthy-stay-happy-,
,"Do you accept contributions (e.g. bug fixes, enhancements, documentation updates, tutorials) from people who are not part of your project?",Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/pulls,
,Do you have a contributions policy?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/CONTRIBUTING.md,
,Is your contributions' policy publicly available?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/CONTRIBUTING.md,
,Do contributors keep the copyright/IP of their contributions?,No,1,,
,Does your website and documentation clearly state the copyright owners of your software and documentation?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/LICENSE,
,Does each of your source code files include a copyright statement?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/LICENSE,
,Does your website and documentation clearly state the licence of your software?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/LICENSE,
,Is your software released under an open source licence?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/LICENSE,
,Is your software released under an OSI-approved open-source licence?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/LICENSE,
,Does each of your source code files include a licence header?,No,0,,
,Do you have a recommended citation for your software?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/CITATION.md,
,"Does your website or documentation include a project roadmap (a list of project and development milestones for the next 3, 6 and 12 months)?",Yes,1,https://github.com/Shubh-Nisar/Recipe_Recommender#roadmap,
,"Does your website or documentation describe how your project is funded, and the period over which funding is guaranteed?",No,0,,
,"Do you make timely announcements of the deprecation of components, APIs, etc.?",No,0,,
,,,,,
,,,,,
1. What your software does,"1.1 Does your website and documentation provide a clear, high-level overview of your software?",Yes,2,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/README.md#documentation,
,1.2 Does your website and documentation clearly describe the type of user who should use your software?,Yes,2,,
,1.3 Do you publish case studies to show how your software has been used by yourself and others?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/README.md#work-flow,
,,,,,
2. Your project's and software's identity,2.1 Is the name of your project/software unique?,No,1,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/README.md#star-gen-a-star-recipe-generator-,"Recipe Recommender is a commonly available tool.
Multiple projects can be found under this topic:
https://github.com/topics/recipe-recommendation"
,2.2 Is your project/software name free from trademark violations?,Yes,1,https://trademark-search.marcaria.com/en/result?trademark=STARGEN&country=US&classes=&status=1&mode=3&searchby=1,"Conflict with STARGEN
Filing: 78633128
Obtained on: 2005-05-19
Registration: 3128154
Obtained on: 2006-08-08
DANISCO US INC."
,,,,,
3. Availability of your software,3.1 Is your software available as a package that can be deployed without building it?,No,0,,
,3.2 Is your software available for free?,Yes,2,"Except for NodeMailer, third party npm library, all the sub-components and packages are available freely.",Requires a company email address
,"3.3 Is your source code publicly available to download, either as a downloadable bundle or via access to a source code repository?",Yes,3,git clone https://github.com/PvPatel-1001/Recipe_Recommender.git,
,"3.4 Is your software hosted in an established, third-party repository likeGitHub (https://github.com), BitBucket (https://bitbucket.org),LaunchPad (https://launchpad.net) orSourceForge (https://sourceforge.net)?",Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/tree/master,
,,,,,
4. Your software's documentation,4.1 Is your documentation clearly available on your website or within your software?,Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/README.md,"Efficiently laid out Installation and execution steps, roadmap and scope of improvement, licensing, contribution, and acknowledgements."
,"4.2 Does your documentation include a ""quick start"" guide, that provides a short overview of how to use your software with some basic examples",No,2,"A standard procedure is available which is concise but a dedicated ""quick start"" guide is missing",
,"4.3 If you provide more extensive documentation, does this provide clear, step-by-step instructions on how to deploy and use your software?",Yes,3,https://github.com/Shubh-Nisar/Recipe_Recommender/blob/master/README.md#execution-steps,
,"4.4 Do you provide a comprehensive guide to all your software’s commands, functions and options?",Yes,3,,
,4.5 Do you provide troubleshooting information that describes the symptoms and step-by-step solutions for problems and error messages?,No,0,There is no information about potential problems and error messages.,
,"4.6 If your software can be used as a library, package or service by other software, do you provide comprehensive API documentation?",Yes,2,The API documentation is unavailable but it can be accessed by other software.,
,4.7 Do you store your documentation under revision control with your source code?,No,0,,
,"4.8 Do you publish your release history e.g. release data, version numbers, key features of each release etc. on your web site or in your documentation?",No,1,https://github.com/Shubh-Nisar/Recipe_Recommender#roadmap,A dedicated versioning is not maintained except for a Phase 3 Roadmap
,,,,,
5. How you support your software,5.1 Does your software describe how a user can get help with using your software?,No,0,No dedicated help section,
,"5.2 Does your website and documentation describe what support, if any, you provide to users and developers?",No,0,,
,5.3 Does your project have an e-mail address or forum that is solely for supporting users?,No,0,No such forum or email.,
,5.4 Are e-mails to your support e-mail address received by more than one person?,No,0,N/A due to above point,
,5.5 Does your project have a ticketing system to manage bug reports and feature requests?,No,0,N/A due to above point,
,"5.6 Is your project's ticketing system publicly visible to your users, so they can view bug reports and feature requests?",No,0,N/A due to above point,
Binary file not shown.
Loading

0 comments on commit 28e0f24

Please sign in to comment.