|
1 | | -# Getting Started with Create React App |
| 1 | +# DAITA Platform User Interface |
2 | 2 |
|
3 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
| 3 | +React-based user interface for the DAITA platform. |
4 | 4 |
|
5 | | -## Available Scripts |
| 5 | +## Libraries |
6 | 6 |
|
7 | | -In the project directory, you can run: |
| 7 | +- UI: [MUI](https://mui.com) |
| 8 | +- State management: [Redux](https://redux.js.org) |
| 9 | +- Redux side effect manager: [Redux-Saga](https://redux-saga.js.org) |
| 10 | +- S3 client - AWS SDK for JavaScript v3: [@aws-sdk/client-s3](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/index.html) |
| 11 | +- HTTP client: [axios](https://www.npmjs.com/package/axios) |
| 12 | + |
| 13 | +## Folder Structure |
| 14 | + |
| 15 | +```bash |
| 16 | +public/ |
| 17 | + ... |
| 18 | +src/ |
| 19 | + components/ |
| 20 | + [ComponentName]/ |
| 21 | + .tsx |
| 22 | + index.ts |
| 23 | + config/ |
| 24 | + .ts |
| 25 | + constants/ |
| 26 | + .ts |
| 27 | + hooks/ |
| 28 | + .ts |
| 29 | + reduxes/ |
| 30 | + [reducerName]/ |
| 31 | + action.ts |
| 32 | + constants.ts |
| 33 | + reducer.ts |
| 34 | + selector.ts |
| 35 | + type.ts |
| 36 | + routes/ |
| 37 | + [PageName]/ |
| 38 | + index.tsx |
| 39 | + type.ts |
| 40 | + index.ts |
| 41 | + sagas/ |
| 42 | + .ts |
| 43 | + services/ |
| 44 | + .ts |
| 45 | + styles/ |
| 46 | + .ts |
| 47 | + .css |
| 48 | + utils/ |
| 49 | + .ts |
| 50 | +``` |
| 51 | + |
| 52 | +Files and directories related to React components should be **PascalCase** to separate words and file extension should be `.tsx` for TypeScript React. |
| 53 | +All other files and directories should be **camelCase** to separate words. |
| 54 | + |
| 55 | +**public/** |
| 56 | + |
| 57 | +Contains static files such as `index.html`, JavaScript library files, images, and other assets, etc. |
| 58 | + |
| 59 | +**src/components/** |
| 60 | + |
| 61 | +Contains components that are shared between pages. |
8 | 62 |
|
9 | | -### `yarn start` |
| 63 | +**src/config/** |
10 | 64 |
|
11 | | -Runs the app in the development mode.\ |
12 | | -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
| 65 | +Contains configurations of the app. |
13 | 66 |
|
14 | | -The page will reload if you make edits.\ |
15 | | -You will also see any lint errors in the console. |
| 67 | +**src/contants/** |
16 | 68 |
|
17 | | -### `yarn test` |
| 69 | +Contains all constants of the app. |
18 | 70 |
|
19 | | -Launches the test runner in the interactive watch mode.\ |
20 | | -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 71 | +**src/hooks/** |
21 | 72 |
|
22 | | -### `yarn build` |
| 73 | +Contains shared React hooks. |
23 | 74 |
|
24 | | -Builds the app for production to the `build` folder.\ |
25 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
| 75 | +**src/reduxes/** |
26 | 76 |
|
27 | | -The build is minified and the filenames include the hashes.\ |
28 | | -Your app is ready to be deployed! |
| 77 | +Contains redux's reducer of each app feature. Folder name base on feature's name. |
29 | 78 |
|
30 | | -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| 79 | +**src/routes/** |
31 | 80 |
|
32 | | -### `yarn eject` |
| 81 | +Contains pages of the app. Filename base on page's name. |
33 | 82 |
|
34 | | -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
| 83 | +**src/sagas/** |
35 | 84 |
|
36 | | -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. |
| 85 | +Contains saga files of corresponding redux reducer. |
37 | 86 |
|
38 | | -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. |
| 87 | +**src/services/** |
39 | 88 |
|
40 | | -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. |
| 89 | +Contains API endpoints. |
| 90 | + |
| 91 | +**src/styles/** |
| 92 | + |
| 93 | +Contains custom styles for general sections. |
| 94 | + |
| 95 | +**src/utils/** |
| 96 | + |
| 97 | +Contains functions shared between the app. |
| 98 | + |
| 99 | +## Installation |
| 100 | + |
| 101 | +It is recommended to install [Yarn](https://classic.yarnpkg.com) through the `npm` package manager, which comes bundled with [Node.js](https://nodejs.org) when you install it on your system. It is recommended to use a Node.js version `>= 16.0.0`. |
| 102 | + |
| 103 | +Once you have `npm` installed, you can run the following both to install and upgrade Yarn: |
| 104 | + |
| 105 | +```bash |
| 106 | +npm install --global yarn |
| 107 | +``` |
| 108 | + |
| 109 | +After having installed Yarn, simply run: |
| 110 | + |
| 111 | +```bash |
| 112 | +yarn install |
| 113 | +``` |
| 114 | + |
| 115 | +## Serving the Application |
| 116 | + |
| 117 | +> You need an `.env` file for successful running. Contact the administrator for more information. |
| 118 | +
|
| 119 | +In the project directory, you can run: |
| 120 | + |
| 121 | +```bash |
| 122 | +yarn start |
| 123 | +``` |
| 124 | + |
| 125 | +Runs the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
| 126 | + |
| 127 | +The page will reload if you make edits. You will also see any lint errors in the console. |
| 128 | + |
| 129 | +## Building the Application |
| 130 | + |
| 131 | +In the project directory, you can run: |
| 132 | + |
| 133 | +```bash |
| 134 | +yarn build |
| 135 | +``` |
41 | 136 |
|
42 | | -## Learn More |
| 137 | +Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimises the build for the best performance. |
43 | 138 |
|
44 | | -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
| 139 | +The build is minified and the filenames include the hashes. Your app is ready to be deployed! |
45 | 140 |
|
46 | | -To learn React, check out the [React documentation](https://reactjs.org/). |
| 141 | +--- |
47 | 142 |
|
48 | 143 | ## A Note on Releases |
49 | 144 |
|
|
0 commit comments