Skip to content
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

YKY test runtime and cleanups #79

Merged
merged 21 commits into from
Oct 17, 2023
Merged

YKY test runtime and cleanups #79

merged 21 commits into from
Oct 17, 2023

Conversation

chuck-dbos
Copy link
Collaborator

Use test runtime
Code cleanups on frontend

This still waits for init hooks so that the npx version will run properly (create its database tables).

@chuck-dbos chuck-dbos requested a review from maxdml October 17, 2023 20:25
yky-social/src/init.ts Outdated Show resolved Hide resolved
import { Operations } from "./YKYOperations";

// Initialize Operon.
export const operon = new Operon({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other demos, we read connection info in the migration file via parseConfigFile. Can we do that here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, someone else is going to do all those things, and call us when it is the right time to take migration steps.

(FWIW, parsing the file is a better way to get it wrong. In a real app, the credentials passed in would have escalated privileges to alter the database, compared to the runtime code which has CRUD only.)


```shell
npm run build
npm run dev
POSTGRES_HOST=localhost POSTGRES_PORT=5444 POSTGRES_USERNAME=socialts POSTGRES_PASSWORD=socialts POSTGRES_DATABASE=socialts npm run createschema
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already said we need these env variables. So we probably don't need to repeat it again.
I missed the npm run createschema command because it was hidden behind a long list of envs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was torn, if I do it without the env vars, it isn't something you can cut+paste and have just work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I split the line.

@qianl15
Copy link
Member

qianl15 commented Oct 17, 2023

I followed the instructions and it worked on my local machine. I can log in and post, but S3 upload always fails. Is it because the bucket is not accessible? Seems that we also need to set an env S3_BUCKET_NAME.

@chuck-dbos
Copy link
Collaborator Author

I followed the instructions and it worked on my local machine. I can log in and post, but S3 upload always fails. Is it because the bucket is not accessible? Seems that we also need to set an env S3_BUCKET_NAME.

Another good catch. If your bucket is not called 'yky-social-photos', yes, and it should really be in the app config file.

Copy link
Member

@qianl15 qianl15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on my local machine and it works. It took me a while to realize the CORS setting on the S3 bucket side but otherwise worked smoothly.

@chuck-dbos chuck-dbos merged commit f243b99 into main Oct 17, 2023
1 check passed
@chuck-dbos chuck-dbos deleted the chuck/ykytodos2 branch October 17, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants