Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Folder Structure No One Teaches You (But Every Developer Needs)

Every developer has opened a messy project and immediately wanted to cry. Maybe the routes folder had configs, the utils folder had business logic, and the components folder was full of files named test-final-new.js. But here’s the secret: folder structure isn’t magic it’s just a series of small decisions that nobody teaches, yet every project depends on. In this post, you’ll learn how to design…

Developers often face the daunting challenge of disorganized project folders. The source material outlines a simple solution to this issue: a clean folder structure that evolves with the project. Key points include:

A clean folder structure enhances productivity by preventing code decay, accelerating onboarding, speeding up debugging, and facilitating safe refactoring. It doesn’t require perfection, just consistency.

The source recommends a three-layer mental model to structure projects:

- /core: Contains core business logic.

- /features: Houses product modules.

- /shared: Provides reusable utilities.

This structure accommodates various types of projects, including frontend, backend, and microservices.

The source provides practical examples. For a React project, a well-organized folder structure includes:

- /src

- /components: Reusable UI components.

- /hooks: Custom React hooks.

- /pages: Route-level pages.

- /contexts: Global state management (auth, theme, user).

- /lib: API clients, configuration, external services.

- /assets: Images, icons, fonts.

For a small Express API backend, a minimalist folder structure includes:

- /src

- /routes: Route definitions.

- /controllers: Request handling logic.

- /services: Business logic.

- /models: Database schemas.

- /utils: Shared helpers (validators, formatters).

The takeaway: Start with simple, consistent folder structures aligned with your project’s core questions. Refactor only when necessary, as this will benefit both your current and future self, as well as your team.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A Wappalyzer API alternative in five lines of Python

"What is this website built with?" sits behind a lot of everyday work: qualifying a lead list by the tools companies already pay for, sizing up competitors, auditing client sites, finding every store…

  • Python script analyzes websites for tech stack without Wappalyzer API
  • Clearfetch Tech Stack Detector actor scans sites via HTTP requests
  • Script identifies key technologies, costs $0.05 per website analyzed

Sanity vs Payload CMS vs Contentful: Pricing Comparison 2026

Sanity, Payload CMS, and Contentful pricing in 2026 looks radically different depending on how you count. Sanity charges per project and API usage, Payload is open-source but carries real…

  • Sanity charges per project and API usage, with a free tier for small sites.
  • Payload CMS is open-source with infrastructure costs, offering self-hosting options.
  • Contentful bills per seat with steep price increases at scale, suitable for larger teams.

Hacktoberfest Weekend Challenge

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend What I Built One Liner is a one-page web app that turns long, over-the-top posts into a single line saying what they…

  • One Liner app condenses long posts into single lines
  • App runs entirely on user's device, no data shared
  • Open-weight models used locally via WebLLM and WebGPU

More from Saturday 3 October →