Below are two examples of typical folder structures for a CRA and an Express app. If using different technologies then remember to separate concerns so that your code is easy to navigate and easy to test.
public/
src/
components/
App/
App.module.css
App.stories.js
App.test.js
index.js
...
config/
...
index.js
utils/
...
index.js
index.css // global css rules
index.js // root level (attaching with ReactDOM)
serviceWorker.js
.gitignore
package.json
README.md
Notes:
- Folders are
camelCased
- Except for component folders, which are
PascalCased
so that we know components live in there
- Except for component folders, which are
- You may wish to have a
pages/
folder (similar to gatbsy) where using React router you can contain pages and render them when needed. In this case, you may want aRouting
folder which contains all of the routing logic.
bin/
www
data/
models/
public/
routes/
app.js
package.json