This application is fake. It is meant to mimic an app that can be found in our codebase, but it is not real working code. Do not try to actually perform development with the instructions below.
To run the app locally, from this directory, run the following:
./pnpm i
which installs dependencies locally. Wait until this is finished../pnpm run dev
which starts the local dev server and watches server and client files using nodemon. Note that client file changes requires refresh browser. Alternatively, you can run./pnpm run dev:hotreload
to only watch client file changes and do hotreloading.
To prevent excessive usage of relative directory lookups we use module alias. You need to configure it in three places:
tsconfig.json
: This helps VSCode's IntelliSence to resolve file lookup, and typechecking in source code.test/tsconfig.json
: This helps VSCode's IntelliSence to resolve file lookup, and typechecking in test code.jest.config.js
: This helps jest to resolve module.webpack.config.js
: This help for building app.
We use component name as file name instead of index
to reduce development confusions. index.ts
is only used for exporting to avoid 'component/component' directory lookup. Test are set to ignore any index.ts
files so we don't waste effort to test trivia files. You can use this pattern to skip test coverages too, like server/index.ts
and server/app/intex.ts
since they almost are just using middlewares.
- Try to use
@/
alias to import as often as possible. Relative path should only be used within the same component. - For
api
andtypes
, we want to enforce a single source for all imports. So when using them incomponents
, they should always come from@/api
and@/types
.