Implement active user tiers, class-based Tailwind theme switcher, 3-tiled static dashboard layout, Minio object storage integration, school & state settings database sync, and streak wishes onboarding modal
This commit is contained in:
@@ -10,24 +10,65 @@ def seed_local_database():
|
||||
# Ensure tables are created
|
||||
init_db()
|
||||
|
||||
has_data = False
|
||||
with Session(engine) as session:
|
||||
# Prevent double seeding in local testing environment
|
||||
if session.exec(select(models.Question)).first() is not None:
|
||||
print("Local environment database already contains data components. Dropping all and reseeding...")
|
||||
import sqlmodel
|
||||
sqlmodel.SQLModel.metadata.drop_all(engine)
|
||||
init_db()
|
||||
has_data = True
|
||||
|
||||
if has_data:
|
||||
print("Local environment database already contains data components. Dropping all and reseeding...")
|
||||
import sqlmodel
|
||||
sqlmodel.SQLModel.metadata.drop_all(engine)
|
||||
init_db()
|
||||
|
||||
print("Seeding baseline content entities...")
|
||||
|
||||
with Session(engine) as session:
|
||||
# 0. Create the baseline student users (Free, Pro, AI Coach)
|
||||
free_student_id = UUID("11111111-1111-1111-1111-111111111111")
|
||||
free_student = models.User(
|
||||
id=free_student_id,
|
||||
phone="8888888888",
|
||||
email="free@pragativeer.com",
|
||||
password_hash="mock_hash",
|
||||
name="Amit Kumar (Free Tier)",
|
||||
student_class=models.ClassEnum.TWELFTH,
|
||||
medium=models.MediumEnum.ENGLISH,
|
||||
target_exam=models.ExamEnum.JEE_MAIN,
|
||||
city="Patna",
|
||||
state="Bihar",
|
||||
tier=models.TierEnum.FREE,
|
||||
streak_count=0,
|
||||
last_active=datetime.utcnow()
|
||||
)
|
||||
session.add(free_student)
|
||||
|
||||
pro_student_id = UUID("22222222-2222-2222-2222-222222222222")
|
||||
pro_student = models.User(
|
||||
id=pro_student_id,
|
||||
phone="7777777777",
|
||||
email="pro@pragativeer.com",
|
||||
password_hash="mock_hash",
|
||||
name="Priya Singh (Pro Tier)",
|
||||
student_class=models.ClassEnum.TWELFTH,
|
||||
medium=models.MediumEnum.ENGLISH,
|
||||
target_exam=models.ExamEnum.NEET,
|
||||
city="Kota",
|
||||
state="Rajasthan",
|
||||
tier=models.TierEnum.PRO,
|
||||
streak_count=3,
|
||||
last_active=datetime.utcnow()
|
||||
)
|
||||
session.add(pro_student)
|
||||
|
||||
print("Seeding baseline content entities...")
|
||||
|
||||
# 0. Create the baseline student user (seeded target: JEE_MAIN)
|
||||
student_id = UUID("b0e17378-864d-439e-8806-708dc48a891b")
|
||||
student_user = models.User(
|
||||
id=student_id,
|
||||
phone="9999999999",
|
||||
email="student@pragativeer.com",
|
||||
password_hash="mock_hash",
|
||||
name="Rahul Sharma",
|
||||
name="Rahul Sharma (AI Coach Tier)",
|
||||
student_class=models.ClassEnum.TWELFTH,
|
||||
medium=models.MediumEnum.ENGLISH,
|
||||
target_exam=models.ExamEnum.JEE_MAIN,
|
||||
|
||||
Reference in New Issue
Block a user