before I submitted this I:
- deleted all globally installed
node_modules
- deleted the local project
node_modules
- reinstalled my version of node (see below)
- and then followed the steps below
- I believe the issue you're having is most likely a sqlite3 problem (macOS you're on?)
dependencies:
- node current latest LTS
- I used
v10.15.1
- I used
- sqlite3
- my version:
3.24.0 2018-06-04 14:10:15 95fbac39baaab1c3a84fdfc82ccb7f42398b2e92f18a2a57bce1d4a713cbaapl
- my version:
steps to run:
npm install
(sorry for the delay here, first install is insane now with React/Babel these days)- make sure have sqlite3 installed (if macOS, https://brewformulas.org/sqlite)
npm run db:migrate
npm run db:seed
- (OPTIONAL) TODO generate your own RSA256 private/public key and add to
config/
npm run build:prod
to do webpack thingsnpm run start:dev
- open browser, go to
localhost:9300
- email "user1@doc-pat.co" and password "demo1234"
- logout and test email "user2@doc-pat.co" and same password "demo1234"
- keep incrementing a the user index until you find one that has patients or else it just directs to
/edit-self
- sorry for the delay on this, I have about 6 "take-homes" in my queue right now interviewing all day Monday-Friday (trying to do them in received order)
- things I added outside the scope of the project for better or for worse
- process management hooks
- RSA encryption for JWT so that you can trust data inside and comes with free expiration
- bcrypt hashing for password storage
- some better than normal logging (expermenting with this for personal use as well)
- I used sqlite3 for persistant storage because I wanted to use this to see what's changed from when I've used it on Android
- my react is pretty sloppy but I dove deep into all that's changed with React 16 and made sure to figure out where the static method
getDerivedStateFromProps
comes into play - decided to go with a vanilla sql query in the controller at one point with the join because I was fed up with sequelize at some point doing self joins to make the Doctor/Patient connection
- at least this way, you can super easily have a doctor having a doctor and anyone having more than one doctor
- areas to improve
- cleanup logs
- cleanup swagger responses/errors
- auth checks on updates
- React redux (maybe? meh, I always try and stay as light as possible)
- loading user feedback (animations)
- wire in sequelize relation so no raw queries
- frontend urls are fakes and you can't go back to them if you hit the page directly
- need to add hard refresh mapping at backend level but ideally all this would be static anyway
Sincerely hope not too late on this! Let me know what you think.
Best, Christian