diff --git a/.env.example b/.env.example index 0631423..87ac666 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,30 @@ -DATABASE_URL="postgres://root:mysecretpassword@localhost:5432/local" -POSTGRES_USER=root -POSTGRES_PASSWORD=mysecretpassword -POSTGRES_DB=local -PROJECT_TOKEN=CHROMATIC_PROJECT_TOKEN +# Chromatic token +PROJECT_TOKEN=**************************** + +# Recommended for most uses +DATABASE_URL=**************************** + +# For uses requiring a connection without pgbouncer +DATABASE_URL_UNPOOLED=**************************** + +# Parameters for constructing your own connection string +PGHOST=**************************** +PGHOST_UNPOOLED=**************************** +PGUSER=**************************** +PGDATABASE=**************************** +PGPASSWORD=**************************** + +# Parameters for Vercel Postgres Templates +POSTGRES_URL=**************************** +POSTGRES_URL_NON_POOLING=**************************** +POSTGRES_USER=**************************** +POSTGRES_HOST=**************************** +POSTGRES_PASSWORDL=**************************** +POSTGRES_DATABASEL=**************************** +POSTGRES_URL_NO_SSL=**************************** +POSTGRES_PRISMA_URL=**************************** + +# Neon Auth environment variables for Next.js +NEXT_PUBLIC_STACK_PROJECT_ID=**************************** +NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=**************************************** +STACK_SECRET_SERVER_KEY=*********************** diff --git a/Dockerfile b/Dockerfile index 1d719cd..a7b0188 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ 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 ./ diff --git a/docker-compose.yml b/docker-compose.yml index 9eb11a9..8433ee6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,26 +1,7 @@ services: - db: - image: postgres - restart: always - ports: - - 5432:5432 - env_file: - - .env - environment: - POSTGRES_USER: ${POSTGRES_USER:-root} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-mysecretpassword} - POSTGRES_DB: ${POSTGRES_DB:-local} - volumes: - - pgdata:/var/lib/postgresql/data app: build: . ports: - 3000:3000 env_file: - .env - environment: - DATABASE_URL: postgres://${POSTGRES_USER:-root}:${POSTGRES_PASSWORD:-mysecretpassword}@db:5432/${POSTGRES_DB:-local} - depends_on: - - db -volumes: - pgdata: diff --git a/src/app.css b/src/app.css index e69de29..97e8a0f 100644 --- a/src/app.css +++ b/src/app.css @@ -0,0 +1,43 @@ +@font-face { + font-family: 'Washington'; + src: url('/fonts/Washington.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + line-height: 1.5; + background-color: #f8f8f8; + color: #333; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: 'Washington', serif; + font-weight: normal; +} + +button { + cursor: pointer; + font-family: inherit; +} + +input { + font-family: inherit; +} + +a { + color: inherit; + text-decoration: none; +} diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index a3138d7..5aa08b6 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -1,21 +1,42 @@ -

Login/Register

-
- - - - -
-

{form?.message ?? ''}

+
+

Serengo

+ +
+
+ +
+ +
+ +
+ +
+ + +
+
+ + {#if form?.message} +

{form.message}

+ {/if} +
diff --git a/src/routes/login/login.css b/src/routes/login/login.css new file mode 100644 index 0000000..e21bec5 --- /dev/null +++ b/src/routes/login/login.css @@ -0,0 +1,115 @@ +.login-container { + display: flex; + flex-direction: column; + min-height: 100vh; + padding: 4rem 2rem; + background-color: #f8f8f8; + align-items: center; + justify-content: flex-start; + max-width: 400px; + margin: 0 auto; +} + +.login-title { + font-family: 'Washington', serif; + font-size: 3.5rem; + color: #000000; + margin-bottom: 6rem; + text-align: center; + font-weight: normal; + letter-spacing: -0.02em; +} + +.login-form { + display: flex; + flex-direction: column; + width: 100%; + gap: 1.5rem; +} + +.input-group { + display: flex; + flex-direction: column; +} + +.input-field { + padding: 1.25rem 1.5rem; + border: none; + border-radius: 2rem; + background-color: #e0e0e0; + font-size: 1rem; + color: #333; + outline: none; + transition: background-color 0.2s ease; + height: 3.5rem; +} + +.input-field:focus { + background-color: #d5d5d5; +} + +.input-field::placeholder { + color: #888; +} + +.button-group { + display: flex; + gap: 1rem; +} + +.login-button, +.register-button { + flex: 1; + padding: 1.25rem 2rem; + border: none; + border-radius: 2rem; + font-size: 1rem; + font-weight: 500; + transition: all 0.2s ease; + cursor: pointer; + height: 3.5rem; +} + +.login-button { + background-color: #3a4553; + color: white; +} + +.login-button:hover { + background-color: #2d3441; + transform: translateY(-1px); +} + +.register-button { + background-color: #3a4553; + color: white; +} + +.register-button:hover { + background-color: #2d3441; + transform: translateY(-1px); +} + +.error-message { + color: #e53e3e; + font-size: 0.875rem; + text-align: center; + margin-top: 1rem; + padding: 0.5rem; +} + +/* Mobile responsiveness */ +@media (max-width: 480px) { + .login-container { + padding: 3rem 1.5rem; + } + + .login-title { + font-size: 3rem; + margin-bottom: 4rem; + } + + .button-group { + margin-top: 3rem; + } +} diff --git a/src/stories/Login.stories.svelte b/src/stories/Login.stories.svelte new file mode 100644 index 0000000..0bf3b9f --- /dev/null +++ b/src/stories/Login.stories.svelte @@ -0,0 +1,35 @@ + + + + + diff --git a/src/stories/Login.svelte b/src/stories/Login.svelte new file mode 100644 index 0000000..182f278 --- /dev/null +++ b/src/stories/Login.svelte @@ -0,0 +1,47 @@ + + +
+

Serengo

+ + + + {#if errorMessage} +

{errorMessage}

+ {/if} +
diff --git a/static/fonts/Washington.ttf b/static/fonts/Washington.ttf new file mode 100644 index 0000000..fd34243 Binary files /dev/null and b/static/fonts/Washington.ttf differ