Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for folder structure for services in a react app?

A react app has the following services (and maybe more will be added):

  • ipfs
  • web torrents
  • web3
  • indexDb

I'm not even sure those would qualify as "services" but I don't know what else to call them.

Current folder structure is:

  • src
    • components
    • containers
    • css
    • reducers
    • settings
    • util
    • services
      • web3
      • ipfs
      • torrent
      • indexDb
      • api (this is the public api for all the services)

Does this follow best practices?

like image 671
cooldude101 Avatar asked Oct 17 '22 13:10

cooldude101


1 Answers

There are so many different ways to structure a React App that it all comes down to what helps you, the developer, navigate your files more efficiently.

The 100% correct way to structure a React app (or why there’s no such thing)

If you just want to see some example file structures, you are welcome to checkout many popular repos such as create-react-app or react-boilerplate.

like image 78
jxzheng16 Avatar answered Oct 19 '22 10:10

jxzheng16