How Do You Organize Your Frontend Project Folders in 2025?

September 9, 2025 4 answers
Asked by CuriousCoder92
I'm really interested in seeing how everyone is structuring their frontend project folders in 2025, whether you're using React, Next.js, Vite, Svelte, Vue, or something else. Could you share your `src/` folder structure? It would be great if you could also explain a few reasons behind your choices, like if you're going for a domain-driven structure, colocation of tests, or specific naming conventions. Here's how I've structured mine with Next.js: src โ”œโ”€โ”€ analytics # for event tracking and metrics โ”œโ”€โ”€ api # handles API integrations both for my own backends and external services โ”œโ”€โ”€ app # where my Next.js pages live โ”œโ”€โ”€ assets # holds static files like styles, images, fonts, and icons โ”œโ”€โ”€ auth # all authentication logic can be found here โ”œโ”€โ”€ components # basic UI components that make up my UI kit โ”œโ”€โ”€ i18n # for internalization purposes โ”œโ”€โ”€ utils # generic helper functions and hooks โ””โ”€โ”€ widgets # specific UI building blocks for the project I designed my structure this way because it helps with easy navigation (having big features upfront like auth and analytics), separates reusable code, and establishes a clear hierarchy from components to pages. I also used a command to print this tree: `npx tree-node-cli ./src -L 1 -d`. Would love to see your setups!

Answers

JSWhizkid23
Just wanted to point out that I keep my assets directory outside of `src/`, and actually restrict access to the whole `src` directory. It's probably not the best setup, but it works for me.
Reply to this answer
DevExplorer77
I like your structure! Iโ€™ve been using something similar, but I don't have an analytics folderโ€”my tracking code is usually embedded directly. I do maintain a `routes` folder for components that map to URLs in my app. And I'm curious about what you consider `widgets`โ€”to me, they seem like they'd fit under `components`.

FrontendFanatic88: We separate widgets to indicate they are higher-level components made up of multiple simpler components, while the components serve as reusable UI elements like buttons or forms.

Reply to this answer
FrontendFanatic88
I've recently adopted the Feature-Sliced Design for organizing my folders. It really helps with project scalability! You can check out the specifics here: https://feature-sliced.github.io/documentation/docs/get-started/overview.
Reply to this answer
VueNinja42
Here's my setup: src โ”œโ”€โ”€ api # files for fetching content from REST/BBD โ”œโ”€โ”€ assets # for static files โ”œโ”€โ”€ components # reusable components like SearchBar, ShareButton, etc. โ”œโ”€โ”€ composables # holds reusable Vue bits โ”œโ”€โ”€ routes # all route definitions โ”œโ”€โ”€ stores # state management here โ”œโ”€โ”€ utilities # utility functions โ””โ”€โ”€ views # view templates that act as pages It's a pretty standard organization for Vue projects. Just keeps things clean!

VueRookie24: What's inside the `composables` folder?

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions