MERN stack application - final project for The Jetlags.
So you build a slick AF app and you want to use it? There's only one step left. BLAST OFF!
- In your terminal, navigate to the root directory of the Garçon app (for me, that's
/Desktop/garcon) and runnpm ito install all the necessary packages. - Navigate to
/clientand runnpm iagain.
Our database isn't deployed yet, so you need to have the DB set up on your workbench.
- The Express server is configured to run with my workbench settings, which basically means your password to connect to Workbench is "password".
- I can't quite remember how complicated it is to change your workbench password, so if it's easier, you can navigate to the
server.jsfile in the root directory and edit the password value on line 21.
- I can't quite remember how complicated it is to change your workbench password, so if it's easier, you can navigate to the
- To initialize the database, we need to do the following:
- Navigate to
/client/src/dataand you'll find aschema.sqlfile. Run the schema in Workbench (i.e. copy what's in theschema.sqlfile into a blank query page in Workbench and run the code) to set up the database. - In your terminal, navigate to the root directory of the Garçon app (for me that's
/Desktop/garcon/). From here, run:nodemon server.js. This will start the Express server. When that happens, Sequelize will build the tables we need for our database. - If you refresh the window in Workbench, you should see a
garcon_sequelize_dbwhich contains the following tables:
- customers
- inventory
- orders
- reservations
- Navigate to
/client/src/dataand you'll find aseeds.sqlfile. Sow the seeds in Workbench (i.e. copy what's in theseeds.sqlfile into a blank query page in Workbench and run the code) to populate the tables with our dummy data for testing purposes.
- Navigate to
- Navigate to the client directory in your terminal (for me that's
/Desktop/garcon/client) - Run
npm start(this starts the React portion of the app. It might take a while to set up but then it should automatically open the app in your browser).
