File size: 3,572 Bytes
363cda9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
CV Upload UI for Job Applications.

Connects to the CV Upload API.
Run with: streamlit run src/frontend/streamlit/cv_ui/app.py

In Docker, set CV_UPLOAD_API_URL environment variable.
Locally, defaults to http://localhost:8080/api/v1/cv
"""

import streamlit as st
from src.sdk import CVUploadClient

# Initialize SDK client
client = CVUploadClient()

st.set_page_config(page_title="AI Engineer Job Portal", page_icon="πŸ€–", layout="centered")

# --- UI Header ---
st.title("πŸ€– AI Engineer Job Application Portal")
st.markdown(
    """
    Welcome to **ScionHire AI Labs** πŸ‘‹  
    We're seeking talented engineers passionate about building intelligent systems!  
    Please submit your CV below to apply for the **AI Engineer** position.
    """
)

# --- Job Description (Static for now) ---
with st.expander("πŸ“„ View Job Description"):
    st.markdown(
        """
        ### 🧠 Position: AI Engineer  
        **Location:** Remote / Wiesbaden HQ  
        **About the Role:**  
        Join our AI R&D team to develop, fine-tune, and deploy ML models for production.  
        You will work on projects involving LLMs, LangGraph agents, and context engineering.  

        **Requirements:**  
        - Proficiency in Python & modern AI frameworks (PyTorch, LangChain, etc.)  
        - Solid understanding of NLP and ML pipelines  
        - Experience deploying models or building intelligent systems  
        - Strong communication and teamwork skills  
        """
    )

st.markdown("---")

# --- Candidate Form ---
with st.form("application_form"):
    full_name = st.text_input("Full Name", placeholder="Ada Lovelace")
    email = st.text_input("Email Address", placeholder="ada@lovelabs.ai")
    phone = st.text_input("Phone Number", placeholder="+49 170 1234567")
    uploaded_file = st.file_uploader("Upload Your CV (PDF or DOCX)", type=["pdf", "docx"])
    submitted = st.form_submit_button("πŸ“¨ Submit Application")

# --- Handle Submission ---
if submitted:
    if not uploaded_file:
        st.error("Please upload your CV before submitting.")
    elif not (full_name and email):
        st.error("Full name and email are required.")
    else:
        try:
            with st.spinner("πŸ“€ Submitting your application..."):
                response = client.submit(
                    full_name=full_name,
                    email=email,
                    phone=phone,
                    cv_file=uploaded_file,
                    filename=uploaded_file.name,
                )
            
            if response.success:
                st.success(f"βœ… {response.message}")
                st.info("Your application has been recorded. You will receive updates soon.")

                with st.expander("πŸ“¬ Submitted Info"):
                    st.json({
                        "full_name": response.candidate_name,
                        "email": response.email,
                            "phone": phone,
                        "cv_file_path": response.cv_file_path,
                            "position": "AI Engineer",
                    })
            
            elif response.already_exists:
                st.warning(
                    f"⚠️ {response.message} "
                    "Please wait for review."
                )
            else:
                st.error(f"❌ {response.message}")
                
        except ValueError as e:
            st.error(f"❌ {str(e)}")
        except Exception as e:
            st.error(f"❌ Failed to submit application. Is the API running?\n\nError: {e}")