Cancer Type Directory

Test this app for free
30
import logging
import os
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app
from flask import request, jsonify
from werkzeug.utils import secure_filename

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

# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()

# Image validation constants
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'webp'}
MAX_FILE_SIZE = 5 * 1024 * 1024  # 5MB
MIN_DIMENSIONS = (800, 600)
MAX_DIMENSIONS = (4000, 3000)

def allowed_file(filename):
    return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS

def validate_image_dimensions(file_path):
Get full code

Created: | Last Updated:

A public directory for searching cancer types, displaying images, and summarizing academic research and treatment approaches.

Here's a step-by-step guide for using the Cancer Type Directory template:

Introduction

The Cancer Type Directory template provides a comprehensive web application for searching and displaying information about various cancer types. It includes features such as a searchable directory, detailed cancer information pages, and the latest research findings for each cancer type.

Getting Started

To begin using this template:

  1. Click the "Start with this Template" button in the Lazy Builder interface.

Test the Application

After starting with the template:

  1. Click the "Test" button in the Lazy Builder interface.
  2. Wait for the application to deploy and launch the Lazy CLI.

Using the Cancer Type Directory

Once the application is deployed, you can access and use it as follows:

  1. Open the provided server link in your web browser.
  2. On the home page, you'll see a search bar and a grid of cancer types.
  3. Use the search bar to find specific cancer types by name or description.
  4. Click on a cancer type card to view detailed information about that specific cancer.
  5. On the cancer details page, you can navigate through different tabs:
  6. Overview: General information about the cancer type
  7. Treatment: Treatment options and success rates
  8. Clinical Trials: Information about ongoing clinical trials
  9. Resources: Additional resources for patients and caregivers
  10. Latest Research: Recent research findings and novel approaches

Customizing the Directory

To customize the Cancer Type Directory for your specific needs:

  1. Update the cancer types and their information in the database. You can do this by modifying the SQL migration files in the migrations folder, particularly 002_populate_cancer_types.sql and 004_add_treatment_and_images.sql.

  2. To add or update images for cancer types, use the /api/upload-image endpoint. You can implement a frontend interface for this or use API testing tools. The endpoint accepts image files and validates them before storing.

  3. Customize the appearance by modifying the styles.css file in the static/css directory.

  4. Adjust the layout and content of the pages by editing the HTML templates in the project root directory (home.html and cancer_details.html).

  5. Modify the research fetching logic in research_fetcher.py if you want to change how the latest research is retrieved and processed.

Remember to redeploy your application after making any changes to see them reflected in the live version.

By following these steps, you'll have a fully functional Cancer Type Directory that provides valuable information to users about various cancer types, their treatments, and the latest research findings.



Here are 5 key business benefits for this Cancer Type Directory template:

Template Benefits

  1. Public Health Education: Provides a centralized, accessible resource for the general public to learn about various cancer types, their symptoms, and treatments, potentially improving early detection and health outcomes.

  2. Research Dissemination: Offers a platform for summarizing and sharing the latest cancer research findings, helping bridge the gap between academic studies and public understanding.

  3. Patient Support: Serves as a valuable tool for patients and their families to access reliable information about specific cancer types, treatment options, and clinical trials, empowering them to make informed decisions.

  4. Healthcare Professional Resource: Acts as a quick reference guide for healthcare professionals, especially those in general practice, to stay updated on various cancer types and emerging treatment approaches.

  5. Fundraising and Awareness: Can be used by cancer research organizations and charities to showcase their work, raise awareness about different cancer types, and potentially support fundraising efforts by demonstrating the need for ongoing research and support.

Technologies

Streamline CSS Development with Lazy AI: Automate Styling, Optimize Workflows and More Streamline CSS Development with Lazy AI: Automate Styling, Optimize Workflows and More
Flask Templates from Lazy AI – Boost Web App Development with Bootstrap, HTML, and Free Python Flask Flask Templates from Lazy AI – Boost Web App Development with Bootstrap, HTML, and Free Python Flask
Enhance HTML Development with Lazy AI: Automate Templates, Optimize Workflows and More Enhance HTML Development with Lazy AI: Automate Templates, Optimize Workflows and More
Streamline JavaScript Workflows with Lazy AI: Automate Development, Debugging, API Integration and More  Streamline JavaScript Workflows with Lazy AI: Automate Development, Debugging, API Integration and More

Similar templates

We found some blogs you might like...