Make professional mobile apps with React Native and Typescript — Structure your codebase in the right way (Chapter 3— Part 1)

Photo by Gabriel Crismariu on Unsplash

Pro tip: Store all your source code and resources (images, son data, icons, etc) inside the src folder.

the src folder
assets

Pro tip: I often put all API calls into the services folder. So that we have a centralized place to manage them. As a result, components call them to talk to the server instead of interacting directly with it.The same logic apply to the local database & files interaction.

modules

Pro tip: Don't make blanks folders. Only make one if you really need it. If a component doesn't have children components, do not make a components folder inside it. You should start with the screen component first. Break it into smaller components. If those components are used in the same modules, move them into the component folder inside the same module. If they're used in other modules, move them into the core/component folder. The same approach is applied for services, helpers.

git clone -b structure_codebase https://github.com/thinhtran3588/react-native-starter-kit.git

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store