Compare commits

...

3 Commits
0.0.2 ... 0.0.3

Author SHA1 Message Date
Levente Orban
fefca207c5 feat: remove or refactor unused console.logs 2025-08-27 22:39:42 +02:00
Levente Orban
e89c9b1843 feat: add docker DATABASE_URL 2025-08-27 22:35:21 +02:00
Levente Orban
4b14f649d6 fix: docker-compose renames and fixes 2025-08-27 22:34:06 +02:00
5 changed files with 12 additions and 14 deletions

View File

@@ -4,7 +4,10 @@ POSTGRES_USER=cactoide
POSTGRES_PASSWORD=cactoide_password
POSTGRES_PORT=5432
# localhost
DATABASE_URL="postgres://cactoide:cactoide_password@localhost:5432/cactoied_database"
# docker
# DATABASE_URL="postgres://cactoide:cactoide_password@postgres:5432/cactoied_database"
# Application configuration
APP_VERSION=latest

View File

@@ -6,11 +6,11 @@ services:
image: postgres:15-alpine
container_name: cactoide-db
environment:
POSTGRES_DB: ${POSTGRES_DB:-cactoied_database}
POSTGRES_DB: ${POSTGRES_DB:-cactoide_database}
POSTGRES_USER: ${POSTGRES_USER:-cactoide}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cactoide_password}
ports:
- '${POSTGRES_PORT:-5432}:5432'
expose:
- '${POSTGRES_PORT:-5437}'
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
@@ -18,7 +18,7 @@ services:
test:
[
'CMD-SHELL',
'pg_isready -U ${POSTGRES_USER:-cactoide} -d ${POSTGRES_DB:-cactoied_database}'
'pg_isready -U ${POSTGRES_USER:-cactoide} -d ${POSTGRES_DB:-cactoide_database}'
]
interval: 10s
timeout: 5s
@@ -31,9 +31,9 @@ services:
image: ghcr.io/polaroi8d/cactoide/cactoide:${APP_VERSION:-latest}
container_name: cactoide-app
ports:
- '${PORT:-3000}:3000'
- '${PORT:-5111}:3000'
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-cactoide}:${POSTGRES_PASSWORD:-cactoide_password}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-cactoied_database}
DATABASE_URL: ${DATABASE_URL}
PORT: 3000
HOSTNAME: ${HOSTNAME:-0.0.0.0}
depends_on:

View File

@@ -9,11 +9,11 @@ export function load({ cookies }) {
const PATH = '/';
if (!cactoideUserId) {
console.log(`There is no cactoideUserId cookie, generating new one...`);
console.debug(`There is no cactoideUserId cookie, generating new one...`);
cookies.set('cactoideUserId', userId, { path: PATH, maxAge: MAX_AGE });
} else {
console.log(`cactoideUserId: ${cactoideUserId}`);
console.log(`cactoideUserId cookie found, using existing one...`);
console.debug(`cactoideUserId: ${cactoideUserId}`);
console.debug(`cactoideUserId cookie found, using existing one...`);
}
return {

View File

@@ -17,8 +17,6 @@ export const load = async ({ cookies }) => {
.where(eq(events.userId, userId))
.orderBy(desc(events.createdAt));
console.log(userEvents);
const transformedEvents = userEvents.map((event) => ({
id: event.id,
name: event.name,

View File

@@ -75,9 +75,6 @@ export const actions: Actions = {
const name = formData.get('newAttendeeName') as string;
const userId = cookies.get('cactoideUserId');
console.log(`name: ${name}`);
console.log(`userId: ${userId}`);
if (!name?.trim() || !userId) {
return fail(400, { error: 'Name and user ID are required' });
}