Skip to content

chore: align codebase and docs for Vite SPA runtime#11

Merged
ilramdhan merged 1 commit intomainfrom
codex/audit-next.js-files-and-usage
Mar 4, 2026
Merged

chore: align codebase and docs for Vite SPA runtime#11
ilramdhan merged 1 commit intomainfrom
codex/audit-next.js-files-and-usage

Conversation

@ilramdhan
Copy link
Copy Markdown
Owner

Motivation

  • Remove leftover Next.js/SSR artifacts so the repository clearly reflects the Vite client-rendered SPA runtime.
  • Ensure SSR-only helpers are not accidentally included in the production import path by archiving them outside lib/.
  • Update documentation to accurately describe the runtime, auth flow, data layer, and deployment model.

Description

  • Moved the Next.js-oriented Supabase helper from lib/supabase/server.ts to experimental/supabase/server.ts and left the SSR-specific implementation commented/disabled to avoid runtime imports.
  • Removed redundant top-of-file directives "use client" / 'use client' from app pages, components, and libs so files start with normal imports (examples: app/page.tsx, components/Navbar.tsx, lib/auth.tsx).
  • Updated README.md project-structure entry for actions/ to reflect SPA usage and added an experimental/ folder to the structure section.
  • Added docs/architecture.md containing the architecture decision record describing rendering strategy, auth flow, data layer, and deployment model for the SPA runtime.

Testing

  • Ran rg -n "'use client'|\"use client\"" to verify there are no remaining use client directives and it returned no matches (success).
  • Ran npm run build (TypeScript compile + vite build) and the production build completed successfully (build succeeded with standard size warnings).

Codex Task

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ilramdhan.dev Ready Ready Preview, Comment Mar 4, 2026 0:34am

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ilramdhan ilramdhan requested a review from Copilot March 4, 2026 12:35
@ilramdhan ilramdhan self-assigned this Mar 4, 2026
@ilramdhan ilramdhan merged commit cf4b341 into main Mar 4, 2026
4 checks passed
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Mar 4, 2026

Code Review Summary

Status: 1 Warning Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
package.json 15, 18, 24 Unused dependencies: @supabase/ssr (only in archived experimental code), @vercel/node (not used - Vite SPA doesn't use Vercel server functions), next-themes (not imported - app uses custom ThemeContext)
Other Observations (not in diff)

The PR correctly removes 'use client' directives from multiple files. This is appropriate for a Vite + React SPA (not Next.js). The files use React hooks directly which works fine in client-side React.

The architectural changes are sound:

  • Creating docs/architecture.md properly documents the SPA runtime model
  • Moving lib/supabase/server.ts to experimental/supabase/server.ts appropriately archives unused SSR-related code
  • The README updates accurately reflect the current project structure
Files Reviewed (12 files)
  • README.md - Documentation update
  • app/admin.tsx - Removed 'use client' directive
  • app/login.tsx - Removed 'use client' directive
  • app/page.tsx - Removed 'use client' directive
  • app/privacy.tsx - Removed 'use client' directive
  • app/project-detail.tsx - Removed 'use client' directive
  • app/terms.tsx - Removed 'use client' directive
  • components/ContactForm.tsx - Removed 'use client' directive
  • components/ImageCarousel.tsx - Removed 'use client' directive
  • components/Navbar.tsx - Removed 'use client' directive
  • components/ProjectCard.tsx - Removed 'use client' directive
  • docs/architecture.md - New architecture documentation
  • lib/ThemeContext.tsx - Removed 'use client' directive
  • lib/auth.tsx - Removed 'use client' directive
  • package.json - Dependency review

Recommendation: Consider removing unused dependencies (@supabase/ssr, @vercel/node, next-themes) to reduce bundle size and improve maintainability. The PR otherwise represents a clean architectural improvement for a Vite SPA project.

Fix these issues in Kilo Cloud

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes leftover Next.js/SSR artifacts and updates documentation so the repository clearly represents a Vite-powered, client-rendered SPA runtime (with SSR-only helpers archived outside the main lib/ path).

Changes:

  • Removed 'use client' directives from pages, components, and library modules.
  • Archived the Supabase SSR/Next.js server helper into experimental/ and added an SPA-unsupported stub export.
  • Updated runtime documentation (README structure + new docs/architecture.md ADR).

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/auth.tsx Removes 'use client' directive to reflect non-Next/Vite SPA runtime.
lib/ThemeContext.tsx Removes 'use client' directive.
components/ProjectCard.tsx Removes 'use client' directive.
components/Navbar.tsx Removes 'use client' directive.
components/ImageCarousel.tsx Removes 'use client' directive.
components/ContactForm.tsx Removes 'use client' directive.
app/page.tsx Removes 'use client' directive.
app/login.tsx Removes 'use client' directive.
app/admin.tsx Removes 'use client' directive.
app/privacy.tsx Removes 'use client' directive.
app/terms.tsx Removes 'use client' directive.
app/project-detail.tsx Removes 'use client' directive.
experimental/supabase/server.ts Adds an archived SSR helper module (currently disabled) and a stub createClient that throws in Vite.
docs/architecture.md Adds an ADR documenting SPA rendering/auth/data/deployment assumptions.
README.md Updates project structure notes for SPA usage and adds experimental/ to the structure listing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/architecture.md
Comment on lines +19 to +21
- Built as static assets using Vite (`npm run build`) and deployed as a static web app.
- Platform configuration (for example on Vercel) serves the SPA entry point and static assets.
- Experimental SSR-oriented modules are kept outside the production import path to avoid ambiguity in runtime expectations.
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The architecture doc describes deployment as “static assets … deployed as a static web app,” but the repo also contains Vercel serverless API routes (e.g., /api/wakatime.ts) and vercel.json routes /api/*. Consider updating this section to acknowledge the mixed model (static SPA + serverless endpoints) so the runtime/deployment expectations are accurate.

Suggested change
- Built as static assets using Vite (`npm run build`) and deployed as a static web app.
- Platform configuration (for example on Vercel) serves the SPA entry point and static assets.
- Experimental SSR-oriented modules are kept outside the production import path to avoid ambiguity in runtime expectations.
- The frontend is built as static assets using Vite (`npm run build`) and deployed as a static web app.
- On platforms like Vercel, the SPA entry point and static assets are served statically, while requests under `/api/*` are handled by serverless API routes (for example, `/api/wakatime.ts`).
- No server-side rendering (SSR) is used for page rendering in production; experimental SSR-oriented modules are kept outside the production import path to avoid ambiguity in runtime expectations.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants