
For aReact project in2025, a well-organized folder structure is essential for maintainability, scalability, and ease of collaboration. The structure should be modular, flexible, and adaptable to different types of projects, whether you're building a small app or a large-scale enterprise application.
Here’s an updated folder structure for modern React projects, keeping in mindbest practices,scalability, andperformance:
1.Root Directory
At the root of your project, you should have these typical files and directories:
/my-app ├── /public/ ├── /src/ ├── /assets/ ├── .gitignore ├── package.json ├── README.md ├── tsconfig.json(forTypeScript projects) ├── vite.config.js(forVite projects) └── .eslintrc.json(or .eslint.js)
2.Folder Structure
/public
Thepublic folder contains static files that are served directly to the browser, such as theindex.html
, images, and other assets.
/public ├── index.html ├── favicon.ico └── /images/
/src
Thesrc
folder is where all of your React application code resides. This is where you'll spend most of your time.
/src ├── /assets/# Static assets (images, fonts, etc.) ├── /components/# Reusable components ├── /features/# Feature-specific logic and components (could be feature folders) ├── /hooks/# Custom React hooks ├── /layouts/# Layout components (e.g., Header, Footer, Sidebar) ├── /pages/# Page components (routes) ├── /services/# API requests, utilities, external service integrations ├── /store/# State management (Redux, Zustand, Context API) ├── /styles/# Global styles (CSS, SASS, Styled Components) ├── /types/# TypeScript types (if using TS) ├── /utils/# Utility functions, helpers, and constants ├── /app.tsx# App component (entry point) ├── /index.tsx# Main entry point for React ├── /router.tsx# Routing (React Router setup) └── /config/# Environment variables and configuration files
3. Folder Details
/assets
:- Store images, fonts, and other media assets here.
- It's optional to break this into subfolders (e.g.,
/images
,/fonts
).
/components
:- Contains allreusable UI components that can be shared across different parts of your app.
Example:
/components ├── Button.tsx ├── Modal.tsx └── Navbar.tsx
/features
:- Organize your components, hooks, and logic byfeatures (also calleddomain-based structure). This helps separate code based on functionality rather than by component type, promoting better scalability and maintainability.
Example:
/features ├── /auth/# Authentication-related components, hooks, reducers ├── /dashboard/# Dashboard components, hooks, etc. └── /profile/# Profile-related components
/hooks
:- Storecustom hooks that can be reused across your app, such as data fetching, form handling, etc.
Example:
/hooks ├── useAuth.ts ├── useFetch.ts └── useForm.ts
/layouts
:- Layout components like Header, Sidebar, Footer, etc., that are used across multiple pages.
Example:
/layouts ├── MainLayout.tsx ├── AdminLayout.tsx └── DashboardLayout.tsx
/pages
:- Containspage-level components (typically mapped to routes) that use the components from
/features
or/components
. Example:
/pages ├── Auth/ │ └── SignInPage.tsx │ └── SignUpPage.tsx ├── Dashboard.tsx ├── Home.tsx ├── Users.tsx ├── Prodcuts.tsx └── ContactUs.tsx
- Containspage-level components (typically mapped to routes) that use the components from
/services
:- Functions forAPI requests, integrating third-party services, or utilities that handle external communication.
- This could also be the place for service hooks or API-related logic.
Example:
/services ├── authService.ts# Authentication API └── apiService.ts# General API calls
/store
:- If you’re using astate management solution like Redux, Zustand, or Context API, keep the logic and actions here.
Example (if using Redux):
/store ├── /auth/# Auth-related Redux slices ├── /user/# User-related Redux slices └── store.ts# Global store configuration
/styles
:- Store global styles, theme files, or anyCSS/SASS orCSS-in-JS styles here.
Example:
/styles ├── index.css ├── theme.ts# For theme configuration in styled-components └── global.scss# Global styles for the app
/types
:- If using TypeScript, store your customtypes or interfaces here for easier management and reusability.
Example:
/types ├── auth.d.ts# Types for authentication-related data ├── api.d.ts# Types for API responses └── user.d.ts# Types for user objects
/utils
:- General utility functions that are used across your app (e.g., date formatting, data validation, etc.).
Example:
/utils ├── formatDate.ts └── validateEmail.ts
/config
:- Store environment variables or app configuration settings here, such as the API base URL, feature flags, etc.
Example:
/config ├── index.ts# Export environment variables and configurations ├── config.ts# Configuration file for app set
Conclusion
This folder structure provides a flexible, scalable, and maintainable setup for React applications in 2025. It focuses on:
- Modularity: Organizing by features or domains (vs. just by components).
- Reusability: Components, hooks, and utilities can be easily shared.
- Scalability: As your project grows, the structure allows for easy addition of new features or pages.
- Separation of Concerns: Each part of the app (state, services, components) has its own dedicated space.
This structure works for bothsmall projects andlarge-scale applications. You can always adjust the specifics depending on the complexity and requirements of your app.
Enjoyed this post?
Stay updated with the latest tech trends! Follow me on Instagram: @pramodboda.codevik and @pramodboda.art.
let me know your thoughts! 👇
Top comments(18)

