Chronic pain log book
- node 16+
- yarn
- Clone the repository either through:
- GitHub Desktop (easiest for beginners)
- Git (if you've used Git before)
- Install Node.js LTS (16+)
- Install Yarn
- Windows
- open PowerShell as Administrator
- go to the directory where you cloned the repository
- enable execution of scripts:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
- install Yarn:
corepack enable
- check that Yarn is installed:
yarn --version
- MacOS
- open the repository in Terminal
- install Yarn:
corepack enable
- check that Yarn is installed:
yarn --version
- Linux
- you know what to do
- Windows
- Install dependencies
- in terminal, open the directory where you cloned the repository
- run
yarn install
- Open the repository in your editor/IDE of choice
- WebStorm
- recommended for not needing to install any plugins and better tooling
- used by Marek
- Visual Studio Code
- recommended for lighter footprint and not needing to sign-up for a JetBrains account
- used by Håvard
- WebStorm
- In terminal, open the directory where you cloned the repository
- Run
yarn dev
- Open http://localhost:3000 with your browser to see the app
- Before committing your changes, run
yarn build
to make sure the app is buildable. The dev server is less restrictive than the production build.
- Review the changes you've made, either through
git status
, via UI in GitHub Desktop or through your editor/IDE - Create a new branch for your new feature
- GitHub Desktop: click the "Current branch" button and select "New branch"
- Git:
git checkout -b <branch-name>
- Commit your changes
- Push your changes to GitHub
Contains all the data related logic of the application. For us, the important parts are:
store/episodes
- contains all the R/W logic for episodes
store/medications
- contains all the R/W logic for medications
store/symptoms
- contains all the R/W logic for symptoms
types.ts
- contains all the types of Epiodes, Medications and Symptoms
- the types aren't really easy to read at the first glance, if needed, try creating a new temporary variable with a specific type and check the autocomplete suggestions
Contains the pages of the app. Each page is a folder with a React component. If you were to create a new page, you also need to register in the router at routes/index.ts
.
Contains so-called dumb components. These are components that are not aware of the state of the app, and are only concerned with rendering the UI. That means that they should only work with data passed to them as props and with their own local state.
Contains so-called smart components. These are components that are aware of the state of the app.
Contains various dumb helper functions and types.
Kind of similar to utils
but solely for React hooks.
Contains config of the theming used by the underlying UI library.