Thanks for your interest.
Create a React and Node.js backend application using GraphQL.
- Fork this repo to your own account.
- Build the application as per the Instructions below.
- This application needs to be written fully in
TypeScript. Define types as much as possible. Do not useanytype. - We'll be looking for clean code as much as possible.
- Once done, please commit your code to your forked repo and share the link with us.
Good luck
Folder structure is up to you. You can use the following structure:
├── backend
│ ├── src
│ │ ├── index.ts
│ │ ├── schema.ts
│ │ ├── resolvers.ts
│ │ └── data.json
│ ├── package.json
│ ├── tsconfig.json
│ └── ...
├── frontend
│ ├── src
│ │ ├── index.tsx
│ │ ├── App.tsx
│ │ ├── pages
│ │ │ ├── listing.tsx
│ │ │ └── detail.tsx
│ │ └── ...
│ ├── package.json
│ ├── tsconfig.json
│ └── ...
├── README.md
└── ...- Read the Sample data using the
File systemmodule. You can create adata.jsonfile and read the data from it. - Create a
GraphQLserver usingApollo Serverand expose the data as follows:- Create a
Querytype with aclientsfield that returns the list of clients. - Create a
Clienttype with the following fields:idnameagegenderadditionalInfo
- Create a
AdditionalInfotype with the following fields:companyemailphoneaddress
- Create a
- Create a
Reactapplication usingVite. - Read data from the
GraphQLserver using Apollo client and render the data as follows:- Store read data in a global state using React context or Redux/Redux toolkit.
- Create a listing page that shows the
id,nameandageof the clients in a table. When the user clicks on thename, navigate to a detail page. Usereact-router-dom. Use version 6.4 or above. Usage of routeloader,Outlet,defer,AwaitedandSuspenseis a plus. - Create a detail page that shows the
id,name,age,genderandadditionalInfoof the client. - Style the pages as you see fit. Feel free to use one of the CSS frameworks below:
Some of the following are not required but will be a plus.
- Store the data in a database. You can use
PostgreSQLorMySQL. - Use
TypeGraphQLto define theGraphQLschema. - Use
Sequelizeto define the database models. - Create migrations for the database models.
- Create unit tests for the backend using
Jest. - Create unit tests for the frontend using
JestandReact Testing Library. - Use codegen to generate types for the
GraphQLschema to be used in the frontend.
{
"clients": [
{
"id": "59761c23b30d971669fb42ff",
"age": 36,
"name": "Dunlap Hubbard",
"gender": "male",
"additionalInfo": {
"company": "CEDWARD",
"email": "[email protected]",
"phone": "+1 (890) 543-2508",
"address":
"169 Rutledge Street, Konterra, Northern Mariana Islands, 8551"
}
},
{
"id": "59761c233d8d0f92a6b0570d",
"age": 24,
"name": "Kirsten Sellers",
"additionalInfo": {
"gender": "female",
"company": "EMERGENT",
"email": "[email protected]",
"phone": "+1 (831) 564-2190",
"address": "886 Gallatin Place, Fannett, Arkansas, 4656"
}
},
{
"id": "59761c23fcb6254b1a06dad5",
"age": 30,
"name": "Acosta Robbins",
"additionalInfo": {
"gender": "male",
"company": "ORGANICA",
"email": "[email protected]",
"phone": "+1 (882) 441-3367",
"address": "697 Linden Boulevard, Sattley, Idaho, 1035"
}
},
]
}