Enouvo / frontend-core

0 stars 0 forks source link

Proposal Structure #5

Open thaisonenouvo opened 11 months ago

thaisonenouvo commented 11 months ago

Structure

This style guide is mostly based on the standards that are currently prevalent in Typescript. Let's discuss if you have better idea on how to improve it.

Package:

├── docs
│   ├──  style-guide.md
└── public # folder for public file
└── e2e # folder to e2e
├── core  # shoudn't include business here 
│   ├── auth  # store anything related to auth
│   │   ├── src
│   │   │      └── components
│   │   │      └── hooks
│   │   ├── tsconfig.json
│   │   ├── project.json
│   │   ├── .eslintrc.json
│   │   ├── ....
│   ├── ui  # store all component common here
│   │   ├── src
│   │   │      └── Loading.tsx
│   │   │      └── index.ts
│   │   ├── tsconfig.json
│   │   ├── project.json
│   │   ├── .eslintrc.json
│   │   ├── ....
│   ├── hooks  # store all hook common here
│   │   ├── src
│   │   │      └── useLatest.tsx
│   │   │      └── index.ts
│   │   ├── ....
│   ├── utils  # store utils common here
│   ├── constants  # store constans common here
│   ├── types
│   │        └── map.ts
├── src
│   ├── assets          # folder to store assets
│   │   ├── svgs    # folder to svgs
│   │   │      └── ic-sun.svg
│   │   └── images      # folder to images
│   ├── configs          # folder to configs
│   │   ├── locales    # folder to locales
│   │   └── theme      # folder to theme
│   │   ├── antd.ts    # folder to config antd
│   │   └── ...
│   ├── generated   # folder for generated files, please ignore it
│   ├── api   # folder to add all api
│   │   │   └── config.ts
│   │   │   └── user.ts
│   ├── graphql   # folder to add all mutations and queries
│   │   │   └── queries
│   │   │      └── user.graphql
│   │   │   └── mutations
│   │   │   └── fragments
│   │   ├── cache.ts   # folder to config cache
│   │   └── client.tsx  # folder to config file client
│   ├── pages          # folder to store all the pages
│   │   └── _app.tsx # layout for all route
│   │   └── (auth) 
│   │   │   ├── events
│   │   │       └── _components # components for events module ( if the component share across module please move to shared )
│   │   │       └── _hooks
│   │   │       └── index.tsx 
│   │   │   ├── _layout.tsx
│   │   └── account
│   │   │   ├── index.tsx
│   │   └── forgot-password # use title-case for pages
│   │   │   ├── index.tsx
│   ├── shared          # folder to shared cross business module
│   │   ├── components
│   │   │   └── forms
│   │   │       └── EditForm.tsx
│   │   │   └── modals # store all modal here
│   │   │       └── ManageUserModal.tsx
│   │   │   └── selectors  # store all selector here
│   │   │       └── UserSelector.tsx
│   │   │   └── ...
│   │   ├── hooks
│   │   │   └── useInfo.ts
│   │   │   └── useGetRooms.ts
│   │   │   └── ...
│   │   ├── services
│   │   │   └── map.ts
│   │   │   └── ...
│   └── App.tsx      # App entry point
│   └── main.tsx     # main entry point
├── .gitignore
├── package.json
├── nx.json
└── README.md
└── pnpm-lok.yaml
└── ...
thaisonenouvo commented 10 months ago