Project Structure

CursorLens follows a typical Next.js project structure with some additional directories for backend functionality. Here's an overview of the main directories and their purposes

CursorLens/
├── app/
│ ├── [...openai]/
│ │ └── route.ts
│ ├── api/
│ │ ├── chat/
│ │ ├── configurations/
│ │ ├── logs/
│ │ ├── stats/
│ │ └── test/
│ ├── configurations/
│ │ └── page.tsx
│ ├── logs/
│ │ ├── [id]/
│ │ │ └── page.tsx
│ │ ├── LogsList.tsx
│ │ └── page.tsx
│ ├── stats/
│ │ └── page.tsx
│ ├── actions.ts
├── components/
│ ├── ui/
│ │ └── # Various UI components
│ ├── NavBar.tsx
│ ├── theme-provider.tsx
│ └── theme-toggle.tsx
└── lib/
├── db.ts
├── prisma.ts

Key directories and files:

  • app/: Contains the main application code using Next.js 13+ App Router
    • [...openai]/: Catch-all route for OpenAI-related functionality
    • api/: API routes for various functionalities
    • configurations/, logs/, stats/: Page components for different sections
    • actions.ts: Server actions (new in Next.js 13)
    • layout.tsx: Root layout component
    • page.tsx: Home page component
  • components/: Reusable React components
    • ui/: UI components, likely using a component library
  • lib/: Utility functions and shared logic
    • db.ts and prisma.ts: Database and Prisma ORM setup
    • utils.ts: General utility functions

This structure leverages Next.js 13+ features like App Router and server components, organizing the application into logical sections for API routes, pages, and shared components.