Shri commited on
Commit
ce1e080
·
1 Parent(s): 0c8dccb

database connection

Browse files
src/auth/config.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from pydantic import BaseSettings
2
+
3
+ class HomeSettings(BaseSettings):
4
+ FEATURE_ENABLED: bool = True
5
+
6
+ home_settings = HomeSettings()
src/auth/constants.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ WELCOME_MESSAGE = "Welcome to Yuvabe's Home Screen"
2
+ EXIT_MESSAGE = "Thank You have a wonderful day"
src/auth/dependencies.py ADDED
File without changes
src/auth/exceptions.py ADDED
File without changes
src/auth/models.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import uuid
2
+ import sqlmodel
src/auth/router.py ADDED
File without changes
src/auth/schemas.py ADDED
File without changes
src/auth/service.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ from typing import List
2
+ from uuid import UUID
src/auth/utils.py ADDED
File without changes
src/chatbot/config.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from pydantic import BaseSettings
2
+
3
+ class HomeSettings(BaseSettings):
4
+ FEATURE_ENABLED: bool = True
5
+
6
+ home_settings = HomeSettings()
src/chatbot/constants.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ WELCOME_MESSAGE = "Welcome to Yuvabe's Home Screen"
2
+ EXIT_MESSAGE = "Thank You have a wonderful day"
src/chatbot/dependencies.py ADDED
File without changes
src/chatbot/exceptions.py ADDED
File without changes
src/chatbot/models.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import uuid
2
+ import sqlmodel
src/chatbot/router.py ADDED
File without changes
src/chatbot/schemas.py ADDED
File without changes
src/chatbot/service.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ from typing import List
2
+ from uuid import UUID
src/chatbot/utils.py ADDED
File without changes
src/core/database.py CHANGED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from sqlmodel import SQLModel, create_engine
2
+ from dotenv import load_dotenv
3
+ from . import models
4
+ import os
5
+
6
+ load_dotenv()
7
+
8
+ engine = create_engine(os.getenv('DATABASE_URL'),echo=True)
9
+
10
+ SQLModel.metadata.create_all(engine)
src/core/insert_sample.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from sqlmodel import Session
2
+ from datetime import date
3
+ import uuid
4
+
5
+ from src.core.database import engine
6
+ from src.core.models import Users, Roles, Teams
7
+
8
+
9
+ role = Roles(
10
+ id=uuid.uuid4(),
11
+ name="User"
12
+ )
13
+
14
+ team = Teams(
15
+ id=uuid.uuid4(),
16
+ name="Health Squad"
17
+ )
18
+
19
+ user = Users(
20
+ id=uuid.uuid4(),
21
+ email_id="test@example.com",
22
+ password="hashed_password_here",
23
+ user_name="tilak",
24
+ dob=date(2000, 5, 20),
25
+ address="Bangalore, India",
26
+ role_id=role.id,
27
+ emotion_trend={"happy": 10, "sad": 2},
28
+ habit_trend={"exercise": 5, "sleep": 8},
29
+ profile_picture="https://example.com/image.jpg",
30
+ post_id=uuid.uuid4()
31
+ )
32
+
33
+
34
+ with Session(engine) as session:
35
+ session.add(role)
36
+ session.add(team)
37
+ session.add(user)
38
+ session.commit()
39
+
40
+ print("Sample data inserted successfully!")
src/core/models.py CHANGED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from sqlmodel import SQLModel, Field
2
+ from datetime import date
3
+ from sqlalchemy.dialects.postgresql import JSONB
4
+ import uuid
5
+
6
+ class Users(SQLModel, table=True):
7
+ id: uuid.UUID | None = Field(default=None, primary_key=True)
8
+ email_id : str = Field(unique=True)
9
+ password : str
10
+ user_name : str
11
+ dob : date
12
+ address : str
13
+ role_id : uuid.UUID
14
+ emotion_trend : dict = Field(sa_type=JSONB)
15
+ habit_trend : dict = Field(sa_type=JSONB)
16
+ profile_picture : str
17
+ post_id : uuid.UUID
18
+
19
+ class Teams(SQLModel, table = True):
20
+ id: uuid.UUID | None = Field(default=None, primary_key=True)
21
+ name : str
22
+
23
+ class Roles(SQLModel, table = True):
24
+ id : uuid.UUID | None = Field(default=None , primary_key=True)
25
+ name : str
src/feed/config.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from pydantic import BaseSettings
2
+
3
+ class HomeSettings(BaseSettings):
4
+ FEATURE_ENABLED: bool = True
5
+
6
+ home_settings = HomeSettings()
src/feed/constants.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ WELCOME_MESSAGE = "Welcome to Yuvabe's Home Screen"
2
+ EXIT_MESSAGE = "Thank You have a wonderful day"
src/feed/dependencies.py ADDED
File without changes
src/feed/exceptions.py ADDED
File without changes
src/feed/models.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import uuid
2
+ import sqlmodel
src/feed/router.py ADDED
File without changes
src/feed/schemas.py ADDED
File without changes
src/feed/service.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ from typing import List
2
+ from uuid import UUID
src/feed/utils.py ADDED
File without changes
src/profile/config.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from pydantic import BaseSettings
2
+
3
+ class HomeSettings(BaseSettings):
4
+ FEATURE_ENABLED: bool = True
5
+
6
+ home_settings = HomeSettings()
src/profile/constants.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ WELCOME_MESSAGE = "Welcome to Yuvabe's Home Screen"
2
+ EXIT_MESSAGE = "Thank You have a wonderful day"
src/profile/dependencies.py ADDED
File without changes
src/profile/exceptions.py ADDED
File without changes
src/profile/models.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import uuid
2
+ import sqlmodel
src/profile/router.py ADDED
File without changes
src/profile/schemas.py ADDED
File without changes
src/profile/service.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ from typing import List
2
+ from uuid import UUID
src/profile/utils.py ADDED
File without changes