Skip to content

Commit 2690c07

Browse files
committed
Initial
0 parents  commit 2690c07

25 files changed

Lines changed: 5688 additions & 0 deletions

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintrc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2020": true,
5+
"jest": true,
6+
"node": true
7+
},
8+
"settings": {
9+
"react": {
10+
"version": "detect"
11+
}
12+
},
13+
"extends": [
14+
"eslint:recommended",
15+
"plugin:react/recommended",
16+
"plugin:@typescript-eslint/eslint-recommended",
17+
"plugin:@typescript-eslint/recommended",
18+
"plugin:tailwindcss/recommended"
19+
],
20+
"parser": "@typescript-eslint/parser",
21+
"parserOptions": {
22+
"ecmaFeatures": {
23+
"jsx": true
24+
},
25+
"ecmaVersion": 11,
26+
"sourceType": "module"
27+
},
28+
"plugins": ["react", "react-hooks", "@typescript-eslint", "tailwindcss"],
29+
"rules": {
30+
"react-hooks/rules-of-hooks": "error",
31+
"react-hooks/exhaustive-deps": "warn",
32+
"react/prop-types": "off",
33+
"react/react-in-jsx-scope": "off",
34+
"@typescript-eslint/explicit-module-boundary-types": "off",
35+
"@typescript-eslint/no-non-null-assertion": "off",
36+
"tailwindcss/classnames-order": "warn",
37+
"tailwindcss/no-custom-classname": "warn",
38+
"tailwindcss/no-contradicting-classname": "error"
39+
}
40+
}

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
dist
2+
dist-ssr
3+
*.local
4+
5+
# dependencies
6+
/node_modules
7+
/.pnp
8+
.pnp.js
9+
10+
.api
11+
12+
# production
13+
/build
14+
15+
# misc
16+
.DS_Store
17+
*.pem
18+
19+
# debug
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
24+
# local env files
25+
.env
26+
.env.local
27+
.env.development.local
28+
.env.test.local
29+
.env.production.local

