đ§âđŤ Job board with Xano
801
In this use case walkthrough, we use two templates to get started quickly:
- WeWebâs âJob Boardâ template for the frontend, and
- Xanoâs âCareersâ template for the backend.
Table of contents:
- Setup your project in Xano and WeWeb
- Display a list of jobs in WeWeb
- Filter a list of jobs in WeWeb (with a select and a search)
- Redirect user to a job description page in WeWeb
- Allow users to upload their resume and apply to a job in WeWeb
- Update your Xano database with a userâs job application
- Add Xano authentication
- Link job applications to authenticated users
Alright, letâs get started!
You can follow a video walkthrough here or read a step-by-step guide below:
1- Setup new projects in Xano and WeWeb
In Xano
- Create a free XANO account and choose the âCareersâ template in the Marketplace
Youâll notice 3 tables and 16 API endpoints are created automatically:
The 3 tables â job, application, and category â is where youâll find your list of jobs, applications, and job categories respectively.
The 16 API endpoints are how youâll be able to fetch data from your Xano tables to display it in WeWeb.
If youâre not familiar with APIs, you might want to pause and learn more here.
In WeWeb
In WeWeb, create a new project and choose the âJob boardâ template.
Youâll notice a page where you can add your list of jobs and a page where you can display the details of a job offer:
2- Display a list of jobs in WeWeb
In order to display data in WeWeb, we first need to get data from XANO.
Create âAll Jobsâ collection in WeWeb
- Create a new REST API data source in WeWeb
- Set the collection type to dynamic so the list of jobs is updated dynamically in your web-app
- Copy the GET url that fetches the list of jobs in the âjobâ table from Xano, i.e. âquery all job recordsâ, and paste it in WeWeb
- Type in âitemsâ as the result key. Note that this is specific to how Xano returns the data. Other APIs may require a different result key.
To find the API url in Xano, go to your API endpoints:
This is what your API call should look like in WeWeb:
The URL will be different from the screenshot since youâll be getting data from your own Xano database, but the rest should look the same đ
On the âJobsâ page, bind the âCollection Listâ of jobs to the âAll Jobsâ collection
You will notice that, once you bind your collection, even if you only have one Job container in the navigator, youâll have as many repeated items on the page as there are items in your Xano database.
Inside the âJob containerâ, i.e. the first child element of the container where you bound the collection, you can then bind the information from a repeated item.
In the example below, we bound the job title and type of contract.
We also deleted the information we didnât need from our template.
3- Search, sort & filter a list of jobs in WeWeb
When you have a list of items on a page, it is common to let users filter that list by searching for a term or selecting an option for example.
Searching through a list in WeWeb
There is a search bar element by default on the âJobsâ page of the âJob boardâ template in WeWeb.
However, if you ever needed to add a search, know that you can find it in the âAddâ menu of the editor:
Whenever a search bar element is dragged and dropped onto the page, a new component variable is created in your project.
By default, it is named âSearch bar - valueâ but you can change the name in the elementâs settings. You can also change the placeholder of the element in its settings:
In preview mode, you can type in search terms in the search bar to see the âSearch bar - valueâ variable change in your navigator:
Once youâve set up the search bar element on the page, youâll need to add a filter to your list of jobs.
You could do this several ways.
If you were working with a large collection of items, say more than 10Mb, the best practice would be to add a search filter to your backend so that the REST API collection in WeWeb only fetched data that matches the search criteria.
This takes a little bit more time, usually a couple of seconds, but has two main benefits:
- You can choose what data you load in your userâs browser (hint: nothing sensitive!)
- You donât load as much data in your userâs browser and therefore donât risk crashing it.
For the purposes of this tutorial, since WeWeb is a frontend builder, weâll explain how to add a search filter to your frontend but please bear in mind that, if youâre working with large collections, you should spend a little more time learning how to add a search filter in your backend.
To search in the frontend in WeWeb:
- Add a filter to your Collection List,
- Where the field you want to search âContainsâ the âSearch bar - valueâ component variable, and
- Apply this filter if⌠the âSearch bar - valueâ component variable is not empty.
In the example below, we are filtering the jobs list based on whether the search term is in the title or summary of the job description:
Filtering a list with a select dropdown element
Now letâs say you also want to filter the job list by job category.
First, youâll want to create a new collection for job categories in WeWeb, using the API endpoint to query all categories from Xano.
Not sure how to do that? Might want to revisit how we created the âAll jobsâ collection above đ
Once you have your âCategoriesâ collection setup in WeWeb, youâll want to drag and drop the âSelectâ element on the page. As with the search bar element, this will automatically create a component variable in the navigator, named âdropdown - value.â
In the screenshot below, you can see that:
- On the select element,
- We bound the âCategoriesâ collection
- Set the display field to <category> (e.g. âSoftware Developmentâ, âMarketingâ, etc.)
- Set the value field to <id>
Since we selected âSoftware Developmentâ in our select dropdown element, the âdropdown - valueâ variable is 3 which matches the data we have in our âCategoryâ table in Xano.
Now, to filter your list of jobs based on the job category selected in the dropdown, all you need to do is add a filter to your existing Collection List where the âcategoryâ field of the job contains the âdropdown - valueâ variable.
When the user lands on the page, before they select anything, we donât want the filter to apply, so we can add a condition to the condition group, i.e. Apply if⌠the âdropdown - valueâ variable is empty.
4- Redirect a user to a job description page in WeWeb
Ok great. We have a page with a list of job offers.
Now we want to let users access individual job pages.
There are several ways we could do this in terms of user interface.
Letâs do it in the most obvious way by creating a button that users can click on to learn more about a specific job.
Step 1 â Add a button
In the âAddâ menu, search for the âButtonâ element, drag and drop it in your repeated item container.
Step 2 â Create a variable
In order to give more information to the user about the job they click on, we first need to create a variable that contains the information.
To do that, you can add a variable of Object type called âselectedJobâ and save it to local storage. This means that the variable will be saved in the userâs browser.
Once you have this âselectedJobâ variable, youâll want to create a workflow that updates the variable with the current item information and goes to the âJob templateâ page.
Step 3 â Create a workflow on the button
- Name: Go to job page
- Trigger: On click
- Action 1: Update the âselectedJobâ with the <item.data> in quick access
- Action 2: Change page, go to the âJob templateâ page
Step 4 â Display the job data on the template page
Once youâre on the template page, you can bind fields as you would on any other page, finding the data you need in the âselectedJobâ variable.
5 â Allow users to upload their resume and apply to a job through your WeWeb application
Our web application wouldnât be complete without the option for users to create, update, or delete a record.
For our use case, we want to let users upload their resume and apply to a job by submitting a form on our WeWeb app.
By default, on the âJob templateâ page of the âJob boardâ template, there is a Contact form container with 4 component variables:
- User name
- User email
- User location
- User bio
You can see these component variables when you open the âVariablesâ sub-menu of the âNavigatorâ menu, see green arrows below:
To allow users to upload a resume, weâll drag and drop a âFile uploadâ element inside our form container:
Youâll notice that, as soon as you drop the element on the page, two new component variables are created by default:
- âFile 1 - progressâ, and
- âFile 1 - valueâ
Both these variable names will change if you change the file upload elementâs name:
You can test this in Preview mode by typing in data and uploading a file as if you were a user.
Youâll notice the value of the component variables in the navigator are updated in real time:
6 â Update your Xano database with the userâs job application
By default, the âresumeâ field in Xanoâs âapplicationâ table is a âfile resource.â
However, in WeWeb, when a user uploads a file, we upload it to our CDN and the value of the file is a URL, i.e. a âtextâ field.
Before we show you how to send data from WeWeb to Xano, you therefore need to change the type of the âresumeâ field in Xano so itâs a âtextâ type:
Then, to update your Xano database with the userâs job application, follow these steps:
- Create a workflow on the form container
- Name: âSend Job Applicationâ, or anything you find more descriptive
- Trigger: On Submit, i.e. when the user submits the form
- Action 1:
- Choose an action: Upload file
- Select upload element from this page: select the component variable you setup
- Test Action 1 before moving on to Action 2
This is very important because you will need the result of Action 1 to set up Action 2.
- Action 2:
- Choose an action: Api Request, note that you will only have this option if you already set up REST API as a data source
- Method: POST, because we will be posting data to Xano
- URL: paste the Xano endpoint that allows you to add an application record
- Fields: for each column in the Xano âapplicationâ table, bind the corresponding value in WeWeb
What does this mean?
It means that, in Xano, you have 6 columns with data. The keys for these columns are as follows:
- job id,
- name,
- resume,
- email,
- phone, and
- status.
In WeWeb, you have a corresponding variable for each key:
Once thatâs done, you can test Action 2, refresh the âapplicationâ table in Xano and jump with joy when the test application comes through đ
7 â Add Xano authentication
Letâs say you want to force users to authenticate themselves before they can apply to a job.
In order to do that, youâll need to:
- Add a user table to your Xano database
- Add authentication endpoints to Xano
- Set up Xano authentication plugin in WeWeb
- Prevent users who are not authenticated from applying to a job (create login page and gate content)
A- Setup a User Table in Your Xano Database
By default, there is no user table in Xanoâs âCareersâ template but you can easily add one.
Got to âDatabaseâ > âAdd Tableâ in the top right corner.
Your user table should include at least two fields:
- One field where you store the login. For example, an email field type, and
- One field of type âpasswordâ where you store the encrypted password.
â ď¸ Itâs important that you choose the field type âpasswordâ when creating your user table in Xano. ď¸ď¸â ď¸
This will ensure that:
- you can use Xanoâs authentication API points, and that
- the user input is encrypted when the user first creates an account with your web-app.
B- Create Authentication API Endpoints in Xano
For Xano authentication to work, you need three API endpoints:
- signup
- login
- me
If youâre using Xanoâs âCareersâ template, youâll need to create these three endpoints yourself by going to âAPIâ > âAdd API Endpointâ > âAuthenticationâ
C- Copy Xano Authentication Endpoints Into WeWeb
In WeWeb, youâll need to add the âXano Authâ plugin and copy/paste the URL of each Xano API endpoint:
ď¸ď¸â ď¸ Warning: the order in which endpoints are displayed in Xano may vary. Make sure to copy the correct URL in each WeWeb ď¸ď¸â ď¸
D- Ask Users to Login Before They Apply to a Job
There are several ways you could do this.
You could trigger a popup that requires users to signup or login when they click on an âApply to jobâ button.
For the purposes of this tutorial, weâll simply show you how to redirect unauthenticated users to a signup page.
- Create a new blank page
- Name it âSignupâ
- Drag and drop the âSignupâ element on the page
- Add a âChange pageâ step to the workflow so the user is redirected to the âJobsâ page after signing up
- In the Xano Auth plugin, redirect users who are not signed in to the âSignupâ page you just created
8 â Link an Application Form Submission in WeWeb to a User in Xano
Now that you have a user table in addition to the application table that comes with Xanoâs âCareersâ template by default, you can link the two.
In the âapplicationâ table, add a âuser_idâ Table Reference field that refers to the user:
In WeWeb, change the API call when the user submits a job application in order to add the user_id to the application POST request:
Whatâs happening here?
Instead of binding an âemailâ field to the userâs email input in the application form, you are binding a âuser_idâ field to the âidâ of the authenticated user.
Xano will recognize the userâs id and populate the âuser_idâ field with that userâs email in the âapplicationâ table.
There you go!
Go into Preview mode in WeWeb > Signup > Select a Job > Submit an application
After refreshing the âapplicationâ table in Xano, you should see your job application đ