Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion apps/backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,22 @@ export async function buildApp() {
credentials: true,
});

await app.register(helmet, { contentSecurityPolicy: false });
await app.register(helmet, {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
baseUri: ["'self'"],
fontSrc: ["'self'", 'https:', 'data:', 'https://fonts.gstatic.com'],
frameAncestors: ["'self'"],
imgSrc: ["'self'", 'data:', 'https:'],
objectSrc: ["'none'"],
scriptSrc: ["'self'"],
scriptSrcAttr: ["'none'"],
styleSrc: ["'self'", 'https:', "'unsafe-inline'", 'https://fonts.googleapis.com'],
upgradeInsecureRequests: [],
},
},
});

await app.register(jwt, {
secret: process.env.JWT_SECRET || 'dev-secret-change-me',
Expand Down
106 changes: 71 additions & 35 deletions apps/web/src/app.css
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800;900&display=swap');

/* light theme — default */
:root {
/* Primary */
/* Primary Palette */
--primary: #6366f1;
--primary-light: #818cf8;
--primary-dark: #4f46e5;
--accent: #8b5cf6;

/* Background */
--bg-primary: #f8fafc;
--bg-secondary: #f1f5f9;
--primary-glow: rgba(99, 102, 241, 0.5);
--accent: #a855f7;
--accent-glow: rgba(168, 85, 247, 0.4);

/* Backgrounds */
--bg-primary: #ffffff;
--bg-secondary: #f8fafc;
--bg-glass: rgba(255, 255, 255, 0.7);
--bg-card: #ffffff;
--bg-elevated: #e2e8f0;


/* Text */
--text-primary: #0f172a;
--text-secondary: #475569;
--text-muted: #94a3b8;

/* Border */
--border: #e2e8f0;

/* Spacing */

/* Effects */
--border: rgba(226, 232, 240, 0.8);
--border-glass: rgba(255, 255, 255, 0.3);
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

--radius: 12px;
--radius-lg: 16px;
--radius-xl: 24px;

--theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
--radius-lg: 20px;
--radius-xl: 32px;
--theme-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* dark theme */
html.dark {
--bg-primary: #0f0f1a;
--bg-secondary: #1a1a2e;
--bg-card: #16213e;
--bg-elevated: #1e293b;

--bg-primary: #020617;
--bg-secondary: #0f172a;
--bg-glass: rgba(15, 23, 42, 0.6);
--bg-card: #0f172a;
--text-primary: #f8fafc;
--text-secondary: #94a3b8;
--text-secondary: #cbd5e1;
--text-muted: #64748b;

--border: #334155;

--border: rgba(30, 41, 59, 0.8);
--border-glass: rgba(255, 255, 255, 0.1);
}

* {
Expand All @@ -51,20 +54,53 @@ html.dark {
}

body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-family: 'Inter', sans-serif;
background-color: var(--bg-primary);
color: var(--text-primary);
transition: var(--theme-transition);
-webkit-font-smoothing: antialiased;
min-height: 100vh;
overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
font-family: 'Outfit', sans-serif;
font-weight: 700;
line-height: 1.1;
}

a {
color: var(--primary);
color: inherit;
text-decoration: none;
transition: color 0.2s;
transition: var(--theme-transition);
}

.glass {
background: var(--bg-glass);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--border-glass);
}

.gradient-text {
background: linear-gradient(135deg, var(--primary), var(--accent));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.btn-primary {
background: linear-gradient(135deg, var(--primary), var(--accent));
color: white;
padding: 0.8rem 1.6rem;
border-radius: var(--radius);
font-weight: 600;
box-shadow: 0 4px 15px var(--primary-glow);
border: none;
cursor: pointer;
}

a:hover {
color: var(--primary-dark);
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px var(--primary-glow);
}
13 changes: 13 additions & 0 deletions apps/web/src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Handle } from '@sveltejs/kit';

export const handle: Handle = async ({ event, resolve }) => {
const response = await resolve(event);

// Security Headers (Note: CSP is handled in svelte.config.js)
response.headers.set('X-Content-Type-Options', 'nosniff');
response.headers.set('Referrer-Policy', 'no-referrer');
response.headers.set('X-Frame-Options', 'DENY');
response.headers.set('Permissions-Policy', 'camera=(), microphone=(), geolocation=()');

return response;
};
Loading