import os
from flask import request
import logging
from flask import Flask, render_template
from gunicorn.app.base import BaseApplication

# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

app = Flask(__name__, static_folder='static')

from flask import render_template

@app.route("/")
def translate_form():
    return render_template("home.html")



@app.route("/search", methods=['POST'])
def search_jobs():
    search_query = request.json.get('query', '')
    import requests

About this template

A customisable one-page job search website with a search bar and a search button that displays UI cards of matching jobs. You need to have a (free) account on https://rapidapi.com/ to get the API key required for this to work.

Introduction to the Job Search Website Template

Welcome to the Job Search Website template guide. This template allows you to create a customizable one-page job search website with a search bar and a search button that displays UI cards of matching jobs. It's designed to be simple to use, even for non-technical builders, and Lazy handles all the deployment for you.

Getting Started

To begin building your job search website, click Start with this Template on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code.

Initial Setup: Adding Environment Secrets

Before you can use the job search functionality, you'll need to set up an environment secret for the API key:

  • Sign up for a free account on RapidAPI.
  • Once you have an account, navigate to the API you wish to use and subscribe to it to obtain your API key.
  • In the Lazy Builder, go to the Environment Secrets tab.
  • Add a new secret with the key RAPIDAPI_KEY and paste the API key you obtained from RapidAPI as the value.

Test: Deploying the App

With your environment secret in place, you're ready to deploy your app. Press the Test button in the Lazy Builder. This will launch the Lazy CLI and begin the deployment process.

Using the App

Once the app is deployed, Lazy will provide you with a dedicated server link. Use this link to access your job search website. You'll see a search bar where you can enter job titles or keywords, and a search button to initiate the search. The results will be displayed as UI cards with job titles and employer names.

Integrating the App

If you wish to integrate this job search functionality into an existing service or frontend, you can use the server link provided by Lazy. Add the link to your service where you want the job search feature to appear. If your service requires API endpoints, you can use the provided link to make requests to your job search app.

Here's a sample request you might make to the job search API:


fetch('YOUR_SERVER_LINK/search', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({ query: 'Software Engineer' })
})
.then(response => response.json())
.then(data => {
    console.log(data);
})
.catch(error => console.error('Error:', error));

And a sample response from the API might look like this:


{
    "jobs": [
        {
            "employer_name": "Tech Corp",
            "job_title": "Senior Software Engineer"
        },
        {
            "employer_name": "Innovatech",
            "job_title": "Junior Software Developer"
        }
    ]
}

Remember, all the steps above are mandatory to run and integrate the template. Follow them carefully to ensure your job search website works correctly. Happy building!

Category
Last published
July 26, 2024

More templates like this

CSS ShadowCraft

A web page for creating and previewing custom CSS box shadow effects in real time.

HTML
CSS

SecureUserAuthenticator

Develop a secure User Authentication system for users to register, log in, and manage their profiles, laying the foundation for user-specific data management and permissions in the CMS.

Laravel
Python
Flask
Javascript

Colorful Portfolio Pro

A modern, colorful, and responsive personal website showcasing software projects, experience, and resume with dummy data.

HTML
CSS
Javascript
Home
/
Job Search Website