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

Building a Job Board Platform with Directus and SolidStart.js #289

Closed
wants to merge 13 commits into from

Conversation

preshenv
Copy link

@preshenv preshenv commented Jul 2, 2024

This is the first draft for issue #186

@phazonoverload phazonoverload linked an issue Jul 8, 2024 that may be closed by this pull request
6 tasks
Copy link
Contributor

@phazonoverload phazonoverload left a 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:

  1. 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.
  2. Whenever mentioning a directory, please wrap the directory name in backticks instead of double quotes.
  3. 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 Show resolved Hide resolved
directus-job-board-platform/index.md Outdated Show resolved Hide resolved
directus-job-board-platform/index.md Outdated Show resolved Hide resolved
Comment on lines 51 to 60
## 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.
Copy link
Contributor

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

Copy link
Author

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 Show resolved Hide resolved
```

## 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:
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Author

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 Show resolved Hide resolved
directus-job-board-platform/index.md Outdated Show resolved Hide resolved
directus-job-board-platform/index.md Outdated Show resolved Hide resolved
@preshenv
Copy link
Author

preshenv commented Jul 9, 2024

Hi @phazonoverload
I have resolved and updated the draft to add ur commit messages.

@phazonoverload
Copy link
Contributor

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!

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.

Building a Job Board Platform with Directus and SolidStart.js
3 participants