File size: 2,080 Bytes
55125b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import streamlit_authenticator as stauth
import yaml
from yaml.loader import SafeLoader

# Load configuration for authentication
with open('config.yaml') as file:
    config = yaml.load(file, Loader=SafeLoader)

authenticator = stauth.Authenticate(
    config['credentials'],
    config['cookie']['name'],
    config['cookie']['key'],
    config['cookie']['expiry_days'],
    config['preauthorized']
)

st.set_page_config(page_title="Ayurvedic Healthcare Platform", layout="wide")

def main():
    st.title("AI-Powered Ayurvedic Healthcare Platform")
    
    st.write("Welcome to our innovative Ayurvedic wellness platform!")
    
    col1, col2 = st.columns(2)
    
    with col1:
        st.subheader("New to our platform?")
        if st.button("Sign Up"):
            st.session_state['signup'] = True
    
    with col2:
        st.subheader("Already have an account?")
        name, authentication_status, username = authenticator.login('Login', 'main')
    
    if st.session_state.get('signup', False):
        with st.form("signup_form"):
            st.subheader("Sign Up")
            new_username = st.text_input("Username")
            new_password = st.text_input("Password", type="password")
            role = st.selectbox("I am a", ["Patient", "Doctor"])
            if st.form_submit_button("Create Account"):
                # Here you would typically add the new user to your database
                st.success(f"Account created for {new_username} as a {role}!")
                if role == "Patient":
                    st.info("You've received $500 USD in your internal wallet.")
                st.session_state['signup'] = False
    
    if st.session_state.get("authentication_status"):
        authenticator.logout('Logout', 'main')
        st.write(f'Welcome *{st.session_state["name"]}*')
        st.info("Please navigate to the appropriate module using the sidebar.")
    elif st.session_state.get("authentication_status") is False:
        st.error('Username/password is incorrect')
    
if __name__ == "__main__":
    main()