97revenge / gree-menu

Um cardápio de produtos com UI responsiva , CRUD e eventos em html estático. - PROJETO PAUSADO
MIT License
0 stars 0 forks source link

database information #2

Open 97revenge opened 1 year ago

97revenge commented 1 year ago

A conceptual database relationship.

catalog_name would be like the name of each area of ​​a menu , a macro-item such as sweet bread would be in bakery .


CREATE TABLE "catalog" (
  "catalog_name" varchar PRIMARY KEY DEFAULT 'palavra chave de criterios',
  "catalog_init" varchar DEFAULT 'primeiro item do cardápio',
  "catalog_mid" varchar DEFAULT 'segundo item do cardápio',
  "catalog_low" varchar DEFAULT 'terceiro item do cardápio'
);

What should be done

dbdiagram.io

97revenge commented 1 year ago

what we really did

const mongoose = require('mongoose');
const { Schema, model } = require('mongoose');
const { v4: uuidv4 } = require('uuid');

const catalogDB = new Schema({
  catalogName: String,
  catalogInit: String,
  catalogMid: String,
  catalogLow: String,
  id: String // uuid instance
})
const catalog = model('catalog', catalogDB)

the model and the Schema of catalog

Path generator functions and dependency insight .

I'm usually thinking about creating coupled functions but working together, like a car factory.
const generatePath = (req, res) => {
  const directedUrl = (`/`).concat(req)
  return directedUrl
}
generatePath creates path strings for .get() and .post() functions
The most common way to think of the development and production layer

"scripts": { "dev": "nodemon app.js", "main": "node app.js" },