Website for sharing meals together. Invite your best friends or your family for dinner!
This project is an exercise for HackYourFuture students to learn the concepts of full stack development with a focus on the connection between:
Database <--> Webserver <--> Frontend
The homework for week4 should be made in a standalone repo on your github profile, so you can show it friends/new employeers/headhunters etc.
Here are the steps to do that:
- Create a new repository on your github profile.
- Clone that repository down locally.
- Copy the code for the template from the this folder into the newly created repo.
- Now copy last weeks
server
folder into the new repo in thesrc
folder. You will now have aserver
folder and aclient
folder in thesrc
folder. - Uncomment the lines that is for week4!
- Add, commit and push the changes to your github.
- In the
hyf-homework/node/week4
just add a text file with the link to the newly created repo. - Thats it 🎉
To access the server api, use localhost:3000/api
The traffic is being redirected (proxied) from localhiost:5000
where the server is running to localhost:3000/api
. You can see that in the webpack.config.js
file line 41.
All sensitive data like fx passwords and usernames, we dont want to add to git! This problem we solve by having environment variables. Environment variables are not committed to git and have a key value structure.
In the project there is a file called .env.example
that has the correct structure. Copy this file and rename the copied file to .env
. Now edit the credentials for your database.
The environment variables are then used in node using process.env.DB_HOST
, you can see that in the src/serverdatabase.js
file.
- Postman
- MySQL Workbench
- A heroku user
To install run npm install
To run npm run dev
Set Heroku with automated builds to the master branch. push your code to the master
branch.
- @benna100 - Idea & Initial work