| 
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -16,7 +16,7 @@ def start_dev(c):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				@task
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				def stop_dev(c):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    """Stops the developer environment."""
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    print("Stoping local development environment.")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    print("Stopping local development environment...")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    c.run("docker-compose -f docker-compose.yml down")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -48,6 +48,16 @@ def stop_redis(c):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    c.run("docker compose -f docker-compose-redis.yml down")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				@task
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				def init_db(c):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    """Initialize the database."""
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    from project.database import Base, engine
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    Base.metadata.bind = engine
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    Base.metadata.create_all()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    print(f"Created: {engine.url}")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				@task
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				def create_migration(c):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    """Creates a sqlalchemy migration."""
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -62,8 +72,8 @@ def apply_migration(c, revision="head"):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				@task(help={"username": "A username", "email": "The user's email"})
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				def add_user(c, username="", email=""):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    "Adds a dummy user to the application Database"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if not username or email:
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    """Adds a dummy user to the application Database"""
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if not (username and email):
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        raise ValueError("You must provide a username and email")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    from project.database import SessionLocal
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    from project.users.models import User
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |