@vivekcsein-logo
  • Home
  • About
  • Development

    • Web Development
    • Performance & Optimization
    • Backend & APIs
    • Authentication & Security

    Specialized

    • SEO & Ad Monetization
    • AR Experiences
    • Animation
    • Figma to Code
  • Articles
  • Projects
  • Marketplace
  • Contact
@vivekcsein-logo

A portfolio full stack developer with a passion for building scalable and high-performance web applications.

Explore

  • Home
  • About

Services

  • Web Development
  • Backend & APIs
  • Performance Optimization
  • Security & Authentication

Connect

  • Contact
  • Privacy
  • Terms
  • Home
  • About
  • Web Development
  • Backend & APIs
  • Performance Optimization
  • Security & Authentication
  • Contact
  • Privacy
  • Terms

© @vivekcsein. All rights reserved.

  • Home
  • All Articles47
  • Featured
  • Recently Added
  • Most Read
  • Bookmarks
Topics
  • Interview3
  • 3d4
  • Ai Prompts2
  • Business3
  • Deployment1
  • Dev2
  • Frontend5
    • JavaScript & React Errors Handbook
    • Folder Structure Guide
    • Modern Frontend Development Standards & Implementation Guide
    • React Hooks — The Complete Beginner's Guide (2026 Edition)
    • Reusable UI Layout Components
  • Getting Started2
  • Security2
  • Seo2
  • Workflow10
  • Backend1
  • Deployment1
  • Security1
  • Javascript1
  • Client Advisory5
  • Engineering2
Collections
  • Docs
  • Tutorials
  • Resources
  • Articles
“A better developer every single day.”
— Vivek
  1. Docs
  2. Frontend
  3. Folder Structure Guide
Frontend

Folder Structure Guide

The mandatory folder layout for backend (Hono and Bun) and frontend projects, with no deviations allowed without a documented reason in the README.

Updated Sep 12, 20264 min read
On this page

On this page

  • 1. FOLDER STRUCTURE FOR BACKEND PROJECTS
  • 2. FOLDER STRUCTURE FOR FRONTEND PROJECTS

⛔ HARD — All projects must follow this layout. No deviations without a documented reason in README.md.

1. FOLDER STRUCTURE FOR BACKEND PROJECTS#

text
<project-root>/
│
├── src/
│   │
│   ├── app/
│   │   ├── app.ts                    # Create and configure Hono app
│   │   ├── server.ts                 # Bun development server
│   │   │
│   │   ├── api/
│   │   │
│   │   ├── auth/
│   │   │   ├── route.ts
│   │   │   ├── controller.ts
│   │   │   ├── service.ts
│   │   │   ├── repository.ts
│   │   │   ├── middleware.ts
│   │   │   ├── types.ts
│   │   │   └── index.ts
│   │   │
│   │   ├── users/
│   │   │   ├── route.ts
│   │   │   ├── controller.ts
│   │   │   ├── service.ts
│   │   │   ├── repository.ts
│   │   │   └── index.ts
│   │   │
│   │   ├── storage/
│   │   ├── admin/
│   │   ├── websocket/
│   │   ├── chat-server/
│   │   ├── game-server/
│   │   └── voice-server/
│   │
│   ├── packages/
│   │
│   │   ├── api/
│   │   │   ├── axios.api.ts
│   │   │   └── hono.api.ts
│   │   │
│   │   ├── configs/
│   │   │   ├── app.config.ts
│   │   │   ├── database.config.ts
│   │   │   ├── auth.config.ts
│   │   │   └── constants.ts
│   │   │
│   │   ├── database/
│   │   │   ├── client.ts
│   │   │   ├── schema/
│   │   │   ├── seed/
│   │   │   └── migrations/
│   │   │
│   │   ├── env/
│   │   │   └── app.env.ts
│   │   │
│   │   ├── middlewares/
│   │   │   ├── cors.ts
│   │   │   ├── logger.ts
│   │   │   ├── request-id.ts
│   │   │   ├── secure-headers.ts
│   │   │   ├── rate-limit.ts
│   │   │   ├── validator.ts
│   │   │   └── error-handler.ts
│   │   │
│   │   ├── responses/
│   │   │   ├── success.ts
│   │   │   ├── error.ts
│   │   │   └── pagination.ts
│   │   │
│   │   ├── errors/
│   │   │   ├── app.error.ts
│   │   │   ├── validation.error.ts
│   │   │   ├── unauthorized.error.ts
│   │   │   └── not-found.error.ts
│   │   │
│   │   ├── utils/
│   │   │   ├── app.utils.ts
│   │   │   ├── crypto.utils.ts
│   │   │   ├── jwt.utils.ts
│   │   │   ├── cookie.utils.ts
│   │   │   ├── string.utils.ts
│   │   │   └── date.utils.ts
│   │   │
│   │   ├── forms/
│   │   │
│   │   ├── schemas/
│   │   │
│   │   └── validators/
│   │
│   ├── assets/
│   │   ├── css/
│   │   ├── email/
│   │   ├── html/
│   │   └── images/
│   │
│   └── types/
│       ├── api.d.ts
│       ├── auth.d.ts
│       ├── env.d.ts
│       └── global.d.ts
│
├── public/
│
├── tests/
│   ├── unit/
│   ├── integration/
│   └── e2e/
│
├── .env
├── .env.example
├── .gitignore
├── biome.json
├── bunfig.toml
├── package.json
├── tsconfig.json
├── tsconfig.build.json
├── vercel.json
├── index.ts
├── README.md
└── AGENT.md

2. FOLDER STRUCTURE FOR FRONTEND PROJECTS#

text
<project-root>/
├── src/
│   ├── app/                          # Core application shell
│   │   ├── app.tsx                   # Root <App /> component
│   │   ├── api/                      # REST / GraphQL route handlers
│   │   │   └── [resource]/
│   │   │       ├── route.ts
│   │   │       └── [resource].service.ts
│   │   ├── game-server/              # Colyseus multiplayer (optional)
│   │   ├── chat-server/              # WebSocket chat (optional)
│   │   └── voice-server/             # Voice integration (optional)
│   │
│   ├── components/
│   │   ├── features/                 # Domain-specific composite components
│   │   │   └── [feature-name]/
│   │   │       ├── index.ts
│   │   │       ├── [Feature].tsx
│   │   │       └── [Feature].test.tsx
│   │   ├── layouts/
│   │   │   └── AppClientLayout.tsx
│   │   ├── providers/
│   │   │   ├── ThemeProvider.tsx
│   │   │   └── AuthProvider.tsx
│   │   └── ui/
│   │       ├── buttons/
│   │       ├── inputs/
│   │       ├── images/
│   │       ├── svg/
│   │       ├── Shadcn/
│   │       └── index.ts
│   │
│   ├── packages/
│   │   ├── api/
│   │   │   └── axios.api.ts
│   │   ├── configs/
│   │   │   └── db.config.ts
│   │   ├── utils/
│   │   │   ├── shadcn.ts
│   │   │   └── format.ts
│   │   ├── hooks/
│   │   │   └── useBreakPoints.ts
│   │   ├── shadcn/
│   │   ├── env/
│   │   │   └── app.env.ts
│   │   ├── forms/
│   │   │   └── [FormName].form.ts
│   │   └── schemas/
│   │       └── [resource].schema.ts
│   │
│   ├── styles/
│   │   ├── globals.css               # Tailwind @import, CSS vars, base resets
│   │   ├── ui.css                    # CSS for components/ui
│   │   ├── app.css                   # CSS for rest of application
│   │   └── animation.css             # All animation keyframes & GSAP helpers
│   │
│   ├── types/
│   │   ├── api.d.ts
│   │   ├── env.d.ts
│   │   └── global.d.ts
│   │
│   ├── main.tsx
│   └── index.css
│
├── public/
├── tests/e2e/
├── .env.example
├── .env.local
├── .eslintrc.json
├── .prettierrc
├── components.ts
├── bunfig.toml
├── next.config.ts
├── tailwind.config.ts
├── tsconfig.json
├── AGENT.md
└── README.md
PreviousJavaScript & React Errors HandbookNext Modern Frontend Development Standards & Implementation Guide

Keep reading

  • Frontend

    Modern Frontend Development Standards & Implementation Guide

    A Q&A guide to building reusable, responsive, themeable and SEO-friendly Next.js apps: consistent design, layouts, and how to add or edit pages and sections.

    12 min read·Sep 12, 2026
  • Frontend

    JavaScript & React Errors Handbook

    Why common JavaScript and React errors happen and how to fix them: undefined properties, non-functions, const reassignment, re-renders, hooks rules, try/catch and more.

    9 min read·Sep 12, 2026
  • Frontend

    React Hooks — The Complete Beginner's Guide (2026 Edition)

    A complete beginner's guide to React hooks in TypeScript, from useState and useEffect to React 19's useActionState, useOptimistic and use(), plus custom hooks.

    39 min read·Sep 12, 2026

On this page

  • 1. FOLDER STRUCTURE FOR BACKEND PROJECTS
  • 2. FOLDER STRUCTURE FOR FRONTEND PROJECTS