Building an application to order coffee and view its realtime order update using socket.io
Demo Link: Coffee Cafe
Register as a new user or
User Login:
email: [email protected]
password: user_password
Admin Login:
email: [email protected]
password: admin_password
1️⃣ MongoDB
2️⃣ Express
3️⃣ Node
4️⃣ Socket.io
Clone the repository
https://github.com/sureshmangs/Realtime-Coffee-Tracker.git
In the project directory(Realtime-Coffee-Tracker)
npm install
In the root directory, create a .env file, inside the .env file, set the following fields
SECRET = 'xxxxxxxxxxxx express session secret xxxxxxxxxxxx'
MONGODB_URI = 'xxxxxxxxxxxx MongoDB Atlas Key xxxxxxxxxxxx'
To run the application in development mode, in the root dirctory
npm run start-dev
Create a Procfile, inside the Procfile
web: npm run start
In the package.json file, add the following scripts
"scripts": {
"start": "node server.js",
"heroku-postbuild": "npm install"
}
Run the following commands
git init
git add .
git commit -m "Deploy to Heroku"
heroku create <name of the app>
git push heroku master
(window1: user
window2: admin
)