Spaces:
Build error
Build error
File size: 4,418 Bytes
1bc2d2d 57303cc 1bc2d2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | ---
title: Matching Tool
emoji: π
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
---
# Staffinc Client-Fit Matching & Briefing Tool MVP
This is a full-stack monorepo MVP built to optimize Staffinc's recruitment funnel and B2B client conversion rate.
## π Problem Context
Staffinc candidates pass internal recruiter screenings but historically face a low client-stage interview acceptance rate of **~25% (1 out of 4)**. Rejection reasons are typically subjective (e.g., "didn't show up well," "communication vibe mismatch").
This B2B tool:
1. **Profiles Clients by Vibe**: Standardizes expectations into "Consulting/Corporate" or "Startup/Scrappy" archetypes with minimum competency thresholds (using the Behavioral Anchored Rating Scale, BARS).
2. **Standardizes Vetting**: Recruiters score candidates (1-5) against these specific client thresholds with live behavioral guidance to remove subjectivity.
3. **Automates Coaching Briefs**: Instantly generates a printable candidate prep guide mapping gaps, practice questions, and tailored coaching tips.
4. **Logs Outcomes**: Closes the feedback loop by recording final decisions and updating live conversion analytics.
---
## π οΈ Tech Stack
- **Backend**: FastAPI (Python 3.11) + SQLAlchemy + SQLite
- **Frontend**: React + Vite + Vanilla CSS
- **Data Generation**: Faker (for mock analytics & sandbox seeding)
---
## π Project Structure
```text
staffinc/
βββ backend/
β βββ app/
β β βββ database.py # SQLite connection and session local
β β βββ models.py # SQLAlchemy ORM models (Client, Candidate, Score, Feedback)
β β βββ schemas.py # Pydantic v2 validation schemas
β β βββ crud.py # Database CRUD & mismatch checking
β β βββ seed.py # Static BARS questions and default anchors
β β βββ seed_dummy.py # Script to generate realistic mock data
β β βββ brief_generator.py# Gap analysis and strategy brief builder
β β βββ main.py # REST endpoints and static file mount
β βββ requirements.txt
βββ frontend/
β βββ src/
β β βββ components/ # Shared UI (Navbar, ScoreSlider, MismatchAlert)
β β βββ pages/ # Page templates (ClientSetup, CandidateScoring, BriefPreview, FeedbackForm)
β β βββ App.jsx # Client router
β β βββ main.jsx # React entry point
β βββ package.json
β βββ vite.config.js
βββ README.md
```
---
## π Getting Started
### 1. Environment Setup
Make sure you have Anaconda or Miniconda installed, then create and activate the environment:
```bash
# Create the conda environment
conda create -n daftar-kerja python=3.11 -y
# Activate the environment
conda activate daftar-kerja
```
### 2. Backend Installation & Seeding
```bash
# Navigate to backend
cd backend
# Install dependencies
pip install -r requirements.txt
pip install faker
# Seed the database with realistic dummy data
python -m app.seed_dummy
```
### 3. Frontend Installation
```bash
# Navigate to frontend (from project root)
cd ../frontend
# Install node dependencies
npm install
```
---
## π» Running the Application
### Option A: Unified Service (Production Build)
Build the React frontend assets, and let FastAPI serve both the API and the static site:
```bash
# 1. Build frontend (generates frontend/dist/)
cd frontend
npm run build
# 2. Run backend (serves API and front-end on http://127.0.0.1:8000)
cd ../backend
uvicorn app.main:app --host 127.0.0.1 --port 8000
```
### Option B: Split Development Server
Run Vite's dev server with Hot Module Replacement alongside the FastAPI dev server:
```bash
# Run backend (dev reload)
cd backend
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload
# Run frontend dev server (in a separate terminal)
cd frontend
npm run dev
```
*(Vite is configured to automatically proxy `/api` calls to the backend running at port 8000).*
---
## π§ͺ E2E Verification Script
To test the full B2B matching and briefing cycle programmatically, run:
```bash
python -m urllib.request -e http://127.0.0.1:8000/api/stats
```
Or use our custom verification test script:
```bash
# Verify client creation, vetting, brief generation, and dashboard logging
python -m app.verify_e2e
```
|