-
Notifications
You must be signed in to change notification settings - Fork 0
Project Structure
Cecilia Wong edited this page May 2, 2024
·
17 revisions
Folder structure as created by Create React App: https://create-react-app.dev/docs/folder-structure

Base path: src/
File/Directory | Description |
---|---|
App.js | The main React component. |
App.css | CSS style sheet for App.js . |
i18n.js | The internationalization configuration module. Also includes function definitions used in translation configurations. |
components/ | Location of the supporting React components. The CSS style sheet of a component is to be included in the same directory as the corresponding JS file. |
api/ | Location of API service module(s) and their base module, AbstractAPIService . |
types/ | Location of type definitions (data types, exceptions, etc.). |
utils/ | Location of utility modules. |
Base path: src/components/common/
File/Directory | Description |
---|---|
ErrorMessageBox.js | The error message box. |
ErrorMessageBox.css | CSS stylesheet for the error message box. |
LoadingText.js | The text displayed when pending data load, eg. from API calls. |
LoadingText.css | CSS stylesheet for the loading text. |

Base path: src/components/nav/
File/Directory | Description |
---|---|
NavBar.js | Main component for the top navigation bar. |
NavBar.css | CSS stylesheet for the navigation bar. |
LanguageSelector.js | The language selector at the navigation bar. |
LanguageSelector.css | CSS stylesheet for the language selector. |

Base path: src/components/
File/Directory | Description |
---|---|
SumoScheduleLookup.js | The main component. |
SumoScheduleLookup.css | CSS stylesheet for the main component. |
sumo/ | Contains the sub-components of this module. |
Base path: src/components/
File/Directory | Description |
---|---|
About.js | The main component. |
About.css | CSS stylesheet for the main component. |
Base path: src/api/
File/Directory | Description |
---|---|
AbstractAPIService.js | Base module for API webservice modules. |
SumoScheduleService.js | Service module for the Sumo Tournament Schedule API. |

Base path: src/types/
File/Directory | Description |
---|---|
APICallResult.js | Wrapper for the data on the result of an API call. |
Tournament.js | Represents the details of a sumo tournament.APICallResult.responseData is an array of this data type for the Sumo Tournament Schedule API. |
Base path: src/utils/
File/Directory | Description |
---|---|
EnvironmentUtils.js | Utility functions for the usage of environment variables. |
DateUtils.js | Utility functions for date/time manipulation. |
Base path: src/
File/Directory | Description |
---|---|
App.test.js | Integration tests of App.js , ie. the whole app.App.test.json at the same directory contains test data for its test cases. |
**/__tests__/*.test.js | Unit test suite of the component with the same name. The __tests__ folder is at the same directory as the corresponding component. |
testUtis.js | Utility functions for test cases. |
testData-expecteds.json | Expected text values, etc. that are likely shared among test cases across different suites. |
setupTests.js | Included upon project creation and meant for including library imports, etc. common for all test suites. See here for details. |
File/Directory | Description |
---|---|
public/index.html src/index.js src/index.css |
Page template and Javascript entry point. |
public/ | Includes the aforementioned public.html and images, etc. to be included in it. |
File/Directory | Description |
---|---|
src/conf/ | Static application configurations that are the same in all environments. |
src/locales/{lang-code}/translation.json | Translation configurations for each supported language. |
.env .env.development .env.production (etc...) |
Environment variable configurations. Includes configurations that differ across environments. |
File/Directory | Description |
---|---|
package.json package-lock.json |
Dependency library configurations. |
File/Directory | Description |
---|---|
README.md | The contents of this repository's README section. |
.github/workflows/ | The path for workflow configuration files. |
assets/ | Miscellaneous files and documents. |