chore:some cleaning up

This commit is contained in:
2025-09-29 17:14:26 +02:00
parent 204a443847
commit 0b44f10459
13 changed files with 35 additions and 77 deletions

View File

@@ -1,8 +0,0 @@
node_modules
.env
.git
.gitignore
README.md
Dockerfile
.dockerignore
docker-compose.yml

View File

@@ -1,16 +0,0 @@
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN DATABASE_URL="postgres://user:pass@localhost:5432/db" npm run build
# DATABASE_URL is only needed at build time for Prisma to generate the client. It is not needed at runtime and will be replaced by the hosted neon database.
FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app ./
ENV NODE_ENV=production
EXPOSE 3000
# Start the application
CMD ["node", "build"]

View File

@@ -1,7 +0,0 @@
services:
app:
build: .
ports:
- 3000:3000
env_file:
- .env

View File

@@ -22,6 +22,8 @@ body {
line-height: 1.5;
background-color: #f8f8f8;
color: #333;
max-width: 1200px;
margin: 0 auto;
}
h1 {

View File

@@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.157 22.819c-10.4-14.885-30.94-19.297-45.792-9.835L22.282 29.608A29.92 29.92 0 0 0 8.764 49.65a31.5 31.5 0 0 0 3.108 20.231 30 30 0 0 0-4.477 11.183 31.9 31.9 0 0 0 5.448 24.116c10.402 14.887 30.942 19.297 45.791 9.835l26.083-16.624A29.92 29.92 0 0 0 98.235 78.35a31.53 31.53 0 0 0-3.105-20.232 30 30 0 0 0 4.474-11.182 31.88 31.88 0 0 0-5.447-24.116" style="fill:#ff3e00"/><path d="M45.817 106.582a20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.503 18 18 0 0 1 .624-2.435l.49-1.498 1.337.981a33.6 33.6 0 0 0 10.203 5.098l.97.294-.09.968a5.85 5.85 0 0 0 1.052 3.878 6.24 6.24 0 0 0 6.695 2.485 5.8 5.8 0 0 0 1.603-.704L69.27 76.28a5.43 5.43 0 0 0 2.45-3.631 5.8 5.8 0 0 0-.987-4.371 6.24 6.24 0 0 0-6.698-2.487 5.7 5.7 0 0 0-1.6.704l-9.953 6.345a19 19 0 0 1-5.296 2.326 20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.502 17.99 17.99 0 0 1 8.13-12.052l26.081-16.623a19 19 0 0 1 5.3-2.329 20.72 20.72 0 0 1 22.237 8.243 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-.624 2.435l-.49 1.498-1.337-.98a33.6 33.6 0 0 0-10.203-5.1l-.97-.294.09-.968a5.86 5.86 0 0 0-1.052-3.878 6.24 6.24 0 0 0-6.696-2.485 5.8 5.8 0 0 0-1.602.704L37.73 51.72a5.42 5.42 0 0 0-2.449 3.63 5.79 5.79 0 0 0 .986 4.372 6.24 6.24 0 0 0 6.698 2.486 5.8 5.8 0 0 0 1.602-.704l9.952-6.342a19 19 0 0 1 5.295-2.328 20.72 20.72 0 0 1 22.237 8.242 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-8.13 12.053l-26.081 16.622a19 19 0 0 1-5.3 2.328" style="fill:#fff"/></svg>
<svg width="250" height="250" viewBox="0 0 250 250" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="250" height="250" fill="#D9D9D9"/>
<path d="M122.823 166.616C111.473 166.616 100.892 165.037 91.0785 161.88L89.2865 137.304H90.4385C98.0332 154.712 108.999 163.416 123.335 163.416C129.82 163.416 134.812 162.307 138.311 160.088C141.809 157.784 143.559 154.413 143.559 149.976C143.559 147.672 143.004 145.581 141.895 143.704C140.785 141.741 138.993 139.907 136.519 138.2C134.129 136.408 131.697 134.872 129.223 133.592C126.748 132.312 123.548 130.776 119.623 128.984L115.271 127.064C112.881 126.04 110.791 125.059 108.999 124.12C107.207 123.181 105.201 122.072 102.983 120.792C100.849 119.512 99.0145 118.189 97.4785 116.824C95.9425 115.459 94.4918 114.008 93.1265 112.472C91.7612 110.851 90.7372 109.101 90.0545 107.224C89.3718 105.261 89.0305 103.256 89.0305 101.208C89.0305 95.832 90.7372 91.2667 94.1505 87.512C97.6492 83.7573 102.215 81.0693 107.847 79.448C113.479 77.7413 120.049 76.888 127.559 76.888C136.604 76.888 146.204 78.424 156.359 81.496L158.535 106.2H157.511C153.841 97.8373 149.404 91.3947 144.199 86.872C138.993 82.3493 132.593 80.088 124.999 80.088C119.879 80.088 115.825 81.24 112.839 83.544C109.852 85.7627 108.359 88.7067 108.359 92.376C108.359 94.424 108.785 96.2587 109.639 97.88C110.577 99.5013 112.028 100.995 113.991 102.36C116.039 103.64 118.044 104.749 120.007 105.688C121.969 106.627 124.572 107.736 127.815 109.016L133.191 111.192C137.287 112.813 140.956 114.52 144.199 116.312C147.441 118.019 150.556 120.109 153.543 122.584C156.529 124.973 158.833 127.747 160.455 130.904C162.076 134.061 162.887 137.475 162.887 141.144C162.887 146.861 161.009 151.683 157.255 155.608C153.585 159.533 148.807 162.349 142.919 164.056C137.031 165.763 130.332 166.616 122.823 166.616Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -21,15 +21,16 @@
<header class="app-header">
<h1 class="app-title">Serengo</h1>
<div class="profile-container">
<ProfileIcon username={user.username} onclick={toggleProfilePanel} />
</header>
<ProfilePanel
<ProfilePanel
username={user.username}
id={user.id}
isOpen={showProfilePanel}
onClose={closeProfilePanel}
/>
/>
</div>
</header>
<style>
.app-header {
@@ -37,5 +38,12 @@
align-items: center;
justify-content: space-between;
padding: 16px 20px;
max-width: 1200px;
margin: 0 auto;
position: relative;
}
.profile-container {
position: relative;
}
</style>

View File

@@ -10,13 +10,6 @@
let { username, id, isOpen, onClose }: Props = $props();
// Close panel when clicking outside
function handleBackdropClick(event: MouseEvent) {
if (event.target === event.currentTarget) {
onClose();
}
}
// Close panel on escape key
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape') {
@@ -28,7 +21,7 @@
<svelte:window on:keydown={handleKeydown} />
{#if isOpen}
<div class="backdrop" onclick={handleBackdropClick} role="presentation">
<div class="backdrop" role="presentation">
<div class="panel">
<div class="panel-header">
<h2>Profile</h2>
@@ -67,29 +60,17 @@
{/if}
<style>
.backdrop {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: flex-start;
justify-content: flex-end;
z-index: 1000;
padding: 60px 16px 16px 16px;
}
.panel {
position: absolute;
top: calc(100% + 8px);
right: 0;
background: white;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 320px;
max-height: calc(100vh - 80px);
width: 320px;
overflow: hidden;
animation: slideIn 0.3s ease-out;
z-index: 1000;
}
@keyframes slideIn {
@@ -191,12 +172,8 @@
}
@media (max-width: 480px) {
.backdrop {
padding: 40px 12px 12px 12px;
}
.panel {
max-width: 100%;
width: 280px;
}
.user-item {

View File

@@ -2,11 +2,11 @@
import '../app.css';
import favicon from '$lib/assets/favicon.svg';
import { Header } from '$lib';
import { page } from '$app/stores';
import { page } from '$app/state';
let { children, data } = $props();
let isLoginRoute = $derived($page.url.pathname.startsWith('/login'));
let isLoginRoute = $derived(page.url.pathname.startsWith('/login'));
let showHeader = $derived(!isLoginRoute && data?.user);
</script>

View File

@@ -3,6 +3,7 @@ import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async (event) => {
if (!event.locals.user) {
// if not logged in, redirect to login page
return redirect(302, '/login');
}

View File

@@ -9,7 +9,6 @@
<style>
.home-container {
min-height: 100vh;
background-color: #f8f8f8;
}

View File

@@ -10,7 +10,7 @@
<h1 class="login-title">Serengo</h1>
<form class="login-form" method="post" action="?/login" use:enhance>
<Input name="username" type="text" placeholder="Username or Email" required />
<Input name="username" type="text" placeholder="Username" required />
<Input name="password" type="password" placeholder="Password" required />
@@ -56,6 +56,5 @@
.button-group {
display: flex;
gap: 1rem;
margin-top: 1rem;
}
</style>

View File

@@ -1,7 +1,7 @@
{
"short_name": "Serengo",
"name": "Serengo",
"description": "Meet the unexpected.",
"description": "meet the unexpected.",
"icons": [
{
"src": "/favicon-64x64.png",

View File

@@ -4,6 +4,6 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
preview: {
allowedHosts: ['serengo.ziasvannes.tech']
allowedHosts: ['ziasvannes.tech']
}
});