WEB application to show recipes made by several chefs.
(This is a project created during the Launchbase Bootcamp of the Rocketseat).
This project was developed using the following technologies:
- Back-end
- NodeJS
- express
- multer
- bcryptjs
- nodemailer
- method-override
- express-session
- connect-pg-simple
- pg
- dotenv
- browser-sync (dev dependency)
- nodemon (dev dependency)
- npm-run-all (dev dependency)
- Front-end
- HTML
- CSS
- Javascript
- nunjucks
$ git clone https://github.com/victorbadaro/foodfy.git
Follow the steps below:
-
Enter the project directory
$ cd foodfy
-
Install all the project dependencies
$ npm install
-
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
-
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:
# SERVER (optional) PORT= # DATABASE DB_USER= DB_PASSWORD= DB_HOST= DB_PORT= DB_DATABASE=foodfy # MAILTRAP MAILTRAP_USER= MAILTRAP_PASSWORD=
-
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 thesrc/config/db.js
file, since the environment variables (.env) only will work running the server. After runningseed.js
file you can return the original code in thesrc/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 });
-
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ó