cognovi-ai / the-cdj

The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
https://thecdj.app
3 stars 0 forks source link

Add account configuration. #18

Closed hiyaryan closed 10 months ago

hiyaryan commented 10 months ago

This PR adds the Account page where the user may go to update their personal information, password, and configure their API keys for Chat and Analysis features.

The first commit associated with the PR adds 3 forms to the Account page, the ability to navigate between them, a review page to review their updates before submitting them.

Note that this commit only adds the UI so the forms are not functional.

hiyaryan commented 10 months ago

The last five commits of this PR updates the UI allowing the user to toggle visibility of sensitive data and begins the backend implementation of Account.

Two new GET routes have been created to retrieve user data and config data along /access/:journalId/account that are used to prefill the forms. A new Config model is created to store the model and API key. This Config collection is referenced in the Journal which is required to fetch the account data.

As a result, the seed data has been updated and was used to test that the Config data does indeed fill the Config page of the Account page.

Mutating the account will be done in a later PR. This will involve validations, possibly a different method of state management, among others.