How can this be 100% same like mine, I also prefer this same layout, one thing diff is that I prefer store related slices in their own feature related folder, like authSlice will go in Auth folder.
Great and best folder structure you'll ever see which lists out all aspects with proper example

Thank you for your feedback! I completely agree with organizing slices into their feature-related folders—it’s a great approach for maintaining scalability and readability. The structure I shared is just one way to do it, and your method of placing authSlice in an Auth folder makes a lot of sense, especially for larger projects. It’s all about finding what works best for the team and the project’s needs. Thanks for sharing your perspective!

- PronounsDude
- WorkFull Stack Web Developer.
- Joined
Yes this is a great project structure i used a similar one a couple of times , i would just mention that the context api in the comment is not a a state management like redux ,Context is a form of Dependency Injection that you can handle its state using useReducer, ive tested it out myself and as your project gets bigger its gets worse to handle state management it gets very slow.

A well-structured React project ensures better maintainability and scalability! The feature-based approach is a great way to keep things modular. If you're managing workplace applications, having a secure access system is just as important. Check outOnline health management for more insights on optimizing secure access and user management. 🚀

- LocationNuremberg, Germany
- EducationTechnical University, Sofia, Bulgaria, Microverse Full-stack development program.
- WorkWeb Developer
- Joined
OK, I have a question about tests folder? Where is it? I have heard that there are two main concepts about it - put all the test files intest
or__test__
folder or just have all the.test
filessrc
collocated in the folder. Any comments about that?

- LocationHo Chi Minh, Vietnam 🇻🇳
- WorkFrontend Engineer
- Joined
The article is very good, the project structure is very simple and easy to maintain.

- EducationBachelor's Degree in Computer Engineering @ UFU
- WorkSoftware Engineer @ PicPay
- Joined
Hey@pramod_boda! Awesome article!
I'm currently working on an open-source project to help people organize and structure their React apps! I'd love for you to take a look and share insights -- or even contribute to it with your structure, if you're feeling into it!

- Email
- LocationTunisia
- EducationComputer Science
- WorkStudent at Tunisia
- Joined
tbh a module based or feature based structure should be extended to support more the scalability and the organization
you can supercharge it with a eslint rule where you can import from feature to feature for better isolation
mention to people that every folder outside the feature can be repeated under the feature

ChatGTP suggested this structure.
/my-react-app
│── 📂 src
│ ├── 📂 app
│ │ ├── 📂 routes # All application routes
│ │ ├── 📂 layout # Layout components (Header, Footer, etc.)
│ │ ├── 📂 hooks # Custom hooks
│ │ ├── 📂 providers # Context API Providers
│ │ ├── 📂 services # API calls (GraphQL/REST)
│ │ ├── 📂 store # Global state management (Redux, Zustand, Jotai, etc.)
│ │ ├── 📂 types # Global TypeScript types
│ │ ├── 📂 utils # Utility/helper functions
│ │ ├── 📂 config # Configuration & environment setup
│ ├── 📂 components
│ │ ├── 📂 ui # Reusable UI components (buttons, modals, forms)
│ │ ├── 📂 features # Feature-specific components
│ │ ├── 📂 animations # Animation files (Framer Motion, GSAP)
│ ├── 📂 modules
│ │ ├── 📂 auth # Authentication logic
│ │ ├── 📂 dashboard # Dashboard-related logic
│ │ ├── 📂 profile # User profile logic
│ ├── 📂 assets # Static assets (images, fonts, icons)
│ ├── 📂 styles # Global styles (Tailwind, SCSS, CSS Modules)
│ ├── 📂 tests # Unit & integration tests (Jest, React Testing Library)
│ ├── 📂mocks # Mock data for tests
│ ├── main.tsx # Application entry point
│ ├── App.tsx # Main App component
│ ├── router.tsx # React Router setup
│── 📂 public # Static files (favicon, index.html)
│── .env # Environment variables
│── tsconfig.json # TypeScript configuration
│── package.json # Dependencies and scripts
│── README.md # Documentation

Remove the two testing-related folders (tests and mocks) and that's no different than what OP is suggesting. The app folder isn't necessary, since that's what 'src' is and 'features' has simply been renamed 'modules' here... Personally, I prefer 'features' and that's usually what I see this folder named.
Some comments may only be visible to logged-in visitors.Sign in to view all comments.
For further actions, you may consider blocking this person and/orreporting abuse