Skip to content

Commit df2c475

Browse files
committed
init spa example
0 parents  commit df2c475

21 files changed

+3022
-0
lines changed

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
.prettierrc.js
4+
.eslintrc.js
5+
env.d.ts

.eslintrc.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
extends: [
3+
// By extending from a plugin config, we can get recommended rules without having to add them manually.
4+
'eslint:recommended',
5+
'plugin:react/recommended',
6+
'plugin:import/recommended',
7+
'plugin:jsx-a11y/recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
// This disables the formatting rules in ESLint that Prettier is going to be responsible for handling.
10+
// Make sure it's always the last config, so it gets the chance to override other configs.
11+
'eslint-config-prettier',
12+
],
13+
settings: {
14+
react: {
15+
// Tells eslint-plugin-react to automatically detect the version of React to use.
16+
version: 'detect',
17+
},
18+
// Tells eslint how to resolve imports
19+
'import/resolver': {
20+
node: {
21+
paths: ['src'],
22+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
23+
},
24+
},
25+
},
26+
rules: {
27+
// Add your own rules here to override ones from the extended configs.
28+
},
29+
};

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
.env.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
.prettierrc.js

.prettierrc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"printWidth": 120,
7+
"bracketSpacing": true
8+
}

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# example-pephub-spa
2+
An example single page application using the PEPhub API and the authentication flow.
3+
4+
## Getting started
5+
First, clone the repository. Then install dependencies and run the development server.
6+
```
7+
yarn install
8+
yarn dev
9+
```

index.html

+13
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="/pep-dark.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>PEPhub Example SPA</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

package.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "example-pephub-spa",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@typescript-eslint/eslint-plugin": "^5.54.1",
13+
"@typescript-eslint/parser": "^5.54.1",
14+
"eslint": "^8.35.0",
15+
"eslint-config-prettier": "^8.7.0",
16+
"eslint-plugin-import": "^2.27.5",
17+
"eslint-plugin-jsx-a11y": "^6.7.1",
18+
"eslint-plugin-react": "^7.32.2",
19+
"eslint-plugin-typescript": "^0.14.0",
20+
"jwt-decode": "^3.1.2",
21+
"react": "^18.2.0",
22+
"react-cookie": "^4.1.1",
23+
"react-dom": "^18.2.0",
24+
"react-router-dom": "^6.8.2"
25+
},
26+
"devDependencies": {
27+
"@types/react": "^18.0.27",
28+
"@types/react-dom": "^18.0.10",
29+
"@vitejs/plugin-react-swc": "^3.0.0",
30+
"autoprefixer": "^10.4.13",
31+
"postcss": "^8.4.21",
32+
"prettier": "^2.8.4",
33+
"tailwindcss": "^3.2.7",
34+
"typescript": "^4.9.3",
35+
"vite": "^4.1.0"
36+
}
37+
}

postcss.config.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

public/pep-dark.svg

+108
Loading

public/pep.svg

+108
Loading

src/globals.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

0 commit comments

Comments
 (0)