.vitest/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@testing-library/jest-dom/vitest'

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"bradlc.vscode-tailwindcss",
4+
"dbaeumer.vscode-eslint",
5+
"editorconfig.editorconfig",
6+
"stivo.tailwind-fold",
7+
"vitest.explorer"
8+
]
9+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": "explicit"
4+
},
5+
"files.associations": {
6+
"*.css": "tailwindcss"
7+
}
8+
}

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
## Task
2+
3+
Go to our [sample API docs](https://sampleapi-explorer.squaredup.com/api-details#api=integrations-v1&operation=service-desk)
4+
5+
This is an API that returns sample service desk data.
6+
7+
The page documents the API definition, the base URL and the optional parameters. There is an example `JSON` response. You can also click the `Try it` button and see different responses based on the supplied query string parameters.
8+
9+
You will use this API to retrieve the data necessary for this task.
10+
11+
*Note*: We are not expecting you to complete **all** of the following tasks. Try to complete as many tasks as you can - ensure the tasks you select match your skill set. Focus on addressing the tasks that create the most significant impact for the end user
12+
13+
### Back-end
14+
- Find the percentage of problems vs questions vs task types of issues on sample of 500 data points
15+
- Find the percentage of high vs medium vs low priority issues on sample of 500 data points
16+
- Find the average time it took to close high priority issues of any type on sample of 500 data points
17+
- What was the “score” value of the “satisfaction_rating” on the issue that took longer to solve in the above set?
18+
- If time allows, feel free to return any other useful insights from the dataset that you can think of
19+
20+
You can choose how you want to present the above data; simple HTML or JSON is fine.
21+
22+
### Front-end
23+
- A service desk operator wants to view a list of all issues of any type, sorted by priority (use sample of 100 data points)
24+
- A service desk operator wants to filter all the open issues of high priority
25+
- A service desk operator wants to search a list of issues by a word that is contained within the "organization_id"
26+
- A service desk manager wants a high-level view of key data including number of tickets by priority, type, status and satisfaction_rating
27+
28+
Choose how you want to present the above data
29+
30+
---
31+
32+
## Structure
33+
34+
We are using `Vite` as the front-end build and local development tool. The client is built with `React`, and `Tailwind CSS` is available to simplify styling. All React components are located in the `src/components/` directory. The `index.tsx` file simply mounts the `React` app and does not need to be modified.
35+
36+
We are also using the `vite-plugin-api-routes` plugin to create directory-based API routes. Both `routeBase` and `dirs` are set to: `api`. To add additional routes, simply create a new file in the `api` directory with the desired route name. For example, `src/api/aggregate.ts` will create a `/api/aggregate` route. An exported `GET`, `POST`, or `PUT` function in that file will define the method handler in the respective route.
37+
38+
The `tests` directory is available for adding test cases. It includes subdirectories for `client` and `api` to help organise your tests. To simplify testing, we’ve integrated Mock Service Worker (`mws`). `msw` allows you to create a mock server and simulate API responses. You can find an example in `src/tests/client/App.test.tsx:8`, which demonstrates mocking the `api/data` route.
39+
40+
We are using `TypeScript`. If you're unfamiliar with it, `TypeScript` extends `JavaScript` with syntax for adding static types. It infers types wherever possible, but you can explicitly add types to reduce the likelihood of errors in your code. As an example, we’ve included a `SampleData` interface in `src/api/types`. You should not need to modify or configure the TypeScript compiler options.
41+
42+
Good luck! :thumbsup:
43+
44+
## Getting Started
45+
46+
### Install
47+
48+
Install dependencies.
49+
50+
```bash
51+
pnpm install
52+
```
53+
54+
Serve with hot reload at <http://localhost:5173>.
55+
56+
```bash
57+
pnpm run dev
58+
```
59+
60+
### Lint
61+
62+
```bash
63+
pnpm run lint
64+
```
65+
66+
### Typecheck
67+
68+
```bash
69+
pnpm run typecheck
70+
```
71+
72+
### Build
73+
74+
```bash
75+
pnpm run build
76+
```
77+
78+
### Test
79+
80+
```bash
81+
pnpm run test
82+
```
83+
84+
View and interact with your tests via UI.
85+
86+
```bash
87+
pnpm run test:ui
88+
```

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>React 18, TypeScript, Jest, Testing Library, TailwindCSS 3, Vite, and Eslint boilerplate</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/index.tsx"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "reactjs-vite-tailwindcss-boilerplate",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"serve": "vite preview",
10+
"test": "vitest",
11+
"test:ui": "vitest --ui",
12+
"lint": "eslint src --max-warnings=0",
13+
"typecheck": "tsc --project tsconfig.json --noEmit"
14+
},
15+
"dependencies": {
16+
"axios": "^1.7.9",
17+
"express": "^4.21.1",
18+
"react": "^18.3.1",
19+
"react-dom": "^18.3.1",
20+
"react-query": "^3.39.3",
21+
"vite-plugin-api-routes": "^1.1.12"
22+
},
23+
"devDependencies": {
24+
"@testing-library/jest-dom": "^6.6.3",
25+
"@testing-library/react": "^14.3.1",
26+
"@types/express": "^5.0.0",
27+
"@types/node": "^20.17.6",
28+
"@types/react": "^18.3.12",
29+
"@types/react-dom": "^18.3.1",
30+
"@typescript-eslint/eslint-plugin": "^6.21.0",
31+
"@typescript-eslint/parser": "^6.21.0",
32+
"@vitejs/plugin-react-swc": "^3.7.1",
33+
"@vitest/ui": "^1.6.0",
34+
"autoprefixer": "^10.4.20",
35+
"eslint": "^8.57.1",
36+
"eslint-plugin-react": "^7.37.2",
37+
"eslint-plugin-react-hooks": "^4.6.2",
38+
"eslint-plugin-tailwindcss": "^3.17.5",
39+
"happy-dom": "^15.11.6",
40+
"msw": "^2.6.6",
41+
"postcss": "^8.4.49",
42+
"tailwindcss": "^3.4.15",
43+
"typescript": "^5.6.3",
44+
"vite": "^5.4.11",
45+
"vite-tsconfig-paths": "^4.3.2",
46+
"vitest": "^1.6.0"
47+
}
48+
}

0 commit comments

Comments
 (0)