Skip to content

Commit

Permalink
Improve documentation (twentyhq#82)
Browse files Browse the repository at this point in the history
* Propose new doc architecture

* Many improvements to documentation (styling, structure...)

* Remove modules added inadvertently + continue improving styling

* Swizzle navbar item to add support for custom icon

* Additional doc styling

* Setup docs for API and redirect homepage for docs
  • Loading branch information
FelixMalfait authored Apr 26, 2023
1 parent 35cf3ee commit 42bf653
Show file tree
Hide file tree
Showing 54 changed files with 2,597 additions and 703 deletions.
73 changes: 10 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,16 @@
# Twenty

Welcome to Twenty documentation!
Twenty is a open source CRM designed to solve the issues that are still prevalent amongst the existings solutions.
It is meant to be:
- Easily extendable
- Perfectly in-sync with your data
- Crafted with care and enjoyable to use

## High Level Overview
![Mockup of the CRM](/docs/src/img/mockup.png)

Twenty development stack is composed of 3 different layers

- front: our frontend React app
- hasura: our graphql engine exposing our database and server
- server: our backend that contain endpoint, crm logic, scripts, jobs...
- storages: postgres
# Documentation
The doc is available on [docs.twenty.com](docs.twenty.com)

## Setup env variables and npmrc variables

1. `cp ./infra/dev/.env.example ./infra/dev/.env` and fill with values
2. `cp ./front/.npmrc.example ./front/.npmrc` and fill with values

## Development environment setup with docker-compose (Recommended)

We also provide a containerized environment with Docker and orchestrated with docker-compose in case it is easier for you. This install will also provision a postgres container out of the box.

### Step 1: pre-requesites

Make sure to have the latest Docker and Docker-compose versions installed on your computer. You can run `docker-compose --version` to check if you have docker-compose installed and `docker --version` to check if you have docker installed.

### Step 2: docker build

Build docker containers.

The whole setup experience is happening in `infra/dev` folder. Make sure to be in this folder:

```
cd infra/dev
```

```
make build
make up
```

Once this is completed you should have:

- front available on: http://localhost:3001
- hasura available on: http://localhost:8080
- server available on: http://localhost:3000/health
- postgres: available on http://localhost:5432 that should contain `twenty` database

### Step 3: IDE setup

If you are using VSCode, please use the `Dev Containers` extension to open the project in a container. This will allow you to run Visual Studio on top of the docker container. This will allow you to run the project without having to install node on your machine.

### Note

If you are using Docker install, make sure to ssh in the docker container during development to execute commands. You can also use `Makefile` to help you

## Development workflow

### Front tests

Run tests: `make front-test`
Run coverage: `make front-coverage`
Run storybook: `make front-storybook`

### Hasura development

Open hasura console: `make hasura-console`
Do your changes in hasura console on http://localhost:9695
Commit your changes in git
We don't have a Slack community yet but we will create one when we are ready to launch.
In the meantime, feel free to create a Github issue or open a discussion.
1 change: 1 addition & 0 deletions docs/docs/dev-docs/data/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Data layer
4 changes: 4 additions & 0 deletions docs/docs/dev-docs/data/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Data layer",
"position": 3
}
1 change: 1 addition & 0 deletions docs/docs/dev-docs/data/connect.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Connecting to data sources
1 change: 1 addition & 0 deletions docs/docs/dev-docs/data/mapping.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Mapping entities
1 change: 1 addition & 0 deletions docs/docs/dev-docs/data/optimization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Caching and optimization
4 changes: 4 additions & 0 deletions docs/docs/dev-docs/development/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Translate your site

Let's translate `docs/intro.md` to French.
4 changes: 4 additions & 0 deletions docs/docs/dev-docs/development/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Development",
"position": 2
}
1 change: 1 addition & 0 deletions docs/docs/dev-docs/development/architecture.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Architecture
1 change: 1 addition & 0 deletions docs/docs/dev-docs/development/core-entities.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Core entities
8 changes: 2 additions & 6 deletions docs/docs/dev-docs/getting-started/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"label": "Tutorial - Basics",
"position": 2,
"link": {
"type": "generated-index",
"description": "5 minutes to learn the most important Docusaurus concepts."
}
"label": "Getting started",
"position": 1
}
1 change: 1 addition & 0 deletions docs/docs/dev-docs/getting-started/cloud-setup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Cloud setup
23 changes: 0 additions & 23 deletions docs/docs/dev-docs/getting-started/congratulations.md

This file was deleted.

34 changes: 0 additions & 34 deletions docs/docs/dev-docs/getting-started/create-a-blog-post.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/docs/dev-docs/getting-started/create-a-document.md

This file was deleted.

43 changes: 0 additions & 43 deletions docs/docs/dev-docs/getting-started/create-a-page.md

This file was deleted.

31 changes: 0 additions & 31 deletions docs/docs/dev-docs/getting-started/deploy-your-site.md

This file was deleted.

File renamed without changes.
74 changes: 74 additions & 0 deletions docs/docs/dev-docs/getting-started/local-setup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
sidebar_position: 0
slug: '/'
---

# Twenty

Welcome to Twenty documentation!

## High Level Overview

Twenty development stack is composed of 3 different layers

- front: our frontend React app
- hasura: our graphql engine exposing our database and server
- server: our backend that contain endpoint, crm logic, scripts, jobs...
- storages: postgres

## Setup env variables and npmrc variables

1. `cp ./infra/dev/.env.example ./infra/dev/.env` and fill with values
2. `cp ./front/.npmrc.example ./front/.npmrc` and fill with values

## Development environment setup with docker-compose (Recommended)

We also provide a containerized environment with Docker and orchestrated with docker-compose in case it is easier for you. This install will also provision a postgres container out of the box.

### Step 1: pre-requesites

Make sure to have the latest Docker and Docker-compose versions installed on your computer. You can run `docker-compose --version` to check if you have docker-compose installed and `docker --version` to check if you have docker installed.

### Step 2: docker build

Build docker containers.

The whole setup experience is happening in `infra/dev` folder. Make sure to be in this folder:

```
cd infra/dev
```

```
make build
make up
```

Once this is completed you should have:

- front available on: http://localhost:3001
- hasura available on: http://localhost:8080
- server available on: http://localhost:3000/health
- postgres: available on http://localhost:5432 that should contain `twenty` database

### Step 3: IDE setup

If you are using VSCode, please use the `Dev Containers` extension to open the project in a container. This will allow you to run Visual Studio on top of the docker container. This will allow you to run the project without having to install node on your machine.

### Note

If you are using Docker install, make sure to ssh in the docker container during development to execute commands. You can also use `Makefile` to help you

## Development workflow

### Front tests

Run tests: `make front-test`
Run coverage: `make front-coverage`
Run storybook: `make front-storybook`

### Hasura development

Open hasura console: `make hasura-console`
Do your changes in hasura console on http://localhost:9695
Commit your changes in git
Loading

0 comments on commit 42bf653

Please sign in to comment.