Skip to content

Projeto criado no bootcamp LaunchBase da Rocketseat

Notifications You must be signed in to change notification settings

victorbadaro/foodfy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foodfy


LEIAME.md

Summary


🧾 About

WEB application to show recipes made by several chefs.
(This is a project created during the Launchbase Bootcamp of the Rocketseat).

🚀 Technologies

This project was developed using the following technologies:

  1. Back-end
  2. Front-end

🔽 How to download the project

$ git clone https://github.com/victorbadaro/foodfy.git

💻 How to run the project

Follow the steps below:

  1. Enter the project directory

    $ cd foodfy
  2. Install all the project dependencies

    $ npm install
  3. Open the database.sql file and run all the commands that are in it within your database (Steps: 1, 2, 3 and 4)

    You must have the PostgreSQL database installed on your machine

  4. Fill in the environment variables contained in the .env file found at the project root To have a Mailtrap username and password (Mailtrap is an application used to test the sending of emails from Foodfy app) you need to create an account at https://mailtrap.io/ and within one of your inboxes select the Nodemailer integration as in the image below: image

    # SERVER (optional)
    PORT=
    
    # DATABASE
    DB_USER=
    DB_PASSWORD=
    DB_HOST=
    DB_PORT=
    DB_DATABASE=foodfy
    
    # MAILTRAP
    MAILTRAP_USER=
    MAILTRAP_PASSWORD=
  5. In your terminal run the following command to populate the database:

    $ node seed

    If everything runs correctly, the following message will be displayed on your terminal:

    Database is ready to be used now
    Run one of the following commands on your terminal (without quotes):
    "npm run dev" (if you want to run the app on developer mode)
    "npm start" (if you want to run the app on production mode)

    Warning: specifically to run the seed.js file you must, before you running it, put the database connection data directly in the src/config/db.js file, since the environment variables (.env) only will work running the server. After running seed.js file you can return the original code in the src/config/db.js file:

    const { Pool } = require('pg');
    
    module.exports = new Pool({
        user: process.env.DB_USER,
        password: process.env.DB_PASSWORD,
        host: process.env.DB_HOST,
        port: process.env.DB_PORT,
        database: process.env.DB_DATABASE
    });
  6. Run one of the following commands on your terminal

    To run the project only

    $ npm start
    
    # Your application will be available in http://localhost:3333

    To run the project on developer mode. Running the project this way, the server will automatically restart when any changes are made in the project code and will also update the application pages when any changes are made in its structure or styling

    $ npm run dev
    
    # Your application will be available in http://localhost:3000

✅ Nice! If you followed all the steps above correctly the project will be running locally on you machine already.


Developed with ❤ by Victor Badaró

About

Projeto criado no bootcamp LaunchBase da Rocketseat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published