-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
525 changed files
with
1,310 additions
and
2,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# 🗄️ Project Structure | ||
|
||
Most of the code lives in the `src` folder and looks something like this: | ||
|
||
```sh | ||
src | ||
| | ||
+-- app # application layer containing: | ||
| | # this folder might differ based on the meta framework used | ||
| +-- services # application services. The super app top level navigation is defined as a set of services | ||
| +-- RootNavigator.tsx # Main navigator for the app that determines the initial route. Either app onboarding UI or the top level service navigator | ||
| +-- App.tsx # main application component | ||
+-- assets # assets folder can contain all the static files such as images, fonts, etc. | ||
| | ||
+-- components # shared components used across the entire application | ||
| | ||
+-- config # global configurations, exported env variables etc. | ||
| | ||
+-- features # feature based modules | ||
| | ||
+-- hooks # shared hooks used across the entire application | ||
| | ||
+-- lib # reusable libraries preconfigured for the application | ||
| | ||
+-- stores # global state stores | ||
| | ||
+-- testing # test utilities and mocks | ||
| | ||
+-- types # shared types used across the application | ||
| | ||
+-- utils # shared utility functions | ||
``` | ||
|
||
A service could have the following structure: | ||
|
||
```sh | ||
src/services/srcful | ||
| | ||
+-- pages # pages scoped to a specific service | ||
| | ||
+-- index.tsx # service entry point | ||
``` | ||
|
||
For easy scalability and maintenance, organize most of the code within the features folder. Each feature folder should contain code specific to that feature, keeping things neatly separated. This approach helps prevent mixing feature-related code with shared components, making it simpler to manage and maintain the codebase compared to having many files in a flat folder structure. By adopting this method, you can enhance collaboration, readability, and scalability in the application's architecture. | ||
|
||
A feature could have the following structure: | ||
|
||
```sh | ||
src/features/awesome-feature | ||
| | ||
+-- api # exported API request declarations and api hooks related to a specific feature | ||
| | ||
+-- assets # assets folder can contain all the static files for a specific feature | ||
| | ||
+-- components # components scoped to a specific feature | ||
| | ||
+-- hooks # hooks scoped to a specific feature | ||
| | ||
+-- stores # state stores for a specific feature | ||
| | ||
+-- types # typescript types used within the feature | ||
| | ||
+-- utils # utility functions for a specific feature | ||
``` | ||
|
||
NOTE: You don't need all of these folders for every feature. Only include the ones that are necessary for the feature. | ||
|
||
By following these practices, you can ensure that your codebase is well-organized, scalable, and maintainable. This will help you and your team to work more efficiently and effectively on the project. | ||
This approach can also make it easier to apply similar architecture to apps built with Next.js, Remix or React Native. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/navigation/NavigationHelper.ts → src/app/NavigationHelper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions
18
src/services/HotspotService/index.tsx → src/app/services/HotspotService/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.