WebSolution Finder

 import logging
from fastapi import FastAPI, Form, Request
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
# Removed WebFetcher import as it's no longer needed with the new Google CSE integration
import uvicorn
from typing import List
from abilities import llm_prompt

app = FastAPI()
templates = Jinja2Templates(directory="templates")

# Removed SolutionFinder class as it's no longer needed with the new Google CSE integration

import json
@app.get("/", response_class=HTMLResponse)
async def read_index(request: Request):
    return templates.TemplateResponse("index.html", {"request": request})

@app.get("/solutions", response_class=HTMLResponse)
async def solutions(request: Request):
    solutions = request.app.state.solutions

About this template

WebSolution Finder: A web app that uses google to generate a curated list of websites that can help solve specific problems or situations.

Introduction to the WebSolution Finder Template

Welcome to the WebSolution Finder template! This template is designed to help you build a web application that uses FastAPI to serve a list of potential solutions for various problems or issues. The app integrates with Google Custom Search Engine (CSE) to provide a search interface and displays the results in a simple web page. Whether you're looking to create a resource for troubleshooting or a curated list of helpful links, this template will get you started quickly and efficiently.

Getting Started with the Template

To begin using the WebSolution Finder template, simply click on "Start with this Template" in the Lazy builder interface. This will pre-populate the code in the Lazy Builder, so you won't need to copy, paste, or delete any code manually.

Test: Deploying the App

Once you have started with the template, the next step is to deploy the app to see it in action. Press the "Test" button in the Lazy builder interface. This will initiate the deployment process and launch the Lazy CLI. If the template requires any user input, you will be prompted to provide it through the Lazy CLI after pressing the "Test" button.

Using the App

After deploying the app, you will be provided with a dedicated server link to access the web interface. The main page will feature a Google CSE search box where you can enter queries. The results will be displayed on a separate page, listing potential solutions with links to more information.

If the app uses FastAPI, which it does in this case, you will also be provided with a link to the FastAPI documentation. This can be useful if you want to understand more about how the API works or if you plan to extend the functionality of the app.

Integrating the App

If you wish to integrate the WebSolution Finder app into another service or frontend, you will need to use the server link provided by Lazy. This link can be added to external tools that support web integrations. For example, you might add the link to a company intranet page, allowing employees to access the solution finder directly from there.

Remember, the Lazy platform handles all the deployment details, so you don't need to worry about setting up environments or installing libraries. Just focus on how you want to use the app and integrate it with other tools or services as needed.

If you encounter any issues or have questions about integrating the app, refer to the provided documentation links or reach out for support through the Lazy platform.

Happy building with the WebSolution Finder template!

Last published
June 15, 2024

More templates like this

PDF Data Extraction and Excel Transfer

An app for extracting name, phone number, and email data from PDF files and transferring it to Excel.


GPT-4 Exam Generator

This app uses GPT-4 to generate a PDF of a new exam based on an uploaded PDF of a past exam.


Job Search Website

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.

React JS
WebSolution Finder