- Added Chat frontend, interfaces with backend;

- Updated styles for VideoPage;
- Added StreamerRoute component;
- Remove unused Login and Signup pages;
- Update to Navbar and Logo components for new structure on different pages;
- Update to auth flow to display error messages to user;
This commit is contained in:
Chris-1010
2025-01-25 02:34:06 +00:00
parent 5c16092b1c
commit a409e74992
23 changed files with 625 additions and 119 deletions

View File

@@ -30,11 +30,13 @@ def create_app():
from blueprints.stripe import stripe_bp
from blueprints.user import user_bp
from blueprints.streams import stream_bp
from blueprints.chat import chat_bp
app.register_blueprint(auth_bp)
app.register_blueprint(main_bp)
app.register_blueprint(stripe_bp)
app.register_blueprint(user_bp)
app.register_blueprint(stream_bp)
app.register_blueprint(chat_bp)
return app

View File

@@ -22,8 +22,13 @@ def signup():
# Basic server-side validation
if not all([username, email, password]):
fields = ["username", "email", "password"]
for x in fields:
if not [username, email, password][fields.index(x)]:
fields.remove(x)
return jsonify({
"account_created": False,
"error_fields": fields,
"message": "Missing required fields"
}), 400
@@ -45,13 +50,15 @@ def signup():
if dup_email is not None:
return jsonify({
"account_created": False,
"errors": {"email": "Email already taken"}
"error_fields": ["email"],
"message": "Email already taken"
}), 400
if dup_username is not None:
return jsonify({
"account_created": False,
"errors": {"username": "Username already taken"}
"error_fields": ["username"],
"message": "Username already taken"
}), 400
# Create new user
@@ -122,14 +129,16 @@ def login():
if not user:
return jsonify({
"logged_in": False,
"errors": {"general": "Invalid username or password"}
"error_fields": ["username", "password"],
"message": "Invalid username or password"
}), 401
# Verify password
if not check_password_hash(user["password"], password):
return jsonify({
"logged_in": False,
"errors": {"general": "Invalid username or password"}
"error_fields": ["username", "password"],
"message": "Invalid username or password"
}), 401
# Set up session

View File

@@ -139,9 +139,16 @@ def get_streamer(streamer_id):
"""
return
@stream_bp.route('/streamer/<string:streamerName>/status')
def get_streamer_status(streamerName):
"""
Returns a streamer's status, if they are live or not
"""
return {"status": "live", "streamId": 1}
@stream_bp.route('/get_stream_data/<int:streamer_id>', methods=['GET'])
def get_stream(streamer_id):
@stream_bp.route('/get_stream_data/<int:stream_id>', methods=['GET'])
def get_stream(stream_id):
"""
Returns a streamer's stream data
"""