Install Redis 7
Install Postgres 9.x+ (12.x+ preferred)
Then, from the project directory...
-
Install the Azure CLI. Ask a tech team member to set up an Azure account for you and provide the credentials. Then, navigate to the Azure Portal and follow the instructions that appear to change your password and set up MFA for your account. Finally, run
az login. -
Ask one of the tech team members to add your IP address to the allow list of the firewall of the Postgres Database.
npm i ; cd server/ && npm i && cd .. ; cd client/ && npm i && cd ..For development, run
ENVIRONMENT=DEVELOPMENT npm run dev
# Or: BROWSER=none ENVIRONMENT=DEVELOPMENT npm run devto build and run both the server and the client.
Then visit http://localhost:3000 to test this app (this is the client's dev server)
- The homepage will be the Digital Safe's login/account creation page
Or, visit http://localhost:2999 (the server's dev server) to see how this app will look and behave in production
- Run Kutt locally by putting a
.envfile we give into yourkuttdirectory, then runningsudo docker-compose up -d- Kutt should now be running on http://localhost:3001
- The homepage will be the Kutt homepage (which our server proxies through to), a working URL shortener site we are pretending to be
- You will need to obtain a temporary URL from a test chat bot in order to log into your Digital Safe
- Server headers are set correctly (because we're not proxying through the client's dev server to
server.ts) - Rate-limiting middleware will work, unlike when visiting the client's dev server, also due to the proxying setup
To test a production build (by building and running just the server), but using DEVELOPMENT resources (e.g., Redis), run
npm run build-prod && ENVIRONMENT=DEVELOPMENT node server/dist/server.jsTo run a production build elsewhere, run the same command but with
ENVIRONMENT equal to TEST_SERVER, STAGING, or PRODUCTION,
depending on where you're running the Digital Safe.
-
ENVIRONMENT(required)- Use
ENVIRONMENT=DEVELOPMENT,ENVIRONMENT=TEST_SERVER,ENVIRONMENT=STAGING, orENVIRONMENT=PRODUCTION
- Use
-
KUTT_URL(optional)- This is to manually override the default Kutt URL to proxy to, which is...
https://old.tinylink.me/whenENVIRONMENT=DEVELOPMENThttp://localhost:3001/whenENVIRONMENT=PRODUCTION
- Useful for using development resources but wanting to do a production build, for example on a test server
- This is to manually override the default Kutt URL to proxy to, which is...
-
BROWSER(optional; only relevant during dev)- If you are annoyed that the dev server keeps opening your browser to the same URL over and over again, use
BROWSER=none
- If you are annoyed that the dev server keeps opening your browser to the same URL over and over again, use
Use npx mocha qaAutomationTests/tests/createSafeTestCases.js --browser Chrome --machine (windows/mac/ubuntu) in your terminal to run the testcase locally
To use Mocha Test Explorer-
- Save the changes and complie the test file if you add any new changes
- click on flask icon in activiy bar
- Refresh clicking on 'refresh' icon
- Expand the test suite, you can either run all the cases at once or a specific test case clicking on 'run' icon