-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Building a Job Board Platform with Directus and SolidStart.js #289
Conversation
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.
Good start, but a couple of recurring notes:
- Both the auth and the create/update/delete sections need breaking up. Once you preset a code snippet past a certain size, it's hard for readers to gain understanding from it.
- Whenever mentioning a directory, please wrap the directory name in backticks instead of double quotes.
- Please remove all styling and CSS from this tutorial as it's distracting from the key learnings. This means removing classes from elements where they are only used for styling, and possibly also the whole modal, opting instead for a short page.
directus-job-board-platform/index.md
Outdated
## Creating a New User Role | ||
In your access control settings, create a new role called `Job Applicant`. For the `application` collection, enable `create` and `read` permissions. Use custom rules for the `application` collection to ensure users can only read and update their own applications. Set a filter like: `user -> id Equals $CURRENT_USER.id`. This allows users to view all jobs, create new applications, and view or update only their own applications. | ||
|
||
## Allowing Public Registration | ||
Open the public role, find `directus_users` under system collections, and then open custom permissions for the `create` operation. | ||
1. In field permissions, enable only `first_name`, `last_name`, `email`, and `password` options. If you want users to provide other data at the time of registration, enable the respective field. | ||
2. In field validation, require `first_name`, `last_name`, `email`, and `password` to not be empty. | ||
3. In field presets, set the new user's `role` to the `Job Applicant` role id. | ||
|
||
Give public view access to the `job` collection to allow users to see available jobs even when they are not logged in. Also, ensure the admin role retains full permissions across all collections. |
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.
Please rework this section to use our new user registration endpoint. It must first be enabled in project settings, and then an unauthenticated request can be made to POST /users/register: https://docs.directus.io/reference/authentication.html#register
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.
resolved
directus-job-board-platform/index.md
Outdated
``` | ||
|
||
## Implementing User Authentication | ||
To implement user authentication to grant users access to the application, create a **context**, and inside that folder create an `AuthContext.tsx` file and add the following code: |
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.
create a context
A context... directory?
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.
This whole section needs subheadings focusing on each part of the authentication - register, login, fetching the user, logout, etc. This is too much all at once - break it down for comprehension.
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.
resolved
Co-authored-by: Kevin Lewis <[email protected]>
Co-authored-by: Kevin Lewis <[email protected]>
Co-authored-by: Kevin Lewis <[email protected]>
Co-authored-by: Kevin Lewis <[email protected]>
Co-authored-by: Kevin Lewis <[email protected]>
Co-authored-by: Kevin Lewis <[email protected]>
Hi @phazonoverload |
Thank you for writing this, and we are happy to consider it done in it's current state. My team will schedule it in to be published. This repo is just for authoring/reviewing - the actual piece will be published via a Directus project, so we'll take it from here. I'll close this issue to keep the main branch clean, but this is a acceptance of your work. Could you email us at [email protected] and we'll share what we need to get you paid. Thanks! |
This is the first draft for issue #186