From the root of the project directory run:
docker compose --env-file ./.env.development --file docker-compose.dev.yaml up --build
From the root of the project directory run:
cd signing-authority/api/
npm run start
By default, this will bring up an instance of the API server on port 3000. The API server will automatically reload on save.
Note: changes to .env variables require a shutdown and restart to server to take effect.
From the root of the project directory run:
cd signing-authority/web/
npm run start
By default, this will bring up an instance of the front end server on port 8080.
Note: changes to .env variables require a shutdown and restart to server to take effect.
To confirm the environment is working properly, navigate to: [http://localhost:8080/administration]http://localhost:8080/administration
Stand up a version of the app using prebuilt images:
docker compose --env-file ./.env.development --file docker-compose.dev.yaml up --build
The production environment builds and deploys two containers, a Mongo database server and a front end Node/Express app which serves the front end and the api services. For persistent storage, a docker volume is created as part of the process. One the build process is complete and the containers are deployed you can reach the app at https://:3000/public
docker compose --env-file ./.env.production up -d --build
To stop the container run but leave the database storage volume intact, run:
docker compose --env-file ./.env.production down
To stop the container and remove the database storage volume run:
docker compose --env-file ./.env.production down -v
Single project that builds into two containers.
Root: <project_root>/api
Technology:
- Node
- Express
- TypeScript
- JWT based authentication
Auth: Authenticated routes use JWT tokens. Secure routes with RequiresAuthentication
middleware.
Root: <project_root>/web
Reusable application layouts are defined in /web/src/layouts. Modules must embed their views and components in a layout
Each logical section of the appplication is broken into modules. Modules are defined in /web/src/modules.
Modules contain all the Vue code needed for the modules including:
- store (vuex)
- routes (vue-router)
- componenents
- views
Authenication is done with JWTs. It is handled by a plugin defined in ./web/src/auth/auth0-plugin.js. The first time the application loads it will atempt to silently log the user in via getTokenSilently()
. If that fails, the users will be redirected to a login process. Note: it can take up to 30 seconds to complete the authentication process.
Authentication information is available anywhere in the Vue frontend via a call to this.$auth
.
$auth.user
- returns information about the currently logged in user
$auth.isAuthenticated
- returns true if the user is authenticated
User can authenticate using their corporate account. This is handed via federation in the backend authentication configuration.
docker exec -it <docker_container_name> bash
use authorities
show collections
db.runCommand({count: 'PositionGroups'})
db.PositionGroups.remove({})
db.runCommand({count: 'Authorities'})
db.Authorities.remove({})
db.runCommand({count: 'FormA'})
db.FormA.remove({})
db.runCommand({count: 'SAA-FILES.chunks'})
db['SAA-FILES.chunks'].remove({})
db.runCommand({count: 'SAA-FILES.files'})
db['SAA-FILES.files'].remove({})
Upgrade MongoDB docker image from version tag mongo:5.0.6
to mongo:6.0
Database server should start just fine and run no problem.
Exec into running MongoDB container and open mongosh to move compatibitlity version from 5 to 6
docker exec -it <docker_container_name> bash
mongosh --username admin
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
Upgrade MongoDB docker image from version tag mongo:6.0
to mongo:7.0
Database server should start just fine and run no problem.
Exec into running MongoDB container and open mongosh to move compatibitlity version from 6 to 7
docker exec -it <docker_container_name> bash
mongosh --username admin
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
db.adminCommand( { setFeatureCompatibilityVersion: "7.0", confirm: true } )