Project brief for reference.
Here, application refers to an insurance application, where app refers to the folder in the project.
Getting setup with the project.
git clone git@github.com:danbowles/fullstack_nodejs.git
cd ~/fullstack_nodejs
docker-compose up -d
Once Docker has started our container, run:
psql -h localhost -U postgres application_dev -f ./database_schema.sql
When Prompted, input postgres as the password for the user.
For each, it is just two commands. First, the API:
cd api
npm i
npm run dev
[nodemon] 3.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts
[nodemon] starting `tsc && node dist/index.js`
🚀 Server running: http://localhost:3000
cd ../app
npm i
npm run dev
VITE v5.0.10 ready in 329 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
In the browser of your choice, head to:
http://localhost:5173
(the port may be different, check the VITE output when starting the app)
Once the form is filled out, hit Create Application. If the input is valid, you will be given a link to add more information.
This link may be used to continue an application in the future.
After successful creation, applications are in a 'new' state and must be updated prior to validation. This is assumed business logic that can easily be removed.
Once an application is updated, you may validate it. After validation, you are given a quote. If validation is attempted again, you will be given an error as your application is already valid.
Subsequent updates to the application after validation will mark the application as incomplete and require validation.
While the desire to have a fully-typed (strictly) implementation would be preferred, the time was a limiting factor. Given the time, a fully-typed API and app implementation would have been delivered.
The Schema exists to support more applicants for an application. Again, time was a limiting factor here. The implementation would be much similar to that of the adding/removing of vehicles. One difference, however, would be the use of a reducer or multiple reducers to more easily refactor the state management out of the component and into some custom hooks.