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 src/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 src/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/]http://localhost:8080/
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>/src/api
Technology:
- Node
- Express
- TypeScript
- JWT based authentication
Auth: Authenticated routes use JWT tokens. Secure routes with RequiresAuthentication
middleware.
Root: <project_root>/src/web
Reusable application layouts are defined in /src/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 /src/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 ./src/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.<CollectionName>.remove({})