Generate a safety case diagram.
- Install Node.js for your machine (LTS or Current is fine)
- Create a file named
.env
- Contains values that should never be committed to the repository
- Refer to
example.env
as an example. Replace all variables as needed.
- In the terminal
npm install
to download project dependenciesnpm start
in one terminal for the server-side portionnpm run dev
in the another to serve the frontend portion
npm run build
- Compiles the frontend codenpm run dev
- Runs the frontend code in development mode. Autoreloads the browser upon file changes.npm run lint
- Lints the files for consistent code stylesnpm run lint:fix
- Fixes most lint errorsnpm run lint:type
- Type checks the code usingtypescript
npm start
- Runs the server-side portion. Uses port3000
by default.npm test
- Runs the linter, typechecker, then the test suite
- Description: Feature Branch Workflow
- Essentially, create a new branch for every feature/change being implemented.
- Each change should have an opened pull request.
- Each pull request should be reviewed (if available).
- mLab - MongoDB hosting service
- Heroku - Server hosting service
- Netlify - Static-site hosting service
For the instructions below, I'm assuming that you have made an account on these sites.
- mLab
- Create New MongoDB Deployment
- Follow the instructions. Choose whatever provider/price is appropriate. (Free tier available)
- View the created database
- In the Collections tab, create 3
Collections
users
diagrams
diagramNodes
- In the Users tab, create a database user
- This gives read/write access to the database
- Remember the username and password, it's used in the standard MongoDB URI
- It is the
DB_HOST
environment variable
- It is the
- Heroku
- Note: Install the Heroku CLI (https://devcenter.heroku.com/articles/heroku-cli)
- On the dashboard, create a new app
- In the settings tab of the app
- Click: Reveal Config Vars
- Set the
DB_HOST
andTOKEN_SECRET
variables
- In the deploy tab of the app
- Follow the instructions for using the CLI
- Push the application using
git push heroku master
- It should then run automatically
- Netlify
- In the
wepback.prod.js
file, change the server URL to the new Heroku app's URL - Build the application bundle:
npm run build
- Under the sites page, drag-and-drop the
dist
directory that was built onto the site - The site should then be live
- Updates can be uploaded to the same site under the Deploys tab
- In the