Deploy complete premium UI application
Browse files- app.py +7 -2
- static/index.html +3 -3
- static/login.html +3 -3
- static/signup.html +3 -3
app.py
CHANGED
|
@@ -69,10 +69,15 @@ def generate_content_with_groq(prompt):
|
|
| 69 |
print(f"Groq Error: {e}")
|
| 70 |
return None
|
| 71 |
|
| 72 |
-
# Serve main page
|
| 73 |
@app.route('/')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
@app.route('/index.html')
|
| 75 |
-
def
|
| 76 |
return send_file('static/index.html')
|
| 77 |
|
| 78 |
# Serve login page
|
|
|
|
| 69 |
print(f"Groq Error: {e}")
|
| 70 |
return None
|
| 71 |
|
| 72 |
+
# Serve main page - redirect to signup first
|
| 73 |
@app.route('/')
|
| 74 |
+
def home():
|
| 75 |
+
return send_file('static/signup.html')
|
| 76 |
+
|
| 77 |
+
# Serve dashboard
|
| 78 |
+
@app.route('/dashboard')
|
| 79 |
@app.route('/index.html')
|
| 80 |
+
def dashboard():
|
| 81 |
return send_file('static/index.html')
|
| 82 |
|
| 83 |
# Serve login page
|
static/index.html
CHANGED
|
@@ -312,9 +312,9 @@
|
|
| 312 |
const isLoggedIn = sessionStorage.getItem('isLoggedIn');
|
| 313 |
const userNameEl = document.getElementById('userName');
|
| 314 |
|
| 315 |
-
// If not logged in, redirect to signup
|
| 316 |
if (!isLoggedIn || !userName) {
|
| 317 |
-
window.location.href = '/
|
| 318 |
return;
|
| 319 |
}
|
| 320 |
|
|
@@ -329,7 +329,7 @@
|
|
| 329 |
logoutBtn.addEventListener('click', function(e) {
|
| 330 |
e.preventDefault();
|
| 331 |
sessionStorage.clear();
|
| 332 |
-
window.location.href = '/
|
| 333 |
});
|
| 334 |
}
|
| 335 |
});
|
|
|
|
| 312 |
const isLoggedIn = sessionStorage.getItem('isLoggedIn');
|
| 313 |
const userNameEl = document.getElementById('userName');
|
| 314 |
|
| 315 |
+
// If not logged in, redirect to signup (home page)
|
| 316 |
if (!isLoggedIn || !userName) {
|
| 317 |
+
window.location.href = '/';
|
| 318 |
return;
|
| 319 |
}
|
| 320 |
|
|
|
|
| 329 |
logoutBtn.addEventListener('click', function(e) {
|
| 330 |
e.preventDefault();
|
| 331 |
sessionStorage.clear();
|
| 332 |
+
window.location.href = '/';
|
| 333 |
});
|
| 334 |
}
|
| 335 |
});
|
static/login.html
CHANGED
|
@@ -140,8 +140,8 @@
|
|
| 140 |
sessionStorage.setItem('userEmail', email);
|
| 141 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 142 |
|
| 143 |
-
// Redirect to
|
| 144 |
-
window.location.href = '/';
|
| 145 |
} else {
|
| 146 |
document.getElementById('errorAlert').classList.remove('hidden');
|
| 147 |
document.getElementById('errorMessage').textContent = 'Please enter both email and password';
|
|
@@ -152,7 +152,7 @@
|
|
| 152 |
// Mock social login
|
| 153 |
sessionStorage.setItem('userName', provider + '_user');
|
| 154 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 155 |
-
window.location.href = '/';
|
| 156 |
}
|
| 157 |
</script>
|
| 158 |
</body>
|
|
|
|
| 140 |
sessionStorage.setItem('userEmail', email);
|
| 141 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 142 |
|
| 143 |
+
// Redirect to dashboard
|
| 144 |
+
window.location.href = '/dashboard';
|
| 145 |
} else {
|
| 146 |
document.getElementById('errorAlert').classList.remove('hidden');
|
| 147 |
document.getElementById('errorMessage').textContent = 'Please enter both email and password';
|
|
|
|
| 152 |
// Mock social login
|
| 153 |
sessionStorage.setItem('userName', provider + '_user');
|
| 154 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 155 |
+
window.location.href = '/dashboard';
|
| 156 |
}
|
| 157 |
</script>
|
| 158 |
</body>
|
static/signup.html
CHANGED
|
@@ -170,8 +170,8 @@
|
|
| 170 |
sessionStorage.setItem('userEmail', email);
|
| 171 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 172 |
|
| 173 |
-
// Redirect to
|
| 174 |
-
window.location.href = '/';
|
| 175 |
} else {
|
| 176 |
document.getElementById('errorAlert').classList.remove('hidden');
|
| 177 |
document.getElementById('errorMessage').textContent = 'Please fill in all fields';
|
|
@@ -181,7 +181,7 @@
|
|
| 181 |
function socialSignup(provider) {
|
| 182 |
sessionStorage.setItem('userName', provider + '_user');
|
| 183 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 184 |
-
window.location.href = '/';
|
| 185 |
}
|
| 186 |
</script>
|
| 187 |
</body>
|
|
|
|
| 170 |
sessionStorage.setItem('userEmail', email);
|
| 171 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 172 |
|
| 173 |
+
// Redirect to dashboard
|
| 174 |
+
window.location.href = '/dashboard';
|
| 175 |
} else {
|
| 176 |
document.getElementById('errorAlert').classList.remove('hidden');
|
| 177 |
document.getElementById('errorMessage').textContent = 'Please fill in all fields';
|
|
|
|
| 181 |
function socialSignup(provider) {
|
| 182 |
sessionStorage.setItem('userName', provider + '_user');
|
| 183 |
sessionStorage.setItem('isLoggedIn', 'true');
|
| 184 |
+
window.location.href = '/dashboard';
|
| 185 |
}
|
| 186 |
</script>
|
| 187 |
</body>
|