File size: 5,233 Bytes
ab71d18
 
 
 
 
 
fe867eb
ab71d18
 
 
4b63522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c0b54b
4b63522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c0b54b
 
4b63522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
---
title: AI Resume Ranker
emoji: πŸ“„
colorFrom: blue
colorTo: green
sdk: docker
app_file: main.py
pinned: false
---

# 🧠 AI Resume Ranker API

An intelligent, production-ready Resume Ranking API for developers, recruiters, and HR tech platforms.  
Inspired by Stripe & Paystack API experiences β€” complete with authentication, dashboard, and live testing interface.

Built with **Flask + Sentence Transformers + PDF Parsing + Semantic AI**, this API helps you automatically score and rank resumes against any job description using powerful language understanding models.

---

## πŸš€ Features

- βœ… **API Key Authentication** with secure Bearer token format
- 🧾 **Semantic Resume Ranking** using transformer embeddings (not just keyword matching)
- πŸ“€ Supports **batch PDF uploads**
- πŸ“¬ **JSON API responses** with ranked relevance scores
- πŸ§ͺ **Live Testing Interface** on the dashboard
- πŸ” **Secure User System** with login, signup, hashed passwords
- πŸ” **API Key Regeneration** from the dashboard
- πŸ“š Beautiful **API Documentation Page** with copyable code samples
- 🧰 **Try It Now**: Upload resumes + job text and see live scoring
- πŸ“ˆ Ready for usage tracking, analytics, or rate limiting
- πŸ’Ό Built for scaling into a full SaaS product

---

## 🌐 Live Demo

> Coming soon: hosted on Render or Railway (e.g., [https://resume-ranker.example.com](https://resume-ranker.example.com))

---

## πŸ“¦ API Overview

### πŸ”— Endpoint

```

POST /api/rank-resumes

```

### πŸ” Authentication

Send your API key in the request header:

```

Authorization: Bearer amn=your\_api\_key\_here

````

### πŸ“€ Request Parameters

| Name            | Type             | Required | Description                          |
|-----------------|------------------|----------|--------------------------------------|
| resumes         | `file[] (PDF)`   | βœ… Yes   | One or more PDF resumes              |
| job_description | `string`         | βœ… Yes   | Job description text to compare with |

---

## πŸ“₯ Example Usage

### πŸ§ͺ Try It via cURL

```bash
curl -X POST https://yourdomain.com/api/rank-resumes \
  -H "Authorization: Bearer amn=sk_live_abc123xyz" \
  -F "resumes=@resume1.pdf" \
  -F "resumes=@resume2.pdf" \
  -F "job_description=We are hiring a backend Django developer..."
````

### πŸ“¦ Sample Response

```json
{
  "results": [
    {
      "filename": "resume1.pdf",
      "score": 0.8745
    },
    {
      "filename": "resume2.pdf",
      "score": 0.6721
    }
  ],
  "count": 2,
  "requested_by": "user@example.com"
}
```

---

## πŸ›  Tech Stack

* **Backend:** Flask, Blueprints, Jinja2
* **AI:** SentenceTransformers (`all-MiniLM-L6-v2`)
* **PDF Parsing:** PyMuPDF
* **Auth:** Flask sessions + hashed passwords
* **Database:** SQLite (dev) / PostgreSQL-ready
* **Frontend:** Bootstrap 5 + custom Jinja templates
* **Hosting:** Render / Railway / PythonAnywhere
* **Docs UI:** Fully embedded HTML + live form

---

## πŸ§ͺ Try It Now (via Dashboard)

* Register/Login
* View and copy your API Key
* Paste a job description
* Upload 1–5 resumes (PDF)
* Get AI-scored ranking results instantly

---

## πŸ§‘β€πŸ’» Developer Setup

```bash
git clone https://github.com/yourusername/resume-ranker-api.git
cd resume-ranker-api
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt
flask run
```

Perfect β€” thanks for the clarification.

You're right to **remove the real email password** before pushing to GitHub β€” sensitive credentials should never be committed. Instead, include **placeholder values** in the `.env` section of your `README.md`.

---

## βœ… Updated `.env` Example for README

Here's the correct `.env` block to include in the `README.md`:

```ini
FLASK_ENV=development
SECRET_KEY=your_secret_key_here
DATABASE_URL=sqlite:///db.sqlite3

# βœ… Email credentials for verification system
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password_here
```

> πŸ“Œ **Note:** Use an **App Password** (not your actual Gmail password) if you're using Gmail SMTP. App passwords are safer and Gmail-compliant.

---

## πŸ”’ Additional Security Tip

To prevent accidental exposure:

* Add `.env` to your `.gitignore`
* Use environment variables in production (Render, Railway, Fly.io all support this)

**`.gitignore` entry:**

.env
```

---

## βœ… Bonus (Optional): Mention in README

You can also add a small note under **Developer Setup** in your README:

> πŸ“§ **Note:** To enable email verification links, set `EMAIL_USER` and `EMAIL_PASS` in your `.env`. We recommend using an App Password with Gmail or a transactional email provider like Mailgun or SendGrid.


## πŸ’‘ Future Features

* βœ… API usage tracking
* ⏳ Rate limiting (per API key)
* πŸ“Š Dashboard analytics
* 🧠 Resume summarization API
* πŸ“ CSV/JSON result export
* 🧩 SDKs for Python & JS

---

## 🀝 Contributing

Pull requests are welcome! Let's build the future of AI recruiting tools together.

---

## πŸ“œ License

MIT License

---

## πŸ“¬ Contact

Made with ❀️ by [Muhammad Aminu Umar](mailto:webcodelabb@gmail.com)
πŸ”— [LinkedIn](https://linkedin.com/in/webcodelab) | [GitHub](https://github.com/webcodelabb)