File size: 2,653 Bytes
cedb7e1
9707990
 
cedb7e1
 
 
 
 
 
 
 
 
 
 
 
9fb9220
cedb7e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9707990
 
 
cedb7e1
 
 
 
 
 
 
 
 
 
 
 
9707990
 
cedb7e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec97e44
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
import streamlit as st
from io import BytesIO
from resume import CVParse

# === App Configuration ===
st.set_page_config(
    page_title="FitCV - AI Resume Optimizer",
    page_icon="πŸ“„",
    layout="wide"
)

# === Header Section ===
col1, col2 = st.columns([1, 6])

with col1:
    st.image('src/assets/logo.png', width=40)  # Replace with your own logo

with col2:
    st.markdown(
        "<h1 style='font-size: 32px; display: inline;'>FitCV</h1><br>"
        "<span style='font-size:16px; color: gray;'>Your AI-Powered Resume Optimizer</span>",
        unsafe_allow_html=True
    )

st.markdown("---")

# === Input Section ===
st.header("πŸ” Optimize Your Resume for the Job You Want")

uploaded_cv = st.file_uploader("πŸ“„ Upload Your CV (PDF only)", type=["pdf"])

github_username = st.text_input("πŸ™ Enter Your GitHub Username")
if uploaded_cv:
    doc = create_doc(uploaded_cv)
    skills = extract("SKILLS", doc)

job_mode = st.radio("What job info do you have?", ["Job Title", "Full Job Posting"])

if job_mode == "Job Title":
    job_input = st.text_input("πŸ’Ό Enter the Job Title (e.g., Data Scientist at Google)")
else:
    job_input = st.text_area("πŸ’¬ Paste the Full Job Posting")

# === Button ===
if st.button("✨ Optimize Resume"):
    if not uploaded_cv or not github_username or not job_input.strip():
        st.warning("Please fill in all fields and upload a valid resume.")
        st.subheader("🧠 Recommended Skills for This Role")
        st.write(", ".join(result["skills"]))
    else:
        with st.spinner("Analyzing your GitHub, resume, and job requirements..."):

            # === Placeholder: Call to your main pipeline logic ===
            from src.pipeline.recommend import refine_resume  # Adjust path accordingly

            # Simulate reading bytes
            resume_bytes = uploaded_cv.read()

            result = refine_resume(
                resume_pdf_bytes=resume_bytes,
                github_username=github_username,
                job_input=job_input
            )

        # === Output Section ===
        st.success("βœ… Resume optimization complete!")

        st.subheader("πŸ“ Refined Professional Summary")
        st.write(result["summary"])

        st.subheader("🧠 Recommended Skills for This Role")
        st.write(", ".join(result["skills"]))

        st.subheader("πŸš€ GitHub Projects to Highlight")
        for proj in result["projects"]:
            st.markdown(f"- **[{proj['name']}]({proj['url']})**: {proj['description']}")

        st.markdown("---")
        st.info("These suggestions are tailored to the job you provided. You can now update your CV accordingly!")