From 51709614a4ab2482a582aad858143299b412192c Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 23 May 2026 22:57:01 -0700 Subject: [PATCH 1/8] docs: Update the README.md file that is on the repo's front page --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/README.md b/README.md index 1f8bbae..ba4cc3e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,23 @@ # The Method A website that allows users to create, optimize, practice behavioral interviews, and apply for jobs all in one place. +- Create new latex based resumes that you can download +- Optimize resumes with key ideas and AI powered feedback +- Pratice inteviews questions that are commonly asked +- Apply to new jobs in your field + +## Features +### Current +- Home page +- Footer page contents +- Website theme switcher +- Basic resume generator + +### Work In Progress +- Login/signup system +- Supabase database system + +### Future +- Hosting website on Vercel ## Tech Stack

Frontend

@@ -11,6 +29,7 @@ A website that allows users to create, optimize, practice behavioral interviews, - Python + FastAPI - PostgreSQL + SQLAlchemy +- Supabase

DevOps

@@ -18,6 +37,58 @@ A website that allows users to create, optimize, practice behavioral interviews, - Docker +

Hosting

+ +- Vercel + +## Project Folder Structure + +```text +the-method/ +├── backend/ +│ ├── Dockerfile +│ ├── main.py +│ ├── models.py +│ ├── requirements.txt +│ ├── resume_analyzer.py +│ ├── database/ +│ │ ├── __init__.py +│ │ ├── engine.py +│ │ └── models.py +│ ├── interview/ +│ │ ├── refresh.py +│ │ └── service.py +│ └── llm/ +│ ├── client.py +│ ├── prompts.py +│ ├── service.py +│ └── test_llm.py +├── frontend/ +│ ├── Dockerfile +│ ├── index.html +│ ├── package.json +│ ├── vite.config.js +│ ├── src/ +│ │ ├── App.jsx +│ │ ├── main.jsx +│ │ ├── components/ +│ │ │ ├── FileUpload.jsx +│ │ │ ├── ResumePreview.jsx +│ │ │ └── ... +│ │ ├── pages/ +│ │ │ ├── HomePage.jsx +│ │ │ ├── FormPage.jsx +│ │ │ └── ... +│ │ └── styles/ +│ │ ├── styles.css +│ │ └── ... +├── docker-compose.yml +├── README.md +└── test-prompts/ + └── test.txt +``` + + ## Deploy the website ### App can be deployed via 4 method(3 with Docker & 1 with npm): - (1), (2), & (3): Testing frontend & backend logic, up to preference: From 2bd358ad664ea3f094622015b10782a1d97166fa Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 23 May 2026 22:59:42 -0700 Subject: [PATCH 2/8] docs: Remake the frontend's README.md The README.md before was just the basic React + Vite template. Now it has more information about the project, how to set up the frontend, and the file structure of the frontend. --- frontend/README.md | 95 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 10 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index d1911c3..30c301c 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,20 +1,95 @@ -# React + Vite +# The Method Frontend -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +This is the frontend for **The Method**, a web application for resume building, AI-powered resume optimization, interview practice, and job search. -Currently, two official plugins are available: +## Overview +- Built with **React** and **Vite** for fast development and hot module reloading. +- Modern, component-based architecture with dedicated pages for each major feature. +- Custom CSS and stylelint for consistent, accessible design. -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +## Folder Structure -## React Compiler +```text +frontend/ +├── Dockerfile +├── index.html +├── package.json +├── vite.config.js +├── src/ +│ ├── App.jsx +│ ├── main.jsx +│ ├── assets/ +│ ├── components/ +│ │ ├── CallToAction.jsx +│ │ ├── ContactEmail.jsx +│ │ ├── FileUpload.jsx +│ │ ├── Footer.jsx +│ │ ├── Form.jsx +│ │ ├── HeroArea.jsx +│ │ ├── HomeStatistics.jsx +│ │ ├── HowItWorks.jsx +│ │ ├── NavBar.jsx +│ │ ├── Privacy.jsx +│ │ ├── RecommendProvr.jsx +│ │ ├── ResumePreview.jsx +│ │ └── Reviews.jsx +│ ├── pages/ +│ │ ├── AboutPage.jsx +│ │ ├── ContactPage.jsx +│ │ ├── DashboardPage.jsx +│ │ ├── DataPage.jsx +│ │ ├── FAQsPage.jsx +│ │ ├── FormPage.jsx +│ │ ├── HomePage.jsx +│ │ ├── LoginPage.jsx +│ │ ├── NewsPage.jsx +│ │ ├── PricingPage.jsx +│ │ ├── PrivacyPolicyPage.jsx +│ │ └── TermsOfServicePage.jsx +│ └── styles/ +│ ├── about-page.css +│ ├── contact-page.css +│ ├── dashboard-page.css +│ ├── data-page.css +│ ├── faq-page.css +│ ├── form-page.css +│ ├── home-page.css +│ ├── login-page.css +│ ├── news-page.css +│ ├── pricing-page.css +│ ├── privacy-policy-page.css +│ ├── styles.css +│ ├── terms-of-service-page.css +│ └── specific-component/ +│ └── resume-template.css +├── public/ +└── ... +``` -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). +## Development -## Expanding the ESLint configuration +### Install dependencies +```bash +npm ci +``` -If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project. +### Run in development mode +```bash +npm run dev +``` +### Linting +- **JSX:** `npm run lint` +- **CSS:** `npm run lint:css` +- **All:** `npm run lint:all` + +## Build for production +```bash +npm run build +``` + +## Docker +This frontend can be built and run using Docker. See the project root README for details. ## Attributions -Upload icons created by Ilham Fitrotul Hayat - Flaticon \ No newline at end of file +Upload icons created by Ilham Fitrotul Hayat - Flaticon \ No newline at end of file From f705f062d3253fc68c2dcb5b81a918a448a1d87e Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 23 May 2026 23:02:43 -0700 Subject: [PATCH 3/8] docs: Add light documetion for each class in models.py This is done so that it is easier for new developers to understand the purpose of each class and how they interact with each other. It also helps to improve the overall readability of the codebase. --- backend/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/models.py b/backend/models.py index 07b83d9..d0ad1fa 100644 --- a/backend/models.py +++ b/backend/models.py @@ -7,10 +7,12 @@ class ResumeRequest(BaseModel): + """Request model for sending a list of messages related to a resume.""" messages: list class Education(BaseModel): + """Represents an education entry in a resume.""" school: str | None = None major: str | None = None gpa: str | None = None @@ -20,6 +22,7 @@ class Education(BaseModel): class Experience(BaseModel): + """Represents a work experience entry in a resume.""" company: str | None = None title: str | None = None location: str | None = None @@ -29,6 +32,7 @@ class Experience(BaseModel): class Project(BaseModel): + """Represents a project entry in a resume.""" name: str | None = None description: str | None = None link: str | None = None @@ -37,23 +41,27 @@ class Project(BaseModel): class Link(BaseModel): + """Represents a link (e.g., LinkedIn, GitHub) in a resume.""" type: str | None = None # linkedin, github, portfolio, other url: str | None = None class Certification(BaseModel): + """Represents a certification in a resume.""" name: str | None = None issuer: str | None = None date: str | None = None class Award(BaseModel): + """Represents an award or honor in a resume.""" name: str | None = None issuer: str | None = None date: str | None = None class Resume(BaseModel): + """Main resume model containing all user information.""" name: str # required phone: str | None = None email: str | None = None @@ -70,20 +78,24 @@ class Resume(BaseModel): class GenerateResumeRequest(BaseModel): + """Request model for generating a resume.""" resume: Resume class OptimizeResumeRequest(BaseModel): + """Request model for optimizing a resume for a job description.""" resume: Resume job_description: str class AnalyzeResumeRequest(BaseModel): + """Request model for analyzing a resume against a job description.""" resume: Resume job_description: str class AnalyzeResumeResponse(BaseModel): + """Response model for resume analysis results.""" score: float confidence: str recommendation: str @@ -99,6 +111,7 @@ class AnalyzeResumeResponse(BaseModel): class CoverLetterRequest(BaseModel): + """Request model for generating a cover letter.""" resume: Resume job_description: str company_name: Optional[str] | None = None @@ -107,6 +120,7 @@ class CoverLetterRequest(BaseModel): class CoverLetterResponse(BaseModel): + """Response model for a generated cover letter.""" cover_letter: str word_count: int suggestions: list[str] | None = None From 6b4ef9e1cda782304bed7d8507b68f52b65619fb Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 23 May 2026 23:15:39 -0700 Subject: [PATCH 4/8] ci: Add CodeQL workflow for JS/TS and Python --- .github/workflows/codeql.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..2d09846 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,32 @@ +name: CodeQL + +on: + pull_request: + branches: [main, dev] + push: + branches: [main, dev] + +permissions: + actions: read + contents: read + security-events: write + +jobs: + analyze: + name: Analyze (javascript-typescript, python) + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: javascript-typescript, python + config-file: ./.github/codeql/codeql-config.yml + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 From 67ffe089222e0897bdafedba2413b4c503bbda76 Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 23 May 2026 23:17:13 -0700 Subject: [PATCH 5/8] ci: Add CodeQL config file for ignore paths --- .github/codeql/codeql-config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/codeql/codeql-config.yml diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..e78bce1 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,14 @@ +# CodeQL config for The Method +# Exclude generated/build/runtime artifact paths and cache folders +paths-ignore: + - '**/node_modules/**' + - '**/dist/**' + - '**/build/**' + - '**/coverage/**' + - '**/logs/**' + - '**/.venv/**' + - '**/__pycache__/**' + - '**/*.min.js' + - '**/.pytest_cache/**' + - '**/.mypy_cache/**' + - '**/.next/**' From 2342bde765f137f97aaf0cd1624cb7980e41ebae Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 23 May 2026 23:44:04 -0700 Subject: [PATCH 6/8] docs/refactor: Update CodeQL docs to remove dev branch references and clarify triggers --- .github/codeql/README.md | 115 +++++++++++++++++++++++++++++++++++ .github/workflows/codeql.yml | 4 +- 2 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 .github/codeql/README.md diff --git a/.github/codeql/README.md b/.github/codeql/README.md new file mode 100644 index 0000000..85de7af --- /dev/null +++ b/.github/codeql/README.md @@ -0,0 +1,115 @@ +# CodeQL Setup for the-method + +This folder contains the CodeQL configuration for security and code quality scanning in this repository. + +## What each file does + +- `.github/workflows/codeql.yml` + - Defines when scans run and how GitHub Actions executes CodeQL for both frontend and backend. +- `.github/codeql/codeql-config.yml` + - Defines which folders to include and ignore during analysis for all supported languages in this repo. + +## CodeQL workflow breakdown (`.github/workflows/codeql.yml`) + +### `name: CodeQL` +The display name in the Actions tab. + +### `on.pull_request.branches` and `on.push.branches` +```yaml +on: + pull_request: + branches: [main] + push: + branches: [main] +``` +Runs scans when PRs target `main`, and when commits are pushed to `main`. + +### `permissions` +```yaml +permissions: + actions: read + contents: read + security-events: write +``` +Uses least-privilege permissions. `security-events: write` is required so CodeQL can upload findings. + +### Language setup (current) +```yaml +with: + languages: javascript-typescript, python +``` +This workflow currently runs analysis for both JavaScript/TypeScript (frontend) and Python (backend). + +### Checkout step +```yaml +with: + fetch-depth: 0 +``` +- `fetch-depth: 0` keeps full git history (safe default for analysis and troubleshooting). + +### Initialize CodeQL +```yaml +uses: github/codeql-action/init@v3 +with: + config-file: ./.github/codeql/codeql-config.yml +``` +Starts the CodeQL engine and loads `.github/codeql/codeql-config.yml`. + +### Analyze +```yaml +uses: github/codeql-action/analyze@v3 +``` +Executes queries and uploads results to GitHub Security. + +## Config breakdown (`.github/codeql/codeql-config.yml`) + +### `paths-ignore` +Generated/build/runtime artifact paths and cache folders are excluded to reduce noise and runtime: + +```yaml +paths-ignore: + - '**/node_modules/**' + - '**/dist/**' + - '**/build/**' + - '**/coverage/**' + - '**/logs/**' + - '**/.venv/**' + - '**/__pycache__/**' + - '**/*.min.js' + - '**/.pytest_cache/**' + - '**/.mypy_cache/**' + - '**/.next/**' +``` + +## Best practices + +1. **Keep trigger scope intentional.** + Use branch filters (`main`) to control cost and noise. +2. **Keep language list explicit.** + CodeQL should only review languages with meaningful source code. +3. **Exclude generated/vendor artifacts.** + Keep caches, dependencies, build outputs, logs, and minified files in `paths-ignore`. +4. **Pin to stable major action versions.** + `@v3` is the current stable major for CodeQL actions. +5. **Review alerts regularly.** + Handle high/critical findings made by the CodeQL bot first and solve with documented reasoning for accepting or rejecting the recommended fix. + +## Maintenance examples +Keeping this updated as code and language coverage evolve is important. Here are common maintenance changes. + +### Keep language scope aligned with this repository +This workflow currently analyzes JavaScript/TypeScript and Python: + +```yaml +with: + languages: javascript-typescript, python +``` + +Only change this value when this repository adds production code in another supported language. + +### Exclude another generated folder +Add a glob to `paths-ignore`, for example: + +```yaml +- '**/generated/**' +``` diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2d09846..ff4cbf2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,9 +2,9 @@ name: CodeQL on: pull_request: - branches: [main, dev] + branches: [main] push: - branches: [main, dev] + branches: [main] permissions: actions: read From 26f3cefea852945d26798576bbcbbbd043178713 Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 30 May 2026 20:30:48 -0700 Subject: [PATCH 7/8] docs: Add documentation touchs up for README.mds and main.py --- README.md | 1 + backend/main.py | 26 +++++++++++++++++++++++--- frontend/README.md | 26 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ba4cc3e..60ec194 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ A website that allows users to create, optimize, practice behavioral interviews, ### Future - Hosting website on Vercel +- Interview prep section ## Tech Stack

Frontend

diff --git a/backend/main.py b/backend/main.py index 4c03307..65f2df9 100644 --- a/backend/main.py +++ b/backend/main.py @@ -48,6 +48,8 @@ async def chat_endpoint(request: ResumeRequest): request (ResumeRequest): The request body containing the user's prompt. Returns: dict: The LLM's response or an error message. + Raises: + HTTPException: If the LLM returns an error response (500). """ # Prepend system prompt to messages @@ -71,6 +73,8 @@ async def generate_resume_endpoint(request: GenerateResumeRequest): request (GenerateResumeRequest): The request body containing the user's prompt. Returns: dict: The LLM's response or an error message. + Raises: + HTTPException: If the resume generation fails (500). """ # extract data from HTTP request @@ -92,9 +96,11 @@ async def optimize_resume_endpoint(request: OptimizeResumeRequest): Optimize resume for ATS according to job description. Args: - request (OptimizeResumeRequest): The request body containing the user's prompt. + request (OptimizeResumeRequest): The request body containing the user's prompt. Returns: - dict: The LLM's response or an error message. + dict: The LLM's response or an error message. + Raises: + HTTPException: If the resume optimization fails (500). """ resume_dict = request.resume.model_dump() @@ -117,6 +123,8 @@ async def analyze_resume_endpoint(request: AnalyzeResumeRequest): request (AnalyzeResumeRequest): The request body containing the user's prompt. Returns: dict: The analysis results or an error message. + Raises: + HTTPException: If the input is invalid (400) or an internal error occurs (500). """ try: @@ -140,9 +148,11 @@ async def generate_cover_letter_endpoint(request: CoverLetterRequest): Generate a cover letter based on resume and job description. Args: - request (OptimizeResumeRequest): The request body containing the user's prompt. + request (CoverLetterRequest): The request body containing the user's prompt. Returns: dict: The generated cover letter or an error message. + Raises: + HTTPException: If the cover letter generation fails (500). """ resume_dict = request.resume.model_dump() @@ -163,6 +173,16 @@ async def generate_cover_letter_endpoint(request: CoverLetterRequest): @app.get("/interview-questions/{company}") def get_interview_questions_endpoint(company: str): + """ + Retrieve interview questions for a specified company. + + Args: + company (str): The name of the company to retrieve interview questions for. + Returns: + dict: The interview questions data for the company, or an error message if not found. + Raises: + HTTPException: If the company is not found or has no data (404). + """ data = get_questions(company) diff --git a/frontend/README.md b/frontend/README.md index 30c301c..6ee67e8 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,3 +1,29 @@ +# Frontend Folder & File Structure + +## Recommended Structure + +The frontend is organized for scalability and maintainability. Follow these guidelines when adding new files or folders: + +- **src/**: Main source code for the frontend React app. + - **components/**: Reusable UI components (e.g., buttons, forms, navbars). Each component should be in its own file, named in PascalCase (e.g., `MyComponent.jsx`). + - **pages/**: Top-level route components representing full pages (e.g., `HomePage.jsx`, `LoginPage.jsx`). + - **assets/**: Static assets such as images, fonts, or icons. + - **styles/**: CSS files for global styles and page/component-specific styles. Use a separate CSS file for each page or major component when possible. + - **specific-component/**: Styles specific to certain components (e.g., `resume-template.css`). +- **public/**: Static files served directly (e.g., `favicon.ico`, `robots.txt`). +- **App.jsx**: Main app component, sets up routing and layout. +- **main.jsx**: Entry point for React, renders the app. + +## Guidelines + +- Use clear, descriptive names for files and folders. +- Keep components small and focused; split into smaller components if needed. +- Place shared logic or hooks in a `hooks/` folder (create if needed). +- Place utility functions in a `utils/` folder (create if needed). +- Keep unrelated code separated by folder. +- Add a README.md to any new major folder to describe its purpose if it grows large. + +This structure helps keep the codebase organized and easy to navigate as the project grows. # The Method Frontend This is the frontend for **The Method**, a web application for resume building, AI-powered resume optimization, interview practice, and job search. From 1be4436dbb03f1930902aed23ec4cac15b1fc8fe Mon Sep 17 00:00:00 2001 From: Sean San Date: Sat, 30 May 2026 21:01:14 -0700 Subject: [PATCH 8/8] refactor: Style models.py using Black --- backend/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/models.py b/backend/models.py index d0ad1fa..00cd6dc 100644 --- a/backend/models.py +++ b/backend/models.py @@ -8,11 +8,13 @@ class ResumeRequest(BaseModel): """Request model for sending a list of messages related to a resume.""" + messages: list class Education(BaseModel): """Represents an education entry in a resume.""" + school: str | None = None major: str | None = None gpa: str | None = None @@ -23,6 +25,7 @@ class Education(BaseModel): class Experience(BaseModel): """Represents a work experience entry in a resume.""" + company: str | None = None title: str | None = None location: str | None = None @@ -33,6 +36,7 @@ class Experience(BaseModel): class Project(BaseModel): """Represents a project entry in a resume.""" + name: str | None = None description: str | None = None link: str | None = None @@ -42,12 +46,14 @@ class Project(BaseModel): class Link(BaseModel): """Represents a link (e.g., LinkedIn, GitHub) in a resume.""" + type: str | None = None # linkedin, github, portfolio, other url: str | None = None class Certification(BaseModel): """Represents a certification in a resume.""" + name: str | None = None issuer: str | None = None date: str | None = None @@ -55,6 +61,7 @@ class Certification(BaseModel): class Award(BaseModel): """Represents an award or honor in a resume.""" + name: str | None = None issuer: str | None = None date: str | None = None @@ -62,6 +69,7 @@ class Award(BaseModel): class Resume(BaseModel): """Main resume model containing all user information.""" + name: str # required phone: str | None = None email: str | None = None @@ -79,23 +87,27 @@ class Resume(BaseModel): class GenerateResumeRequest(BaseModel): """Request model for generating a resume.""" + resume: Resume class OptimizeResumeRequest(BaseModel): """Request model for optimizing a resume for a job description.""" + resume: Resume job_description: str class AnalyzeResumeRequest(BaseModel): """Request model for analyzing a resume against a job description.""" + resume: Resume job_description: str class AnalyzeResumeResponse(BaseModel): """Response model for resume analysis results.""" + score: float confidence: str recommendation: str @@ -112,6 +124,7 @@ class AnalyzeResumeResponse(BaseModel): class CoverLetterRequest(BaseModel): """Request model for generating a cover letter.""" + resume: Resume job_description: str company_name: Optional[str] | None = None @@ -121,6 +134,7 @@ class CoverLetterRequest(BaseModel): class CoverLetterResponse(BaseModel): """Response model for a generated cover letter.""" + cover_letter: str word_count: int suggestions: list[str] | None = None