Skip to content

The goal of this project is to build an API to manage an online menu.

License

Notifications You must be signed in to change notification settings

WeslleyIvis/Delivery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delivery

A delivery service, also known as a delivery service, is a system that allows consumers to order and receive products or services directly to their homes or locations of choice, rather than physically visiting a store, restaurant or service provider. This business model offers customers convenience, saves time, and is often a convenient option for meeting shopping or dining needs.

image


Start APP

Para concluir este passo é necessario ter o Git instalado na sua maquina

  1. Crie uma pasta para onde ira clonar o repositorio
  2. Pelo terminal entre no diretorio que foi criado
  3. Digite: "git clone https://github.com/WeslleyIvis/Delivery.git"

Ficara assim:

Instalando dependencias

Para concluir este passo é necessario ter NodeJS instalado

  1. Entre no diretorio que principal do "CLONE" por exempo: "RepoClone/Delivery", esteja ciente de estar na diretorio correto
  2. Abra um terminal CMD / Powershell
    • Caso não tenha YARN, utilize NPM
    • Comando: yarn install
    • Comando: npm install
  3. Com a instalação das dependencias, aparecera a pasta "node_modules"

Configurando o DataBase (MongoDB ATLAS)

  1. Crie uma conta no MongoDB ATLAS
    • https://cloud.mongodb.com/v2#/org/648fb544c998c4246b95bfb3/projects
    • Crie um novo projeto
    • Crie o banco: Overview > Create a deployment
    • Plano: M0 FREE > Provider: AWS > Region São Paulo (Se-east-1) > Name: Cluster0
    • Crie um User: Username e uma senha de sua preferencia
    • Finish and close
    • Vá na Aba: Security > Network Acess > +ADD IP ADDRESS > Allow Access From Anywhere > Confirm

  2. Crie um arquivo chama .env
    • Chave ATLAS > Deployment > Database > Connect > Drives > Copy connection string into your application code
    • Crie uma variavel no .env: ATLAS_URI= 'mongodb+srv://example:[email protected]/?retryWrites=true&w=majority'


Front End

  1. Entre no diretorio my-app
  2. Abra o terminal CMD / PowerShell > npm install

Run APP

depois de fazer todos esses passos, agora é possivel rodar o APP

  1. Ligar a API
    • Vá até o diretorio Raiz do Delivery ex: RepoClone/Delivery
    • No terminal: npm start
  2. Ligar o Front
    • No diretorio RepoClone/Delivery/my-app
    • npm start

Para adicionar Dados

  • Adicione diretamente pelo ATLAS
  • Adicione dados com algum APP de Request como Insomnia / Postman
    • http://localhost:3333
    • Portas
      • GET: /project/product > Pega todos os dados
      • POST: /project/product > Cria novos dados
      • DELETE: /project/product/id > Deleta um dado
      • PATCH: /project/product/id > Edita um dado


    • Schema dos Produtos
       const ProductSchema = new mongoose.Schema<ProductTypes>({
          name: {type: String, required: true},
          value: {type: String, required: true},
          category: {type: String, required: true},
          image: {type: String, required: false}
      })
      

About

The goal of this project is to build an API to manage an online menu.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published