Project Structure
The Orca app is a monorepo using Lerna and Yarn Workspaces.
In this section, we'll describe the files and folders the newly created app contains.
my-app├── .prettierrc├── lerna.json├── package.json├── pm2.config.js└── packages └── orca-api | ├── .env | ├── .eslintrc | ├── createSuperAdmin.js | ├── package.json | ├── tsconfig.json | └── src | └── constants | ├── controllers | ├── db | ├── models | ├── utils | ├── authentication.ts | ├── index.ts | ├── routes.ts | └── socket.ts └── orca-frontend ├── components ├── constants ├── pages ├── public ├── store ├── utils ├── .eslintrc.json ├── package.json ├── theme.ts └── tsconfig.json.huskyA hook for checking Typescript and ESLint errors before committing to Git..prettierrcPrettier configuration file. Prettier ensures that the code is formatted in a consistent style across the app.lerna.jsonLerna configuration file. Lerna is used for managing multiple packages.package.jsonThe root package.json file containing the root development dependencies and scripts for running multiple packages.pm2.config.jsPM2 configuration file. PM2 is a process manager for Node.js, and we use it for running the app in production mode.packagesA folder containing API and Front-end packages.apiAn Express web server exposing Rest API endpoints..envEnvironmental variable definitions for the API package..eslintrcESLint configuration file for the API package.createSuperAdmin.jsA helper file for creating super admin users through the command line.package.jsonAPI's package.json file, containing all the required dependencies and the NPM scripts.tsconfig.jsonTypescript configuration file for the API.srcA folder containing all the Typescript application code that transpile to Javascript for the production environment.constantsShared constant variables for the API package.controllersA folder containing all the API controllers.dbA folder containing all the functions for interacting with the MongoDB database.modelsDefinitions of the Mongoose Schema and Models.utilsDifferent types of utility functions for the API.authentication.tsA file containing Passport middlewares for authentication and authorization.index.tsConfiguration file for the Express framework.routesConfiguration for all the API endpoints.socket.tsSocket.io server configuration with its listeners and events.
frontendA Next.js React application.componentsReact components containing UI library.constantsShared constant variables for the Front-end package.pagesReact components associated with specific routes.publicA folder for hosting static files.storeRedux store implementation using Duck pattern.utilsDifferent types of utility functions for the Front-end..eslintrc.jsonESLint configuration file for the Front-end package.package.jsonFront-end's package.json file, containing all the required dependencies and the NPM scripts.theme.tsA file containing all the design tokens for constructing consistent UI across the app.tsconfig.jsonTypescript configuration file for the Front-end.