How wiscaksono/wiscaksono-site works
Main Components Identification
• Content Management: Content stored as markdown files in src/contents (subdirectories for abouts, articles, projects). This content is processed with mdsvex and is rendered on the frontend. It may include static assets (images, preview snapshots) from the static directory.
• Backend & API Layer: SvelteKit endpoints handling authentication (routes/api/auth and its callback), error pages, and data fetching logic (server files in src/routes and hooks.server.ts). This layer acts as an interface between the UI and server-side logic.
• Database & ORM: Database interactions are managed using Drizzle ORM. This includes DB schema definitions, session management, and user handling in src/lib/server/db. The server folder organizes these concerns clearly.
• Authentication & External Services: Integration with Lucia Auth (detailed in the README) and possibly other OAuth processes (e.g., src/lib/server/oauth.ts).
Relationships and Interactions
• The UI (components and layouts) renders views based on data from routed pages.
• Dynamic pages (e.g., articles/[slug] or projects/[slug]) dynamically load markdown content from src/contents.
• API routes interact with the backend logic to support authentication and user session management.
• The server components and hooks (e.g., hooks.server.ts) facilitate data fetching, authentication, and middleware functions.
• The ORM layer abstracts database transactions; the UI indirectly triggers database calls via endpoints or server hooks.
Architectural Patterns and Design Principles
• Separation of Concerns: The project cleanly separates content (markdown files), presentation (Svelte components and layouts), and backend logic (API endpoints, authentication, DB operations).
• File-Based Routing: Leveraging SvelteKit’s file-based routing to map URL paths to corresponding components.
• Component-Based UI: Modular Svelte components (e.g., header, navbar, layout) make the UI highly composable.
• Data Flow: Static and dynamic content (sourced from markdown or the database) flows through the server layer to the UI, managed by directional routing and API calls.
Relevant Technologies and Frameworks
• SvelteKit for the frontend application and routing.
• mdsvex for converting markdown files into Svelte components.
• Drizzle ORM for database schema, queries, and entity management.
• Lucia Auth for user authentication and session management.
• Tailwind CSS for styling.
• Vite, TypeScript, and various linting/prettier configurations for build and development processes.
• GitHub configuration files indicate continuous integration and dependency management.
Detailed Component Breakdown
• Content: Represent the src/contents folder structure, illustrating that it contains markdown sources for different sections (abouts, articles, projects).
• Backend/API: Include the routes/api folder, noting authentication endpoints and other potential API gateways.
• Database & Services: On the backend side, include a node for Drizzle ORM usage, with schema definitions, session management, and user database components.
• External Libraries/Services: Optionally add nodes for Lucia Auth, mdsvex, and Tailwind CSS to indicate they are foundational to specific system functions.