Giter Site home page Giter Site logo

dhruv-tech / ninjachefs Goto Github PK

View Code? Open in Web Editor NEW
79.0 79.0 9.0 10.11 MB

Web application that leverages generative AI to simplify online recipe sharing ๐Ÿง‘โ€๐Ÿณ๐Ÿฝ๏ธ

Home Page: https://go.dhruv.tech/p/ninjachefs

JavaScript 97.94% HTML 1.31% CSS 0.74%
clerk expressjs generative-ai mongodb nodejs reactjs recipe-sharing

ninjachefs's Introduction

ninjachefs's People

Contributors

dhruv-tech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ninjachefs's Issues

External Code Review (twitch.tv/cloudzydev)

General Feedback

  • OUTSTANDING PROJECT
  • I would've given you an interview like 2minutes into checking out this repo

Denormalizing Your Observability Tools

  • So I noticed that in PendingSubmissions you have one row that tracks the current status of a submission
  • The one tidbit of foresight I'd like to give you is that it can be really helpful to be able to look back at the history of all statuses for a submission rather than just the most recent one
  • If you can eat the DB costs, I'd recommend it because it often comes up that you wonder "well when did this submission leave state X and when did it enter state Y"
  • As an added benefit, you can then parallelize parts of the process that are currently sequential because you don't have to worry about losing state / overwriting things - each "stage" gets its own row

image

Add Zod for schema validation

A little improvement suggestion: you could use Zod to validate responses from AI's, this way you won't need to be reimplementing the wheel with custom validation anymore and expected scheme shape will be more apparent from the code.

helpers.isRecipeOutputValid = (output, targetSchema = 'aiAssist') => {
let schemaOptions = {
aiAssist: [
{
prop: "ingredients",
type: Object
},
{
prop: "diet",
type: String
},
{
prop: "allergies",
type: Array
},
{
prop: "intro",
type: String
},
{
prop: "desc",
type: String
},
{
prop: "health_score",
type: Number
},
{
prop: "health_reason",
type: String
},
{
prop: "prompt",
type: String
}
],
userUpdate: [
{
prop: "ingredients",
type: Object
},
{
prop: "diet",
type: String
},
{
prop: "intro",
type: String
},
{
prop: "desc",
type: String
},
{
prop: "name",
type: String
},
{
prop: "cooking_time",
type: Number
},
{
prop: "steps",
type: Array
}
],
insights: [
{
prop: "allergies",
type: Array
},
{
prop: "health_score",
type: Number
},
{
prop: "health_reason",
type: String
}
]
}
try {
let schema = schemaOptions[targetSchema];
for (let schemaItem of schema) {
if (!Object.hasOwn(output, schemaItem.prop)) return false;
else if (!typeof(output[schemaItem.prop]) === schemaItem.type) return false;
else return true;
}
} catch (error) {
console.log("[at helpers.isRecipeOutputValid]: " + error);
return false;
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.