Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/large-carpets-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@reafrac/logger': major
---

add centralize logging package shared accross the apps
4 changes: 2 additions & 2 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
permissions:
id-token: write
contents: read
pull-requests: read
issues: read
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v6
with:
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ COPY apps/content-proxy/package.json ./apps/content-proxy/
COPY packages/database/package.json ./packages/database/
COPY packages/feed-utils/package.json ./packages/feed-utils/
COPY packages/external-script/package.json ./packages/external-script/
COPY packages/logger/package.json ./packages/logger/

# Install dependencies (including devDependencies for build)
RUN bun install --linker hoisted --frozen-lockfile
Expand All @@ -27,14 +28,15 @@ COPY apps/content-proxy/ ./apps/content-proxy/
COPY packages/database/ ./packages/database/
COPY packages/feed-utils/ ./packages/feed-utils/
COPY packages/external-script/ ./packages/external-script/
COPY packages/logger/ ./packages/logger/

# Build application with version injection
ARG BUILD_VERSION
ARG BUILD_DATE
ARG VITE_APP_VERSION
ENV NODE_ENV=production
ENV VITE_APP_VERSION=${VITE_APP_VERSION:-dev}
RUN bun run build --filter=@reafrac/web --filter=@reafrac/database --filter=@reafrac/feed-utils
RUN bun run build --filter=@reafrac/web --filter=@reafrac/database --filter=@reafrac/feed-utils --filter=@reafrac/logger

FROM base AS dependencies

Expand All @@ -47,6 +49,7 @@ COPY apps/content-proxy/package.json ./apps/content-proxy/
COPY packages/database/package.json ./packages/database/
COPY packages/feed-utils/package.json ./packages/feed-utils/
COPY packages/external-script/package.json ./packages/external-script/
COPY packages/logger/package.json ./packages/logger/

RUN bun install --linker hoisted --frozen-lockfile --production

Expand All @@ -70,10 +73,11 @@ COPY --from=builder /app/turbo.json ./
# Copy node_modules from dependencies stage
COPY --from=dependencies /app/node_modules ./node_modules

# Copy workspace packages (needed for workspace symlinks)
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/tsconfig.base.json ./tsconfig.base.json

RUN rm -rf packages/*/node_modules packages/*/*/node_modules

# Switch to non-root user (bun user already exists in image)
USER bun

Expand Down
1 change: 1 addition & 0 deletions apps/content-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@elysiajs/openapi": "^1.4.11",
"@reafrac/external-script": "workspace:*",
"@reafrac/feed-utils": "workspace:*",
"@reafrac/logger": "workspace:*",
"elysia": "~1.4.16",
"zod": "^4.1.12"
},
Expand Down
13 changes: 8 additions & 5 deletions apps/content-proxy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { extractFeed, parsedFeedSchema, extractArticle } from '@reafrac/feed-uti
import { Elysia } from 'elysia';
import { openapi } from '@elysiajs/openapi';
import { z } from 'zod';
import { createLogger } from '@reafrac/logger';

const log = createLogger({ name: 'content-proxy' });

const app = new Elysia()
.use(
Expand All @@ -20,9 +23,9 @@ const app = new Elysia()
.post(
'/extract-feed',
async ({ body }) => {
console.log('extracting feed: ', body.url);
log.debug({ url: body.url }, 'Extracting feed');
const validated = await extractFeed(body.url);

log.info({ url: body.url }, 'Feed extracted');
return validated;
},
{
Expand All @@ -33,9 +36,9 @@ const app = new Elysia()
.post(
'/extract-article',
async ({ body }) => {
console.log('extracting article: ', body.url);
log.debug({ url: body.url }, 'Extracting article');
const validated = await extractArticle(body.url);

log.info({ url: body.url }, 'Article extracted');
return validated;
},
{
Expand All @@ -60,4 +63,4 @@ const app = new Elysia()
)
.listen(3001);

console.log(`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`);
log.info({ host: app.server?.hostname, port: app.server?.port }, 'Content proxy server running');
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@reafrac/database": "workspace:*",
"@reafrac/external-script": "workspace:*",
"@reafrac/feed-utils": "workspace:*",
"@reafrac/logger": "workspace:*",
"@sentry/tanstackstart-react": "^10.22.0",
"@tailwindcss/vite": "^4.1.16",
"@tanstack/react-devtools": "^0.7.8",
Expand Down
Loading
Loading