passit-frontend is the angular client for Passit.
We use smart and dumb components with ngrx/store. Read about it here
API and crypto interaction are handled by passit-sdk-js which itself uses libsodium.js.
docker-compose upThe front end is now running on localhost:4200 and the backend docker image is running on localhost:8000
Run any one off commands like docker-compose run --rm web ng to execute them inside the docker container.
You may want to run the client without docker. This is helpful when writing unit tests or for quickly adding packages. If you'd like to do this:
docker-compose up apiyarnyarn start or use any yarn ng command from angular-cli.If you need to run yarn install you'll want to instead run docker-compose build and docker-compose rm -v app to remove the old container.
This is because node_modules are kept in a docker volume.
This is not ideal - if you know how to build node_modules into the container itself instead of a volume please let us know.
Run yarn test to execute the unit tests via Karma.
End-to-end tests are run via Protractor.
We'll run the backend in docker and the frontend without for simplicity. Ensure you run yarn first to install local node modules.
docker-compose up apiyarn startyarn run e2eThe e2e script will use the existing dev server (so you don't have to wait for it to rebuild each time)
We can also run the e2e tests against firefox, by setting the FIREFOX environmental variable to something and we can run them against the web extension
by setting EXTENSION env variable to be something (before testing against the extension you have to build it with build:ext.
We can also run the tests in docker:
docker-compose up -d app selenium-<chrome/firefox>
[docker-compose run app build:ext]
docker-compose run [-e FIREFOX=true] [-e EXTENSION=true] app e2e:docker
We ensure that each describe block can be run in any order.
However each it step inside a block actually must run in order - as to minimize set up time which is time consuming due to expensive crypto functions being used when logging in.
describe blocks do not need to run in order.describe block creates a new user.it statements within a describe block depend on state from previous tests and need to run in order.New users are created in the docker backend with random user names to prevent collisions. This means we don't have to wipe the backend between tests which also saves time (at the expense of this being slightly ugly).
Follow style and design patterns as seen on the ngrx example-app and from angular-cli.
yarn lint
Error and validation can get complex. We have the backend API, js SDK, services, and effects as potential sources of errors. Here are some guidelines:
IPassitSDKError type errors.The web extension works in Firefox and Chrome. It reuses the same angular code but we need to build it differently.
For development:
We'll run this time without docker (though you could use docker). We want to build the app with aot and watch enabled for auto reload. Then we'll run web-ext to launch the code as an extension in Firefox.
docker-compose up -d api) or hosted serviceyarn install (if not done already)yarn run build:ext --watchyarn web-ext run -s dist/ -a dist/This process can be a little slow. You are encouraged to use test driven development or working on the web front end when possible.
Because the app shares the same code, going to routes like /popup actually work fine in the web version. However note when not
running as an extension you won't have access to web extension api's like the browser object.
If you'd like to try the extension in Chrome:
dist/ folder.Autofill code is injected into the page. It must be compiled but the process is currently very awkward.
export from extension/form-fill/form-fill.tsyarn build:autofillOpen an issue if you know a better way. Only plain js strings and js files can be inserted directly into a web page. Ideally webpack should do all this but I'm not sure how to get webpack to output a plain js file (without the module bootstraping) or how to force it to strip out exports. Note the exports must exist so that it can be used in tests.
We don't distribute the firefox extension on the store, because they won't accept angular code - see #15.
So instead we self host, signing it with the web-ext command in CI and creating an update manifest Firefox knows when to update.
src/manifest.jsonvX.X.Xpassit.zip to upload to the chrome webstore.
It is available as an artifact under the build-ext-assets job in the test stage.We use NativeScript for the mobile app. At this time it's not ready to use.
Content type
Image
Digest
Size
207.7 MB
Last updated
almost 8 years ago
docker pull nightcruisetech/passit-frontend