Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# CookieCutter React TS CwClient
This is a [CookieCutter](https://github.com/cookiecutter/cookiecutter) template to create
a React, with TypeScript application, initialized with a simple example for
[@cubicweb/Client](https://www.npmjs.com/package/@cubicweb/client)
## How to use it
First of all you need to
[install CookieCutter](https://cookiecutter.readthedocs.io/en/stable/installation.html#install-cookiecutter)
if this is not already installed:
```bash
python3 -m pip install --user cookiecutter
```
then you can create the new project using the CookieCutter template:
```bash
cookiecutter ssh://git@forge.extranet.logilab.fr/cubicweb/cookiecutter-react-ts-cwclient
```
The prompt will ask several questions about project details:
- `project_slug`: is the project name, which will be used as `package.json`
name and folder name
- `description`: is the project description which will appear in the
`package.json`
- `author`: is the project author name which will appear in the `package.json`
- `license`: is the project license which will appear in the `package.json`
- `cubicweb_server`: is the CubicWeb instance you want to query (/!\ this is
ths CubicWeb instance URL, not the API one, the `/api` will be added
automatically)
then you can go to the folder:
```bash
cd {project_slug}
```
and install all needed dependencies:
```bash
yarn
```
you can now start the dev server using the folowing command:
```bash
yarn start
```
This application uses React-Router with only one route, which renders a list of
CWUser. This is a simple example to show how it works and what we can do. You
can now modify everything you need to adapt to your proper needs.