Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cv_filter_tool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lokesh Singh
cv_filter_tool
Commits
2bce8044
Commit
2bce8044
authored
Jan 18, 2025
by
Prateek Lal
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.mynisum.com/lsingh/cv_filter_tool
parents
a73a09e7
79fb0e78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
7 deletions
+69
-7
api.py
src/api.py
+37
-0
dashboard.py
src/dashboard.py
+18
-6
main.py
src/main.py
+10
-0
requirements.txt
src/requirements.txt
+4
-1
No files found.
src/api.py
0 → 100644
View file @
2bce8044
from
fastapi
import
APIRouter
,
HTTPException
from
fastapi.responses
import
FileResponse
from
pydantic
import
BaseModel
import
os
router
=
APIRouter
()
# Define a Pydantic model for the data we expect in the POST request
class
InputData
(
BaseModel
):
jobTitle
:
str
department
:
str
jobDescription
:
str
# POST endpoint
@
router
.
post
(
"/submit/"
)
async
def
submit_data
(
data
:
InputData
):
# Here, you can process the data (e.g., save it to a database)
return
{
"message"
:
"Data received successfully!"
,
"data"
:
data
.
dict
()}
@
router
.
get
(
"/read-file"
)
async
def
read_file
(
file_path
:
str
):
# Define the base directory for public files
base_dir
=
"/path/to/public/drive"
# Construct the full file path
full_path
=
os
.
path
.
join
(
base_dir
,
file_path
)
# Check if the file exists
if
not
os
.
path
.
isfile
(
full_path
):
raise
HTTPException
(
status_code
=
404
,
detail
=
"File not found"
)
# Return the file as a response
return
FileResponse
(
full_path
)
@
router
.
get
(
"/hello"
)
async
def
hello_world
():
return
{
"message"
:
"Hello, World!"
}
\ No newline at end of file
src/dashboard.py
View file @
2bce8044
import
streamlit
as
st
import
requests
# FastAPI URL (assuming it is running locally on port 8000)
API_URL
=
"http://127.0.0.1:8000/submit/"
# Title of the app
st
.
title
(
"Enter JD to fetch resumes!"
)
...
...
@@ -11,9 +15,17 @@ job_description = st.text_area("Job Description", height=200)
# Add a submit button
if
st
.
button
(
"Submit"
):
if
job_title
and
department
and
job_description
:
st
.
success
(
"Job Description Submitted Successfully!"
)
st
.
write
(
f
"**Job Title:** {job_title}"
)
st
.
write
(
f
"**Department:** {department}"
)
st
.
write
(
f
"**Job Description:** {job_description}"
)
else
:
st
.
error
(
"Please fill in all the fields."
)
data
=
{
"jobTitle"
:
job_title
,
"department"
:
department
,
"jobDescription"
:
job_description
}
response
=
requests
.
post
(
API_URL
,
json
=
data
)
# If the request is successful, display the response
if
response
.
status_code
==
200
:
result
=
response
.
json
()
st
.
success
(
result
[
'message'
])
st
.
write
(
"Received Data:"
,
result
[
'data'
])
else
:
st
.
error
(
f
"Error: {response.status_code}"
)
else
:
\ No newline at end of file
src/main.py
0 → 100644
View file @
2bce8044
from
fastapi
import
FastAPI
from
src.api
import
router
app
=
FastAPI
()
app
.
include_router
(
router
)
if
__name__
==
"__main__"
:
import
uvicorn
uvicorn
.
run
(
app
,
host
=
"0.0.0.0"
,
port
=
8000
)
\ No newline at end of file
src/requirements.txt
View file @
2bce8044
...
...
@@ -3,4 +3,7 @@ PyPDF2
scikit-learn
transformers
streamlit
fastapi
uvicorn
requests
router
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment