This CLI helps to create new implemented front-end demo for React with Typescript, Apollo GraphQL Client and Material UI from a boilerplate. To have a Full Stack project, or to test created demo, you can setup graphql server with using Express Generator CLI for Graphql Backend
npm install -g express-generator-react-typescript-material-apollo-graphqlGo to the directory on terminal where you want to generate the project.
$ cd PATHand run the generator command with specifying the project name.
$ express-generator-rtmag --name="PROJECT_NAME"When you generate the project, you will have;
- GraphQL Queries with implementations in Typescript for Demo User Entity
- GraphQL Mutations with implementations in Typescript for Demo User Entity
- CRUD operations in Typescript for Demo User Entity
- Full Ready CRUD Demo User Components: User List Component, Single User Component, User Dialog Component
This boilerplate has common graphql client design architecture. Layers:
- Components holds component implementations
- Models holds document interfaces and schema models
- Mutations holds basic mutation scripts to send graphql server; create, update, delete
- Queries holds basic query scripts to send graphql server; retrieve
Install the dependencies and devDependencies:
$ cd <Project Name>
$ npm installSet configuration parameters on config/index.ts:
GRAPHQL_URL: "{{GRAPHQL API URL}}"And that's all, start the client
$ npm startexpress-generator-rtmag is currently extended with the following plugins. Instructions on how to use them in your own application are linked below.
| Plugin | Usage |
|---|---|
| ejs | to render global parameters like Project Name |
| inquirer | to ask questions and parse input |
| shelljs | to eliminate your shell script's dependency on Unix |
| yargs | to build interactive command line tools |
| shx | to wrap around ShellJS Unix commands |
| ts-node | to execute TypeScript and REPL for node.js, with source map support |
express-generator-rtmag requires Node.js v10+ to run.
Install the dependencies and devDependencies and start the application.
$ cd express-generator-react-typescript-material-apollo-graphql
$ npm install
$ npm startTo install the CLI globally:
$ npm run-script build
$ npm install -g .And global usage:
$ express-generator-rtmag --name="PROJECT_NAME"- Fatih Türker
No sponsors yet! Will you be the first?
No contributers yet! Will you be the first?
MIT