File size: 4,031 Bytes
e8a3055
9965645
 
 
 
 
 
e8a3055
 
478dec6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fc8eb3c
 
 
478dec6
 
 
fc8eb3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478dec6
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Candidate Explorer
emoji: πŸ”
colorFrom: purple
colorTo: gray
sdk: docker
app_port: 7860
---

## Schemas
```plain
1. Build Schema
    a. table: cv_users βœ…
        - user_id
        - username
        - hashed_password
        - email
        - full_name
        - role
        - is_active
        - tenant_id
        - created_at
        - date_modified
        - notes
    b. table: cv_tenant βœ…
        - tenant_id
        - tenant_name
        - created_at
        - date_modified
        - notes
    c. table: cv_file βœ…
        - file_id
        - file_type
        - filename
        - url
        - is_extracted
        - uploaded_at
        - date_modified
    d. table: cv_profile βœ…
        - profile_id
        - fullname
        - gpa_edu_1
        - univ_edu_1
        - major_edu_1
        - gpa_edu_2
        - univ_edu_2
        - major_edu_2
        - gpa_edu_3
        - univ_edu_3
        - major_edu_3
        - domicile
        - yoe
        - hardskills
        - softskills
        - certifications
        - business_domain
        - filename
        - file_id
        - created_at
    e. table: cv_filter
        - criteria_id
        - gpa_edu_1
        - gpa_edu_2
        - gpa_edu_3
        - univ_edu_1
        - univ_edu_2
        - univ_edu_3
        - major_edu_1
        - major_edu_2
        - major_edu_3
        - domicile
        - yoe
        - hardskills
        - softskills
        - certifications
        - business_domain
        - created_at
    f. table: cv_weight βœ…
        - weight_id
        - gpa_edu_1
        - gpa_edu_2
        - gpa_edu_3
        - univ_edu_1
        - univ_edu_2
        - univ_edu_3
        - major_edu_1
        - major_edu_2
        - major_edu_3
        - domicile
        - yoe
        - hardskills
        - softskills
        - certifications
        - business_domain
        - created_at
    g. table: cv_matching βœ…
        - matching_id
        - profile_id
        - criteria_id
        - gpa_edu_1
        - gpa_edu_2
        - gpa_edu_3
        - univ_edu_1
        - univ_edu_2
        - univ_edu_3
        - major_edu_1
        - major_edu_2
        - major_edu_3
        - domicile
        - yoe
        - hardskills
        - softskills
        - certifications
        - business_domain
        - created_at
    g. table: profile_scores βœ…
        - score_id
        - matching_id
        - score
        - created_at
```


## List API
### User
```plain
POST /admin/users              βœ…  Create user
POST /admin/login              βœ…  Login, returns JWT Bearer token
GET  /admin/me                 βœ…  Get current authenticated user
```
### Tenant
```plain
POST /admin/tenants            βœ…  Create tenant
GET  /admin/tenants/{name}     βœ…  Get tenant by name
```
### File
```plain
POST   /file/upload            βœ…  Upload multiple PDF files
GET    /file/user/{user_id}    βœ…  Get file metadata by user
DELETE /file/{filename}        βœ…  Soft-delete file (marks is_deleted=True)
GET    /file/score_card        βœ…  Dashboard summary (total files, extracted profiles, %)
```
### Profile
```plain
POST /profile/extract_profile          βœ…  Extract structured profile from a CV PDF
GET  /profile/{profile_id}             βœ…  Get extracted profile by ID
GET  /profile/profiles/{criteria_id}   βœ…  Get profiles by criteria ID
```
### Agentic
```plain
POST /agentic/create_filter            βœ…          Create filter/criteria
GET  /agentic/filter/{criteria_id}     βœ…          Get filter by ID
POST /agentic/create_weight            βœ…          Create weight config for scoring
POST /agentic/calculate_score          ⚠️ DEPRECATED  Old single scoring endpoint
POST /agentic/v2/calculate_score       βœ…          Bulk scoring (v2, recommended)
```

## How To 
1. Init schema on DB
`uv run python -m externals.databases.pg_schema_up`

2. Drop schema on DB
`uv run python -m externals.databases.pg_schema_down`


Compile pyproject.toml to requirements.txt
`uv pip compile pyproject.toml -o requirements.txt`