Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Savy011/acm-website-tanstack.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980import { openapi as createOpenAPI } from "@elysiajs/openapi";import { elysiaLogger } from "@logtape/elysia";import { configure, getConsoleSink } from "@logtape/logtape";import { prettyFormatter } from "@logtape/pretty";import * as z from "zod";
let loggerConfigured = false;
export const configureLogger = async () => { if (loggerConfigured) return; await configure({ reset: import.meta.env.DEV, sinks: { console: getConsoleSink({ formatter: prettyFormatter, }), }, loggers: [ { category: ["logtape", "meta"], sinks: ["console"], lowestLevel: "warning", }, { category: "elysia", sinks: ["console"], lowestLevel: "info" }, ], });
loggerConfigured = true;};
export const logger = () => elysiaLogger();
export const openapi = createOpenAPI({ path: "/docs", documentation: { info: { title: "PEC ACM Community Management & Events Platform API", description: `A REST API for managing community members, events, and user engagement for ACM at Punjab Engineering College.## AuthenticationMost endpoints require JWT authentication. Obtain a token via the \`POST /v1/user/login\` endpoint and include it in the \`Authorization\` header as a Bearer token.
## Response FormatAll responses follow a consistent JSON structure with appropriate HTTP status codes and error messages.`, version: "1.0.0", license: { name: "MIT", url: "https://github.com/PEC-CSS/acm-website-backend/blob/main/LICENSE", }, contact: { name: "PEC ACM Webmaster", email: "bruh@example.com", }, }, components: { securitySchemes: { bearerAuth: { type: "http", scheme: "Bearer", bearerFormat: "JWT", }, }, }, tags: [ { name: "Authentication", description: "Endpoints for user authentication, token verification, and session management. Includes user login, email verification, and ~~password reset~~ operations.", }, { name: "Health", description: "Endpoints for monitoring service health and status. Includes health checks, uptime information, and upstream dependency status.", }, ], }, mapJsonSchema: { zod: z.toJSONSchema, },});