fix: retrieve created_at for projects and handle persistent login in UI
Build and Deploy / build-and-push (push) Failing after 25s

This commit is contained in:
AI Bot
2026-09-02 10:12:54 +05:30
parent 7582d9b810
commit 04ee585c99
2 changed files with 37 additions and 23 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ app.get('/api/auth/me', authenticate, async (req, res) => {
// 4. Get all projects for user
app.get('/api/projects', authenticate, async (req, res) => {
try {
const projects = await all('SELECT id, name FROM projects WHERE user_id = ?', [req.user.id]);
const projects = await all('SELECT id, name, created_at FROM projects WHERE user_id = ?', [req.user.id]);
res.json({ projects });
} catch (err) {
res.status(500).json({ error: err.message });
+23 -9
View File
@@ -3,7 +3,7 @@ import { Box, Layers, Zap, Globe, Sparkles, Wand2, Image as ImageIcon, BoxSelect
import { useEffect, useState } from 'react';
export default function Home() {
const { openAuthModal } = useAuthStore();
const { openAuthModal, user } = useAuthStore();
const [scrolled, setScrolled] = useState(false);
useEffect(() => {
@@ -23,6 +23,15 @@ export default function Home() {
<Box className="text-primary" /> Titan<span className="text-primary">3d</span>
</div>
<div className="flex gap-4">
{user ? (
<button
onClick={() => window.location.href = '/dashboard'}
className="px-6 py-2 bg-primary hover:bg-primary/90 text-white rounded-full font-medium transition-all shadow-[0_0_15px_rgba(var(--primary-rgb),0.3)] hover:shadow-[0_0_25px_rgba(var(--primary-rgb),0.5)]"
>
Go to Dashboard
</button>
) : (
<>
<button
onClick={() => openAuthModal('login')}
className="px-6 py-2 hover:text-primary font-medium transition-all"
@@ -35,6 +44,8 @@ export default function Home() {
>
Sign Up
</button>
</>
)}
</div>
</nav>
@@ -60,15 +71,18 @@ export default function Home() {
Turn flat images into stunning 3D models, edit materials in real-time, and embed a photorealistic product configurator directly into your store.
</p>
<div className="flex flex-col sm:flex-row gap-6">
<button
onClick={() => openAuthModal('register')}
className="group px-8 py-4 bg-primary text-white rounded-full font-bold text-lg flex items-center gap-2 transition-all hover:scale-105 shadow-[0_0_40px_rgba(var(--primary-rgb),0.4)]"
>
Start Building Free <ArrowRight className="group-hover:translate-x-1 transition-transform" />
<div className="flex flex-wrap justify-center gap-4">
{user ? (
<button onClick={() => window.location.href = '/dashboard'} className="px-8 py-4 bg-primary hover:bg-primary/90 text-white rounded-full font-semibold text-lg transition-all flex items-center gap-2 shadow-[0_0_20px_rgba(var(--primary-rgb),0.4)] hover:shadow-[0_0_40px_rgba(var(--primary-rgb),0.6)] hover:-translate-y-1">
Go to Dashboard <ArrowRight size={20} />
</button>
<button className="px-8 py-4 bg-white/5 hover:bg-white/10 border border-white/10 rounded-full font-bold text-lg transition-all">
Book a Demo
) : (
<button onClick={() => openAuthModal('register')} className="px-8 py-4 bg-primary hover:bg-primary/90 text-white rounded-full font-semibold text-lg transition-all flex items-center gap-2 shadow-[0_0_20px_rgba(var(--primary-rgb),0.4)] hover:shadow-[0_0_40px_rgba(var(--primary-rgb),0.6)] hover:-translate-y-1">
Start Creating Free <ArrowRight size={20} />
</button>
)}
<button className="px-8 py-4 bg-white/5 hover:bg-white/10 text-white rounded-full font-semibold text-lg backdrop-blur-md border border-white/10 transition-all hover:-translate-y-1">
View Examples
</button>
</div>
</div>