fix: retrieve created_at for projects and handle persistent login in UI
Build and Deploy / build-and-push (push) Failing after 25s
Build and Deploy / build-and-push (push) Failing after 25s
This commit is contained in:
+1
-1
@@ -119,7 +119,7 @@ app.get('/api/auth/me', authenticate, async (req, res) => {
|
|||||||
// 4. Get all projects for user
|
// 4. Get all projects for user
|
||||||
app.get('/api/projects', authenticate, async (req, res) => {
|
app.get('/api/projects', authenticate, async (req, res) => {
|
||||||
try {
|
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 });
|
res.json({ projects });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(500).json({ error: err.message });
|
res.status(500).json({ error: err.message });
|
||||||
|
|||||||
+23
-9
@@ -3,7 +3,7 @@ import { Box, Layers, Zap, Globe, Sparkles, Wand2, Image as ImageIcon, BoxSelect
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const { openAuthModal } = useAuthStore();
|
const { openAuthModal, user } = useAuthStore();
|
||||||
const [scrolled, setScrolled] = useState(false);
|
const [scrolled, setScrolled] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -23,6 +23,15 @@ export default function Home() {
|
|||||||
<Box className="text-primary" /> Titan<span className="text-primary">3d</span>
|
<Box className="text-primary" /> Titan<span className="text-primary">3d</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-4">
|
<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
|
<button
|
||||||
onClick={() => openAuthModal('login')}
|
onClick={() => openAuthModal('login')}
|
||||||
className="px-6 py-2 hover:text-primary font-medium transition-all"
|
className="px-6 py-2 hover:text-primary font-medium transition-all"
|
||||||
@@ -35,6 +44,8 @@ export default function Home() {
|
|||||||
>
|
>
|
||||||
Sign Up
|
Sign Up
|
||||||
</button>
|
</button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</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.
|
Turn flat images into stunning 3D models, edit materials in real-time, and embed a photorealistic product configurator directly into your store.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="flex flex-col sm:flex-row gap-6">
|
<div className="flex flex-wrap justify-center gap-4">
|
||||||
<button
|
{user ? (
|
||||||
onClick={() => openAuthModal('register')}
|
<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">
|
||||||
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)]"
|
Go to Dashboard <ArrowRight size={20} />
|
||||||
>
|
|
||||||
Start Building Free <ArrowRight className="group-hover:translate-x-1 transition-transform" />
|
|
||||||
</button>
|
</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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user