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

Link new UI to auth and backend #36

Merged
merged 7 commits into from Dec 20, 2022
Merged

Conversation

fozziethebeat
Copy link
Collaborator

This integrates the recent new landing page and demo grading page with full user authorization and full task fetching & updating.

included in this is use of Chakra-UI components where they make sense. The initial uses are:

  • Icon buttons to simplify the code
  • Updating the custom radio buttons for rating a prompt so that the selected value can be stored
  • The pre-built textarea with some default styling

Later we can adopt more Chakra components as desired while still use tailwindcss

…ary task. This also migrates some pages to properly link up authorization flows. Some cruft is still in
This was linked to issues Dec 19, 2022
@fozziethebeat fozziethebeat added feature New feature or request website labels Dec 19, 2022
@fozziethebeat fozziethebeat requested review from yk and k-nearest-neighbor and removed request for yk December 19, 2022 11:00
…on to make it easier to do email based login. Also adding env variables that work by default with the docker services
Copy link
Collaborator

@k-nearest-neighbor k-nearest-neighbor left a comment

Choose a reason for hiding this comment

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

This looks great.

While I'm still working on getting this fully tested on local. I'm turning in for the night and don't want to hold you up.

I've looked at the code and it all makes sense to me.

Stuff we can work on soon

  • instructions for running local
  • auth workflows

Copy link
Collaborator

@yk yk left a comment

Choose a reason for hiding this comment

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

clear to merge, but I left a few comments / questions.

Also, from what I remember, using process.env directly leads to problems in docker builds, as variables are captured at compile time, not at runtime. Next has a runtime configuration framework here: https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration . I suggest we use that.

Comment on lines +17 to +28
image: postgres
restart: always
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 2s
timeout: 2s
retries: 10
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
image: postgres
restart: always
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 2s
timeout: 2s
retries: 10
extends: db

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 intentionally dropping extends here to improve readability rather than reduce code. I especially wanted to expose the port and user/password details since they're used below.

That for me at least makes it a little easier to see everything happening without having to check another docker compose file.


# This fakes and SMTP email server. User registration emails can be found by going to
# localhost:1080 and opening the emails listed.
maildev:
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the mail server needed just for the custom auth or also for the discord auth workflow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it's just for the custom auth.

I'll enhance the comment in the next PR.

Comment on lines +54 to +59
<button
type="button"
className="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
Log in
</button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

button looks exactly the same as the button above, could this be a component?

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 agree, this was originally from @k-nearest-neighbor. I'm leaving css and component cleanup for later changes.

<button
type="button"
onClick={() => submitResponse(tasks[0])}
className="nline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be inline-flex instead of nline-flex?

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 didn't catch this either in my first review. It probably should be. Will be fixed later.

@fozziethebeat fozziethebeat merged commit 2dbdd92 into main Dec 20, 2022
@fozziethebeat fozziethebeat deleted the web-link-newui-to-backend branch December 20, 2022 08:52
@fozziethebeat
Copy link
Collaborator Author

Agreed on using an env setup that works well with Docker. That's what i'll be exploring in the next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement rate_summary for web Setup styling framework for website
3 participants