From a5989a470cfa0c6677e5ef880c43fd1d0f21aa2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Mon, 5 Feb 2024 15:01:37 +0100 Subject: [PATCH] Improve Documentation (#3795) * Begin docs improvement * Keep improving documentation * Upgrade Docusarus * Fix broken links --- README.md | 2 +- package.json | 8 +- .../docs/contributor/_category_.json | 4 +- .../bug-and-requests.mdx | 2 +- .../docs/contributor/frontend/_category_.json | 4 +- .../frontend/advanced/_category_.json | 4 - .../frontend/basics/_category_.json | 4 - .../contributor/frontend/basics/basics.mdx | 53 --- .../frontend/basics/contributing.mdx | 44 --- .../frontend/basics/design-system.mdx | 10 - .../{advanced => }/best-practices.mdx | 2 +- .../{basics => }/folder-architecture.mdx | 0 .../docs/contributor/frontend/frontend.mdx | 80 +++- .../frontend/{advanced => }/hotkeys.mdx | 0 .../frontend/{advanced => }/style-guide.mdx | 0 .../frontend/{basics => }/work-with-figma.mdx | 0 .../docs/contributor/server/_category_.json | 4 +- .../contributor/server/basics/_category_.json | 4 - .../contributor/server/basics/overview.mdx | 35 -- .../contributor/server/basics/workflows.mdx | 61 --- .../server/{others => }/best-practices.mdx | 0 .../server/{basics => }/custom-objects.mdx | 0 .../server/{others => }/feature-flags.mdx | 0 .../{basics => }/folder-architecture.mdx | 0 .../contributor/server/others/_category_.json | 4 - .../contributor/server/{basics => }/queue.mdx | 0 .../docs/contributor/server/server.mdx | 87 +++- .../server/{others => }/zapier.mdx | 0 .../docs/developer/_category_.json | 4 - .../docs/developer/graphql_api.mdx | 25 -- .../twenty-docs/docs/developer/rest_api.mdx | 29 -- packages/twenty-docs/docs/index.mdx | 38 +- .../twenty-docs/docs/start/_category_.json | 2 +- packages/twenty-docs/docs/start/cloud.mdx | 21 + .../docs/start/getting-started.mdx | 29 -- .../local-setup/_category_.json | 2 +- .../local-setup/docker-setup.mdx | 4 +- .../local-setup/ide-setup.mdx | 4 +- .../local-setup/local-setup.mdx | 11 +- .../local-setup/troubleshooting.mdx | 2 +- .../local-setup/yarn-setup.mdx | 2 +- .../start/self-hosting/1-click-deploy.mdx | 20 + .../start/self-hosting/docker-compose.mdx | 62 +++ .../self-hosting/environment-variables.mdx | 173 -------- .../docs/start/self-hosting/self-hosting.mdx | 183 ++++++++- .../docs/start/self-hosting/upgrade-guide.mdx | 8 + .../ui-components/_category_.json | 0 .../ui-components/display/_category_.json | 0 .../ui-components/display/app-tooltip.mdx | 0 .../ui-components/display/checkmark.mdx | 0 .../ui-components/display/chip.mdx | 0 .../ui-components/display/icons.mdx | 0 .../ui-components/display/soon-pill.mdx | 0 .../ui-components/display/tag.mdx | 0 .../ui-components/feedback/_category_.json | 0 .../ui-components/feedback/progress-bar.mdx | 0 .../ui-components/input/_category_.json | 0 .../ui-components/input/block-editor.mdx | 0 .../ui-components/input/button.mdx | 0 .../ui-components/input/checkbox.mdx | 0 .../ui-components/input/color-scheme.mdx | 0 .../ui-components/input/icon-picker.mdx | 0 .../ui-components/input/image-input.mdx | 0 .../ui-components/input/radio.mdx | 0 .../ui-components/input/select.mdx | 0 .../ui-components/input/text.mdx | 0 .../ui-components/input/toggle.mdx | 0 .../ui-components/navigation/_category_.json | 0 .../ui-components/navigation/bread-crumb.mdx | 0 .../ui-components/navigation/link.mdx | 0 .../ui-components/navigation/menu-item.mdx | 0 .../navigation/navigation-bar.mdx | 0 .../ui-components/navigation/step-bar.mdx | 0 .../ui-components/ui-components.mdx | 0 packages/twenty-docs/docusaurus.config.js | 103 +++-- packages/twenty-docs/sidebars.js | 106 ++++- packages/twenty-docs/src/css/custom.css | 54 ++- .../twenty-docs/src/theme/DocCard/index.js | 36 +- .../src/theme/DocSidebarItem/index.js | 67 ++++ .../src/theme/Icon/DarkMode/index.js | 9 +- .../src/theme/Icon/LightMode/index.js | 9 +- .../src/theme/Navbar/Search/index.js | 5 + .../src/theme/NavbarItem/ComponentTypes.js | 24 ++ .../src/theme/NavbarItem/GithubLink.tsx | 21 + packages/twenty-docs/src/theme/icons.js | 96 ++--- .../static/img/dark-doc-preview.png | Bin 296857 -> 384070 bytes .../static/img/light-doc-preview.png | Bin 367251 -> 340943 bytes packages/twenty-front/package.json | 2 +- packages/twenty-server/package.json | 2 +- packages/twenty-utils/dangerfile.ts | 4 +- yarn.lock | 371 +++++++++--------- 91 files changed, 1045 insertions(+), 895 deletions(-) rename packages/twenty-docs/docs/{start => contributor}/bug-and-requests.mdx (94%) delete mode 100644 packages/twenty-docs/docs/contributor/frontend/advanced/_category_.json delete mode 100644 packages/twenty-docs/docs/contributor/frontend/basics/_category_.json delete mode 100644 packages/twenty-docs/docs/contributor/frontend/basics/basics.mdx delete mode 100644 packages/twenty-docs/docs/contributor/frontend/basics/contributing.mdx delete mode 100644 packages/twenty-docs/docs/contributor/frontend/basics/design-system.mdx rename packages/twenty-docs/docs/contributor/frontend/{advanced => }/best-practices.mdx (99%) rename packages/twenty-docs/docs/contributor/frontend/{basics => }/folder-architecture.mdx (100%) rename packages/twenty-docs/docs/contributor/frontend/{advanced => }/hotkeys.mdx (100%) rename packages/twenty-docs/docs/contributor/frontend/{advanced => }/style-guide.mdx (100%) rename packages/twenty-docs/docs/contributor/frontend/{basics => }/work-with-figma.mdx (100%) delete mode 100644 packages/twenty-docs/docs/contributor/server/basics/_category_.json delete mode 100644 packages/twenty-docs/docs/contributor/server/basics/overview.mdx delete mode 100644 packages/twenty-docs/docs/contributor/server/basics/workflows.mdx rename packages/twenty-docs/docs/contributor/server/{others => }/best-practices.mdx (100%) rename packages/twenty-docs/docs/contributor/server/{basics => }/custom-objects.mdx (100%) rename packages/twenty-docs/docs/contributor/server/{others => }/feature-flags.mdx (100%) rename packages/twenty-docs/docs/contributor/server/{basics => }/folder-architecture.mdx (100%) delete mode 100644 packages/twenty-docs/docs/contributor/server/others/_category_.json rename packages/twenty-docs/docs/contributor/server/{basics => }/queue.mdx (100%) rename packages/twenty-docs/docs/contributor/server/{others => }/zapier.mdx (100%) delete mode 100644 packages/twenty-docs/docs/developer/_category_.json delete mode 100644 packages/twenty-docs/docs/developer/graphql_api.mdx delete mode 100644 packages/twenty-docs/docs/developer/rest_api.mdx create mode 100644 packages/twenty-docs/docs/start/cloud.mdx delete mode 100644 packages/twenty-docs/docs/start/getting-started.mdx rename packages/twenty-docs/docs/{contributor => start}/local-setup/_category_.json (88%) rename packages/twenty-docs/docs/{contributor => start}/local-setup/docker-setup.mdx (96%) rename packages/twenty-docs/docs/{contributor => start}/local-setup/ide-setup.mdx (85%) rename packages/twenty-docs/docs/{contributor => start}/local-setup/local-setup.mdx (66%) rename packages/twenty-docs/docs/{contributor => start}/local-setup/troubleshooting.mdx (86%) rename packages/twenty-docs/docs/{contributor => start}/local-setup/yarn-setup.mdx (98%) create mode 100644 packages/twenty-docs/docs/start/self-hosting/1-click-deploy.mdx create mode 100644 packages/twenty-docs/docs/start/self-hosting/docker-compose.mdx delete mode 100644 packages/twenty-docs/docs/start/self-hosting/environment-variables.mdx create mode 100644 packages/twenty-docs/docs/start/self-hosting/upgrade-guide.mdx rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/_category_.json (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/_category_.json (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/app-tooltip.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/checkmark.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/chip.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/icons.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/soon-pill.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/display/tag.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/feedback/_category_.json (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/feedback/progress-bar.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/_category_.json (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/block-editor.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/button.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/checkbox.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/color-scheme.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/icon-picker.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/image-input.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/radio.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/select.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/text.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/input/toggle.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/navigation/_category_.json (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/navigation/bread-crumb.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/navigation/link.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/navigation/menu-item.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/navigation/navigation-bar.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/navigation/step-bar.mdx (100%) rename packages/twenty-docs/docs/{contributor/frontend => }/ui-components/ui-components.mdx (100%) create mode 100644 packages/twenty-docs/src/theme/DocSidebarItem/index.js create mode 100644 packages/twenty-docs/src/theme/Navbar/Search/index.js create mode 100644 packages/twenty-docs/src/theme/NavbarItem/ComponentTypes.js create mode 100644 packages/twenty-docs/src/theme/NavbarItem/GithubLink.tsx diff --git a/README.md b/README.md index 685fd0bb36..1e60833efa 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ We’ve spent thousands of hours grappling with traditional CRMs like Pipedrive and Salesforce to align them with our business needs, only to end up frustrated — customizations are complex and the closed ecosystems of these platforms can feel restrictive. -We felt the need for a CRM platform that empowers rather than constrains. We believe the next great CRM will come from the open source community. And we’ve packed Twenty with powerful features to give you full control and help you win more deals. +We felt the need for a CRM platform that empowers rather than constrains. We believe the next great CRM will come from the open source community. And we’ve packed Twenty with powerful features to give you full control and help you run your business efficiently.
diff --git a/package.json b/package.json index 2c6eafec7c..be7799e9e9 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "@chakra-ui/accordion": "^2.3.0", "@chakra-ui/system": "^2.6.0", "@codesandbox/sandpack-react": "^2.11.3", - "@docusaurus/core": "^3.0.0", - "@docusaurus/preset-classic": "^3.0.0", + "@docusaurus/core": "^3.1.0", + "@docusaurus/preset-classic": "^3.1.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@floating-ui/react": "^0.24.3", @@ -157,8 +157,8 @@ "devDependencies": { "@babel/core": "^7.14.5", "@babel/preset-react": "^7.14.5", - "@docusaurus/module-type-aliases": "^3.0.0", - "@docusaurus/tsconfig": "3.0.0", + "@docusaurus/module-type-aliases": "^3.1.0", + "@docusaurus/tsconfig": "3.1.0", "@graphql-codegen/cli": "^3.3.1", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-codegen/typescript": "^3.0.4", diff --git a/packages/twenty-docs/docs/contributor/_category_.json b/packages/twenty-docs/docs/contributor/_category_.json index c4117720da..e12f1ce53d 100644 --- a/packages/twenty-docs/docs/contributor/_category_.json +++ b/packages/twenty-docs/docs/contributor/_category_.json @@ -1,4 +1,4 @@ { - "label": "Contributor guide", - "position": 2 + "label": "Contributing", + "position": 3 } diff --git a/packages/twenty-docs/docs/start/bug-and-requests.mdx b/packages/twenty-docs/docs/contributor/bug-and-requests.mdx similarity index 94% rename from packages/twenty-docs/docs/start/bug-and-requests.mdx rename to packages/twenty-docs/docs/contributor/bug-and-requests.mdx index ca11ade5d6..63d022f4a8 100644 --- a/packages/twenty-docs/docs/start/bug-and-requests.mdx +++ b/packages/twenty-docs/docs/contributor/bug-and-requests.mdx @@ -1,5 +1,5 @@ --- -title: Bugs & Requests +title: Bugs and Requests sidebar_position: 3 sidebar_custom_props: icon: TbBug diff --git a/packages/twenty-docs/docs/contributor/frontend/_category_.json b/packages/twenty-docs/docs/contributor/frontend/_category_.json index 0c949e0fa5..254ec2489a 100644 --- a/packages/twenty-docs/docs/contributor/frontend/_category_.json +++ b/packages/twenty-docs/docs/contributor/frontend/_category_.json @@ -1,3 +1,5 @@ { - "position": 3 + "position": 3, + "collapsible": true, + "collapsed": true } diff --git a/packages/twenty-docs/docs/contributor/frontend/advanced/_category_.json b/packages/twenty-docs/docs/contributor/frontend/advanced/_category_.json deleted file mode 100644 index dd1c52f2ee..0000000000 --- a/packages/twenty-docs/docs/contributor/frontend/advanced/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Advanced", - "position": 3 -} diff --git a/packages/twenty-docs/docs/contributor/frontend/basics/_category_.json b/packages/twenty-docs/docs/contributor/frontend/basics/_category_.json deleted file mode 100644 index daec3e16a8..0000000000 --- a/packages/twenty-docs/docs/contributor/frontend/basics/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Basics", - "position": 1 -} diff --git a/packages/twenty-docs/docs/contributor/frontend/basics/basics.mdx b/packages/twenty-docs/docs/contributor/frontend/basics/basics.mdx deleted file mode 100644 index 69b2e233f4..0000000000 --- a/packages/twenty-docs/docs/contributor/frontend/basics/basics.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Basics -sidebar_position: 0 ---- - -import DocCardList from '@theme/DocCardList'; - - - -## Tech Stack - -The project has a clean and simple stack, with minimal boilerplate code. - -**App** - -- [React](https://react.dev/) -- [Apollo](https://www.apollographql.com/docs/) -- [GraphQL Codegen](https://the-guild.dev/graphql/codegen) -- [Recoil](https://recoiljs.org/docs/introduction/core-concepts) -- [TypeScript](https://www.typescriptlang.org/) - -**Testing** - -- [Jest](https://jestjs.io/) -- [Storybook](https://storybook.js.org/) - -**Tooling** - -- [Yarn](https://yarnpkg.com/) -- [Craco](https://craco.js.org/docs/) -- [ESLint](https://eslint.org/) - -## Architecture - -### Routing - -[React Router](https://reactrouter.com/) handles the routing. - -To avoid unnecessary [re-renders](/contributor/frontend/advanced/best-practices#managing-re-renders) all the routing logic is in a `useEffect` in `PageChangeEffect`. - -### State Management - -[Recoil](https://recoiljs.org/docs/introduction/core-concepts) handles state management. - -See [best practices](/contributor/frontend/advanced/best-practices#state-management) for more information on state management. - -## Testing - -[Jest](https://jestjs.io/) serves as the tool for unit testing while [Storybook](https://storybook.js.org/) is for component testing. - -Jest is mainly for testing utility functions, and not components themselves. - -Storybook is for testing the behavior of isolated components, as well as displaying the [design system](/contributor/frontend/basics/design-system). diff --git a/packages/twenty-docs/docs/contributor/frontend/basics/contributing.mdx b/packages/twenty-docs/docs/contributor/frontend/basics/contributing.mdx deleted file mode 100644 index 885a8a2d07..0000000000 --- a/packages/twenty-docs/docs/contributor/frontend/basics/contributing.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Contributing -sidebar_position: 1 -description: Learn how you can contribute to the project -sidebar_custom_props: - icon: TbTopologyStar ---- - -## Pre-requisites - -Make sure that your [IDE is correctly setup](/contributor/local-setup/ide-setup) and that your backend is running on `localhost:3000`. - - -## Starting a new feature - -Make sure your database is running on the URL provided in your `server/.env` file. - -```bash -cd front -yarn - -yarn start -``` - -## Regenerate graphql schema based on API graphql schema - -```bash -yarn graphql:generate -``` - -## Lint - -```bash -yarn lint -``` - -## Test - -```bash -yarn test # run jest tests -yarn storybook:dev # run storybook -yarn storybook:test # run tests (needs yarn storybook:dev to be running) -yarn storybook:coverage # run tests (needs yarn storybook:dev to be running) -``` diff --git a/packages/twenty-docs/docs/contributor/frontend/basics/design-system.mdx b/packages/twenty-docs/docs/contributor/frontend/basics/design-system.mdx deleted file mode 100644 index 11790e14c3..0000000000 --- a/packages/twenty-docs/docs/contributor/frontend/basics/design-system.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Design System -description: What our design system looks like -sidebar_position: 7 -sidebar_custom_props: - icon: TbPaint ---- - -The CRM depends on its internal and custom design system, constructed on top of styled-components. - diff --git a/packages/twenty-docs/docs/contributor/frontend/advanced/best-practices.mdx b/packages/twenty-docs/docs/contributor/frontend/best-practices.mdx similarity index 99% rename from packages/twenty-docs/docs/contributor/frontend/advanced/best-practices.mdx rename to packages/twenty-docs/docs/contributor/frontend/best-practices.mdx index 872e12a513..e946733f37 100644 --- a/packages/twenty-docs/docs/contributor/frontend/advanced/best-practices.mdx +++ b/packages/twenty-docs/docs/contributor/frontend/best-practices.mdx @@ -268,7 +268,7 @@ Prop drilling, in the React context, refers to the practice of passing state var 3. **Reduced Component Reusability**: A component receiving a lot of props solely for passing them down becomes less general-purpose and harder to reuse in different contexts. -If you feel that you are using excessive prop drilling, see [state management best practices](/contributor/frontend/advanced/best-practices#state-management). +If you feel that you are using excessive prop drilling, see [state management best practices](#state-management). ## Imports diff --git a/packages/twenty-docs/docs/contributor/frontend/basics/folder-architecture.mdx b/packages/twenty-docs/docs/contributor/frontend/folder-architecture.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/frontend/basics/folder-architecture.mdx rename to packages/twenty-docs/docs/contributor/frontend/folder-architecture.mdx diff --git a/packages/twenty-docs/docs/contributor/frontend/frontend.mdx b/packages/twenty-docs/docs/contributor/frontend/frontend.mdx index 1069f4000d..434bac164b 100644 --- a/packages/twenty-docs/docs/contributor/frontend/frontend.mdx +++ b/packages/twenty-docs/docs/contributor/frontend/frontend.mdx @@ -1,14 +1,86 @@ --- id: frontend title: Frontend Development -displayed_sidebar: frontendSidebar sidebar_position: 0 sidebar_custom_props: icon: TbTerminal2 - isSidebarRoot: true --- -Welcome to the Frontend Development section of the documentation. -Here you will find information about the frontend development process, the recommended tools, and the best practices you should follow. +import DocCardList from '@theme/DocCardList'; + + +## Useful commands + +### Starting the app + +```bash + nx start twenty-front + ``` + +### Regenerate graphql schema based on API graphql schema + +```bash +nx graphql:generate twenty-front +``` + +### Lint + +```bash +nx lint twenty-front +``` + +### Test + +```bash +nx test twenty-front# run jest tests +nx storybook:dev twenty-front# run storybook +nx storybook:test twenty-front# run tests # (needs yarn storybook:dev to be running) +nx storybook:coverage twenty-front # (needs yarn storybook:dev to be running) +``` + +## Tech Stack + +The project has a clean and simple stack, with minimal boilerplate code. + +**App** + +- [React](https://react.dev/) +- [Apollo](https://www.apollographql.com/docs/) +- [GraphQL Codegen](https://the-guild.dev/graphql/codegen) +- [Recoil](https://recoiljs.org/docs/introduction/core-concepts) +- [TypeScript](https://www.typescriptlang.org/) + +**Testing** + +- [Jest](https://jestjs.io/) +- [Storybook](https://storybook.js.org/) + +**Tooling** + +- [Yarn](https://yarnpkg.com/) +- [Craco](https://craco.js.org/docs/) +- [ESLint](https://eslint.org/) + +## Architecture + +### Routing + +[React Router](https://reactrouter.com/) handles the routing. + +To avoid unnecessary [re-renders](/contributor/frontend/best-practices#managing-re-renders) all the routing logic is in a `useEffect` in `PageChangeEffect`. + +### State Management + +[Recoil](https://recoiljs.org/docs/introduction/core-concepts) handles state management. + +See [best practices](/contributor/frontend/best-practices#state-management) for more information on state management. + +## Testing + +[Jest](https://jestjs.io/) serves as the tool for unit testing while [Storybook](https://storybook.js.org/) is for component testing. + +Jest is mainly for testing utility functions, and not components themselves. + +Storybook is for testing the behavior of isolated components, as well as displaying the design system. diff --git a/packages/twenty-docs/docs/contributor/frontend/advanced/hotkeys.mdx b/packages/twenty-docs/docs/contributor/frontend/hotkeys.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/frontend/advanced/hotkeys.mdx rename to packages/twenty-docs/docs/contributor/frontend/hotkeys.mdx diff --git a/packages/twenty-docs/docs/contributor/frontend/advanced/style-guide.mdx b/packages/twenty-docs/docs/contributor/frontend/style-guide.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/frontend/advanced/style-guide.mdx rename to packages/twenty-docs/docs/contributor/frontend/style-guide.mdx diff --git a/packages/twenty-docs/docs/contributor/frontend/basics/work-with-figma.mdx b/packages/twenty-docs/docs/contributor/frontend/work-with-figma.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/frontend/basics/work-with-figma.mdx rename to packages/twenty-docs/docs/contributor/frontend/work-with-figma.mdx diff --git a/packages/twenty-docs/docs/contributor/server/_category_.json b/packages/twenty-docs/docs/contributor/server/_category_.json index 484e2553d7..cf5d22abcb 100644 --- a/packages/twenty-docs/docs/contributor/server/_category_.json +++ b/packages/twenty-docs/docs/contributor/server/_category_.json @@ -1,3 +1,5 @@ { - "position": 4 + "position": 4, + "collapsible": true, + "collapsed": true } diff --git a/packages/twenty-docs/docs/contributor/server/basics/_category_.json b/packages/twenty-docs/docs/contributor/server/basics/_category_.json deleted file mode 100644 index daec3e16a8..0000000000 --- a/packages/twenty-docs/docs/contributor/server/basics/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Basics", - "position": 1 -} diff --git a/packages/twenty-docs/docs/contributor/server/basics/overview.mdx b/packages/twenty-docs/docs/contributor/server/basics/overview.mdx deleted file mode 100644 index 1cd742a3ce..0000000000 --- a/packages/twenty-docs/docs/contributor/server/basics/overview.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Overview -sidebar_position: 0 -sidebar_custom_props: - icon: TbEyeglass ---- - -Twenty primarily uses NestJS for the backend. - -Prisma was the first choice as the ORM with a lot of auto-generated code under the hood. But to offer users flexibility and allow them to create custom fields and custom objects, something more low-level than Prisma made more sense to have more fine-grained control. This is why the project now uses TypeORM. - -Here's what the tech stack now looks like. - -## Tech Stack - -**Core** -- [NestJS](https://nestjs.com/) -- [TypeORM](https://typeorm.io/) -- [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server) - -**Database** -- [Postgres](https://www.postgresql.org/) - -**Third-party integrations** -- [Sentry](https://sentry.io/welcome/) for tracking bugs - -**Testing** -- [Jest](https://jestjs.io/) - -**Tooling** -- [Yarn](https://yarnpkg.com/) -- [ESLint](https://eslint.org/) - -**Development** -- [AWS EKS](https://aws.amazon.com/eks/) \ No newline at end of file diff --git a/packages/twenty-docs/docs/contributor/server/basics/workflows.mdx b/packages/twenty-docs/docs/contributor/server/basics/workflows.mdx deleted file mode 100644 index 5b3fc5a298..0000000000 --- a/packages/twenty-docs/docs/contributor/server/basics/workflows.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Development workflow -sidebar_position: 3 -sidebar_custom_props: - icon: TbTopologyStar ---- - -## First time setup - -``` -cd server -yarn # install dependencies - -yarn prisma:migrate # run migrations -yarn prisma:generate # generate prisma and nestjs-graphql schemas -yarn prisma:seed # provision database with seeds - -# alternatively, you can run -yarn prisma:reset # all-in-one command to reset, migrate, seed and generate schemas -``` - -## Starting a new feature - -Make sure your database is running on the URL provided in your `server/.env` file. - -``` -cd server -yarn -yarn prisma:migrate && yarn prisma:generate - -yarn start:dev -``` - -## Lint - -``` -yarn lint -``` - -## Test - -``` -yarn test -``` - -## Resetting the database - -If you want to reset the database, you can run the following command: - -```bash -cd server -yarn database:reset -``` - -:::warning - -This will drop the database and re-run the migrations and seed. - -Make sure to back up any data you want to keep before running this command. - -::: \ No newline at end of file diff --git a/packages/twenty-docs/docs/contributor/server/others/best-practices.mdx b/packages/twenty-docs/docs/contributor/server/best-practices.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/server/others/best-practices.mdx rename to packages/twenty-docs/docs/contributor/server/best-practices.mdx diff --git a/packages/twenty-docs/docs/contributor/server/basics/custom-objects.mdx b/packages/twenty-docs/docs/contributor/server/custom-objects.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/server/basics/custom-objects.mdx rename to packages/twenty-docs/docs/contributor/server/custom-objects.mdx diff --git a/packages/twenty-docs/docs/contributor/server/others/feature-flags.mdx b/packages/twenty-docs/docs/contributor/server/feature-flags.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/server/others/feature-flags.mdx rename to packages/twenty-docs/docs/contributor/server/feature-flags.mdx diff --git a/packages/twenty-docs/docs/contributor/server/basics/folder-architecture.mdx b/packages/twenty-docs/docs/contributor/server/folder-architecture.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/server/basics/folder-architecture.mdx rename to packages/twenty-docs/docs/contributor/server/folder-architecture.mdx diff --git a/packages/twenty-docs/docs/contributor/server/others/_category_.json b/packages/twenty-docs/docs/contributor/server/others/_category_.json deleted file mode 100644 index da47888894..0000000000 --- a/packages/twenty-docs/docs/contributor/server/others/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Others", - "position": 2 -} diff --git a/packages/twenty-docs/docs/contributor/server/basics/queue.mdx b/packages/twenty-docs/docs/contributor/server/queue.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/server/basics/queue.mdx rename to packages/twenty-docs/docs/contributor/server/queue.mdx diff --git a/packages/twenty-docs/docs/contributor/server/server.mdx b/packages/twenty-docs/docs/contributor/server/server.mdx index 8109acefa6..19b0a54017 100644 --- a/packages/twenty-docs/docs/contributor/server/server.mdx +++ b/packages/twenty-docs/docs/contributor/server/server.mdx @@ -1,12 +1,91 @@ --- title: Backend Development -displayed_sidebar: backendSidebar sidebar_position: 0 sidebar_custom_props: icon: TbTerminal - isSidebarRoot: true --- -Welcome to the Backend Development section of the documentation. -Here you will find information about the development process, the recommended tools, and the best practices you should follow. \ No newline at end of file +import DocCardList from '@theme/DocCardList'; + + + + +## Useful commands + +### First time setup + +``` +yarn prisma:migrate # run migrations +yarn prisma:generate # generate prisma and nestjs-graphql schemas +yarn prisma:seed # provision database with seeds + +# alternatively, you can run +yarn prisma:reset # all-in-one command to reset, migrate, seed and generate schemas +``` + +### Starting the app + +``` +nx prisma:migrate twenty-server +nx prisma:generate twenty-server +nx start:dev twenty-server +``` + +### Lint + +``` +nx lint twenty-server +``` + +### Test + +``` +nx test twenty-server +``` + +### Resetting the database + +If you want to reset the database, you can run the following command: + +```bash +nx database:reset twenty-server +``` + +:::warning + +This will drop the database and re-run the migrations and seed. + +Make sure to back up any data you want to keep before running this command. + +::: + +## Tech Stack + +Twenty primarily uses NestJS for the backend. + +Prisma was the first ORM we used. But in order to allow users to create custom fields and custom objects, a lower-level made more sense as we need to have fine-grained control. The project now uses TypeORM. + +Here's what the tech stack now looks like. + + +**Core** +- [NestJS](https://nestjs.com/) +- [TypeORM](https://typeorm.io/) +- [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server) + +**Database** +- [Postgres](https://www.postgresql.org/) + +**Third-party integrations** +- [Sentry](https://sentry.io/welcome/) for tracking bugs + +**Testing** +- [Jest](https://jestjs.io/) + +**Tooling** +- [Yarn](https://yarnpkg.com/) +- [ESLint](https://eslint.org/) + +**Development** +- [AWS EKS](https://aws.amazon.com/eks/) \ No newline at end of file diff --git a/packages/twenty-docs/docs/contributor/server/others/zapier.mdx b/packages/twenty-docs/docs/contributor/server/zapier.mdx similarity index 100% rename from packages/twenty-docs/docs/contributor/server/others/zapier.mdx rename to packages/twenty-docs/docs/contributor/server/zapier.mdx diff --git a/packages/twenty-docs/docs/developer/_category_.json b/packages/twenty-docs/docs/developer/_category_.json deleted file mode 100644 index 8736dcf623..0000000000 --- a/packages/twenty-docs/docs/developer/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Developer guide", - "position": 3 -} diff --git a/packages/twenty-docs/docs/developer/graphql_api.mdx b/packages/twenty-docs/docs/developer/graphql_api.mdx deleted file mode 100644 index 7adb92f180..0000000000 --- a/packages/twenty-docs/docs/developer/graphql_api.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: GraphQL API -sidebar_position: 2 -sidebar_custom_props: - icon: TbBrandGraphql ---- - -Use the [in-browser GraphiQL app](https://docs.twenty.com/graphql/) to browse, query, and mutate the introspection query. - -## What is GraphQL? - -GraphQL is a query language for APIs that enables declarative data fetching that allows a client to specify the exact data it needs from the API. - -Instead of exposing various endpoints that return fixed data structures, GraphQL exposes only a single endpoint that precisely returns the data that the client asked for. This makes GraphQL more flexible and efficient than other kinds of APIs, like REST APIs. - -You can learn more about GraphQL by going through this [Introduction](https://www.howtographql.com/basics/0-introduction/). - -## About GraphQL Introspection - -GraphQL query language is strongly typed, which makes it possible for you to query and understand the underlying schema. - -With the Introspection feature, you can query the schema and discover the queries (to request data), mutations (to update data), types, and fields available in a particular GraphQL API. - -## Try the GraphQL Playground -You can use the browser-based, interactive [GraphQL playground](https://docs.twenty.com/graphql/) to run mutations and queries to discover valid fields and where you can use them. diff --git a/packages/twenty-docs/docs/developer/rest_api.mdx b/packages/twenty-docs/docs/developer/rest_api.mdx deleted file mode 100644 index 90674e790b..0000000000 --- a/packages/twenty-docs/docs/developer/rest_api.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: REST API -sidebar_position: 3 -sidebar_custom_props: - icon: TbApi ---- - -To use the REST API, you will need an API key. -Connect to your Twenty account ang do to Setting > Developers to generate one. - -## Using Postman? - -You can use [Postman](https://www.postman.com/) to interact with your Twenty objects using the API. -You will need to provide your API key as a Bearer token, -see [Bearer Token Postman Doc](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/#bearer-token) -if needed. - -## Programmatic use? - -You can call the REST API in your application using this endpoint -[https://api.twenty.com/rest](https://api.twenty.com/rest). -You will need to provide your API key as a Bearer token in -your `headers.Authorization = 'Bearer '`. - -## Try the REST API Playground - -You can use the browser-based, interactive -[REST API playground documentation](https://docs.twenty.com/rest-api) -to Create, Read, Update or Delete your workspace objects. diff --git a/packages/twenty-docs/docs/index.mdx b/packages/twenty-docs/docs/index.mdx index 7dd4a6b760..5a3ee40e89 100644 --- a/packages/twenty-docs/docs/index.mdx +++ b/packages/twenty-docs/docs/index.mdx @@ -3,36 +3,24 @@ id: homepage sidebar_position: 0 sidebar_class_name: display-none title: Welcome +hide_title: true +hide_table_of_contents: true custom_edit_url: null +pagination_next: null --- import ThemedImage from '@theme/ThemedImage'; -import Footer from '@theme/Footer' - -Twenty is an Open Source CRM that provides flexibility, tailored to your business needs. It helps you break free from vendor lock-in and limitations, and provides the tools you need to harness the full potential of your data while ensuring a sleek and effortlessly intuitive design that teams will love to use. - -## Idea Behind Twenty -We’ve spent thousands of hours grappling with traditional CRMs like Pipedrive and Salesforce to align them with our business needs, only to end up frustrated—customizations are complex and the closed ecosystems of these platforms can feel restrictive. +Twenty is a CRM designed to fit your unique business needs. +It was brought to life by a passionate community that cares about quality and precision in engineering. -The need for a CRM solution that empowers rather than constrains was clear, which inspired us to create Twenty. It's a next-generation open-source CRM that offers you the flexibility to shape it according to your business objectives and meet your team’s unique needs. Twenty is full of powerful features to give you full control and help you win more deals. - -## Getting started - -There are three ways for you to get started with Twenty: -- **Cloud:** The fastest and easiest way to try the app (it's free) -- **Local:** If you're a developer and would like to experiment or contribute to the app -- **Self-hosting:** If you want greater control over your data and want to run the app on your own server - -See the [Getting Started](./start/getting-started/) guide to learn more. - -## Contributing - -Contributions are what makes the open source community such a great place. - -Code contributions through pull request are most welcome. See the [local setup guide](../contributor/local-setup) to get started. - -You can also contribute by creating an issue to report a bug you've spotted, joining discussions or writing documentation. +There are three different ways to get started: +- **Managed Cloud:** The fastest and easiest way to try the app +- **Loca Setup:** If you're a developer and would like to contribute to the app +- **Self-hosting:** If you know how to run a server and want to host the app yourself -