- Notifications
You must be signed in to change notification settings - Fork0
License
Abha2001/Freemex2.0
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A stock market simulation using Node, Express in the backend and VanillaJs in frontend with EJS templating.
Clone repo and move into the Freemex2.0 directory
install dependencies
npm install
create .env file and fill it up with required values from .env.example
get google client id and client secret fromhttps://console.developers.google.com/
get facebook client id and client secret fromhttps://developers.facebook.com/
add these credentials to .env file
start server
npm start
Go tohttp://localhost:{your PORT}/timer/entry and enter the username and password from your .env file when prompted
Add the timer values
Go tohttp://localhost:{your PORT} and start investing!
Create a Heroku account athttps://signup.heroku.com/login and download the Heroku CLI fromhttps://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up.
Login to Heroku using
heroku login -i
and providing your login credentials.Change directory to the root of the project and define a Procfile, which would include explicit instructions to the start the application once it is deployed. In our case the Procfile would look something like this:
web: npm start
, which executes the commandnode index.js
.Deploy the app using the Heroku CLI tools by executing the following:
heroku create <project-name>git push heroku master
To ensure atleast one instance of the app is running, run
heroku ps:scale web=1
.Configure the environment variables by using
heroku config:set <name of variable>=<value of variable>
.Set up a free MongoDB Atlas account athttps://www.mongodb.com/cloud/atlas and configure the database URL.
To open the app on the browser, run
heroku open
.If there are any errors, they can be inspected using
heroku logs --tail
.