This Startup Kit is written in TypeScript and uses Apollo Client + React + Material-UI + Parcel.
All the source files are located in the src
folder which is divided into following directories:
client
- all the files needed to setup Apollo Clientcomponents
- components used in the app (also reusable ones)graphql
queries
- all the GraphQL queries used in the appmutations
- all the GraphQL mutations used in the app
pages
- components used as pages in routingtypes
- some TypeScript types defined to be used as component property types
The test files are located in the tests
directory.
To run project locally in development mode, first you have to create .env
file in the root directory of the project. You shouldn't commit this file. File content should look like:
GRAPHQL_URL=http://localhost:4000
Next you can run project by executing command:
npm run dev
In your CI tool you have to define environment variables. Here is a list of variables:
GRAPHQL_URL=http://localhost:4000
Next you have to build project by running command:
npm run build
To test project, you have to run command:
npm run test