Skip to content

codemelonn/senior_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Bias Checker — Full Stack Project

Bias Checker is a full-stack application designed to analyze media text for sentiment, bias, and tone. The system provides both raw analysis results and AI-assisted summaries to help users better understand potential bias patterns in written content.

This repository contains:

  • A React-based frontend for user interaction and visualization
  • A FastAPI backend that performs NLP analysis using multiple models
  • Auto-generated backend documentation built with Sphinx

Example Usage: Example of Full Analysis


🖥️ Frontend — React (Fusion Starter)

The frontend is built using the Fusion Starter React template and provides an interactive dashboard for submitting text, selecting analysis types, and viewing results through charts and summaries.

Setup

Important: Running this project requires two terminal windows:

  • One for the frontend
  • One for the backend

1️⃣ Install Node.js and PNPM

Ensure Node.js is installed and available in your system PATH, then install PNPM:

npm install -g pnpm

2️⃣ Install Dependencies

From the frontend/ directory:

pnpm install

If you receive a warning about ignored build scripts such as:

Ignored build scripts: @swc/core, esbuild

Approve them with:

pnpm approve-builds @swc/core esbuild

If no items are listed, you may safely continue.

3️⃣ Run the Frontend

In Terminal 1, navigate to the frontend directory:

cd frontend
pnpm dev

By default, the frontend runs on port 8080.

To specify a custom port (e.g., if 8080 is in use):

pnpm dev -- --port 5174 --host

Access the application at:


⚙️ Backend — FastAPI Server

The backend handles text processing, model inference, summarization, and API routing. It exposes REST endpoints that the frontend consumes.

Installation

From the backend/ directory:

pip install -r requirements.txt

This installs all required backend dependencies.

Running the Server

In Terminal 2, navigate to the backend directory:

cd backend
uvicorn main:app --reload

Note: The command uvicorn backend.main:app --reload is not supported in this project and may fail due to earlier Docker-related experimentation. Always run the backend from inside the backend/ directory using the command above.

The backend runs on http://127.0.0.1:8000 by default.


🔗 Frontend–Backend Communication

The frontend communicates with the backend through REST API calls.

Example API endpoint:

fetch("http://127.0.0.1:8000/api/analyze")

Ensure the frontend is configured to point to the correct backend port if you change the default.


📘 Backend API Documentation

The backend is fully documented using Sphinx autodoc, which generates HTML documentation directly from Python docstrings in the source code.

Viewing the Documentation Locally

After generating the documentation with Sphinx, open the following file in a web browser:

docs/_build/html/index.html

The documentation includes:

  • Backend modules and functions
  • API endpoint descriptions
  • NLP model execution logic
  • Parameter and return-value details

This documentation is intended to support future maintenance, extension, or handoff of the project.


⚠️ Notes on Generated Files

When running the backend, Python automatically generates a __pycache__/ directory containing compiled bytecode files.

Example:

main.cpython-312.pyc

These files should not be committed to version control. Ensure they are ignored or removed before pushing changes.


🧾 Summary

  • Frontend: React (Fusion Starter) Start with pnpm dev (default port: 8080)

  • Backend: FastAPI (Python) Start with uvicorn backend.main:app --reload (default port: 8000)

  • Documentation: Auto-generated using Sphinx and located in docs/_build/html/


About

Our senior project!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •