-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed root nodejs clutter, migrated to sha256, justfile commands #95
Conversation
This PR aims to simplify and clean the repo, decentralise js repos, migrate to SHA256 for hashing as discussed! todo: just migrate doesn't work unless db url provided directly via string!
This PR is being deployed to Railway 🚅 portal-frontend: ◻️ REMOVED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a couple questions that may be addressed in future iterations of this.
cd ./web-portal/backend && pnpm install && pnpm start | ||
build-backend: | ||
cd ./web-portal/frontend && pnpm install && pnpm build | ||
serve-backend: | ||
cd ./web-portal/backend && pnpm install && pnpm start:prod | ||
|
||
|
||
dev-frontend: | ||
cd ./web-portal/frontend && pnpm install && pnpm dev | ||
build-frontend: | ||
cd ./web-portal/frontend && pnpm install && pnpm build | ||
serve-frontend: | ||
cd ./web-portal/frontend && pnpm install && pnpm start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you put a justfile in the subdirectory you can do @just web-portal/build
to define the actions closer to the code and avoid the cd. This is fine though. It might be good to bundle all the builds into a build-all
or just build
.
@@ -1,13 +1,26 @@ | |||
default: | |||
@just --list | |||
|
|||
build: | |||
@just gateway/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing this disconnects the gateway from the top level
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
output = "../../.generated/client" | ||
output = "../../web-portal/backend/.generated/client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the idea to use a shared volume not pan out?
async createAuthKey(tenantId: string): Promise<any> { | ||
const secretKey = 'sk_' + randomBytes(39).toString('hex'); // <-- TODO: figure out final key format | ||
|
||
const hashedKey = await bcrypt.hash(secretKey, this.salt); | ||
const hashedKey = createHash('sha256').update(secretKey).digest('hex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
This PR aims to simplify and clean the repo, decentralise js repos, migrate to SHA256 for hashing as discussed!
todo: just migrate doesn't work unless db url provided directly via string!
todo: make session more stable; next cookies not working best!!!