-
Suggestion: get rid of unused code
I suggest to turn on
noUnusedParametersandnoUnusedLocals, then cleanup all the instances. -
Suggestion: get rid of
any,asNeed to review usages of
anyandEXPR as TYPE. The latter in most cases can be converted toEXPR : TYPEwhich has stronger guarantes. -
Suggestion: get rid of SWR
The recent PRs start to introduce Recoil. It will replace SWR. Need to be careful not to introduce regressions around cache invalidation.
Also review other data fecthing and see if we can migrate it to Recoil as well (seen some usages of
fetchinuseEffect). -
Suggestion: typed
key-managerAPISuggestion: generate TypeScript API from OpenAPI spec using https://github.com/ajaishankar/openapi-typescript-fetch cc @termina1 can we rely on key-manager having accurate and up to date openapi spec being available?
-
Suggestion: typed BFF API usage
Suggestion: use trpc.io for typed endpoints
-
Suggestion: tagged template strings for SQL
Currently Clickhouse query composition uses template strings but it is easy to introduce SQL injection that way. Using tagged template strings would allow to immediately flag a query as being safe from SQL injections.
-
Suggestion: review
useEffectusageReivew usages of
useEffectand decide if:- we want to keep it as-is
- factor out into a custom hook
- get rid of it
-
Suggestion: project structure is confusing right now
What we can do better:
- Split code into frontend, backend, shared
- Split code better between the landing and the dashboard
- Keep React components code closer to relevant pages
-
Questions: review fetching data from Clickhouse
More specifically
- Why use
convertDataArrayToDatumsinstead of passing data from CH to browser as-is? - Why sort CH results in JS?
- Why use
-
Suggestion: instrument with open tracing
E.g. assign an uniq request id for each user request and pass it through.
The app uses multiple data sources, intrumenting code with open tracing will allow us to learn where the app spends most of the time of and correlate different requests across multiple subsystems for easier debugging.
Last active
January 4, 2023 09:51
-
-
Save andreypopp/5c46c02503ebdbf50a1c10f7293aea31 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@andreypopp
If I did not comment about something -- that means I agree with your action points.
key-managerAPI and Next.js backend, but I think I will need a technical help from you.tagged template strings for SQL? Any specific package?useEffectin some cases with custom hooks.convertDataArrayToDatums, I'm not sure why would we need to move it on the frontend.