Skip to content
Snippets Groups Projects

CookieCutter React TS CwClient

This is a CookieCutter template to create a React, with TypeScript application, initialized with a simple example for @cubicweb/Client

How to use it

First of all you need to install CookieCutter if this is not already installed:

python3 -m pip install --user cookiecutter

then you can create the new project using the CookieCutter template:

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:

cd {project_slug}

and install all needed dependencies:

yarn

you can now start the dev server using the folowing command:

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.