Skip to content

Commit

Permalink
Merge pull request #30 from blockydevs/frontend-application-starter
Browse files Browse the repository at this point in the history
Frontend application starter
  • Loading branch information
MicDebBlocky authored Apr 3, 2024
2 parents 0239b96 + 6a5c4c2 commit 5bb322f
Show file tree
Hide file tree
Showing 54 changed files with 7,480 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/apps/human-app/frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=https://test.com/
42 changes: 42 additions & 0 deletions packages/apps/human-app/frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const { resolve } = require('node:path');

const project = resolve(__dirname, 'tsconfig.json');

module.exports = {
root: true,
extends: [
require.resolve('@vercel/style-guide/eslint/browser'),
require.resolve('@vercel/style-guide/eslint/typescript'),
require.resolve('@vercel/style-guide/eslint/react'),
'plugin:prettier/recommended',
'plugin:@tanstack/eslint-plugin-query/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/explicit-function-return-type': 'off',
"import/extensions": [
"error", "ignorePackages", {
"ts": "never",
"tsx": "never",
}
],
},
settings: {
'import/resolver': {
typescript: {
project,
},
},
},
};
28 changes: 28 additions & 0 deletions packages/apps/human-app/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.env
.env.local
1 change: 1 addition & 0 deletions packages/apps/human-app/frontend/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
7 changes: 7 additions & 0 deletions packages/apps/human-app/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"endOfLine": "lf"
}
50 changes: 50 additions & 0 deletions packages/apps/human-app/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Human app - Frontend

## Build With

| Tool-Name | Description |
|-------|----|
| [ESlint](https://github.com/vercel/style-guide) with [Prettier plugin](https://github.com/prettier/eslint-plugin-prettier) | Linting and Formatting
| [ESlint Vercel style guide](https://github.com/vercel/style-guide) | eslint config preset
| [Husky](https://typicode.github.io/husky/get-started.html) with [lint-staged](https://github.com/lint-staged/lint-staged?tab=readme-ov-file#-lint-staged----) | pre-commit
| [TypeScript](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) | Static typing
| [Vite](https://vitejs.dev/guide/why.html) | Bundler
| [React](https://react.dev/learn/describing-the-ui) | Frontend Framework
| [React Router](https://reactrouter.com/en/main/start/tutorial) | Client Side Routing
| [TanStack Query](https://tanstack.com/query/latest/docs/framework/react/overview) | Async state management
| [Material UI](https://mui.com/material-ui/getting-started/) | UI Components |
| [Material Icons](https://mui.com/material-ui/material-icons/) | Icons |
| [Material React Table](https://www.material-react-table.com/about) | Table component for material ui
| [Zod](https://github.com/colinhacks/zod?tab=readme-ov-file#table-of-contents) | Runtime Validations
| [i18next](https://react.i18next.com/getting-started) | Internationalization Framework

## Getting Started

### Prerequisites

- [Node.js minimal v18](https://nodejs.org/en)
- [pnpm](https://pnpm.io/installation)

### Install Packages

```sh
pnpm install
```

### Compile and Hot-Reload for Development

```sh
pnpm dev
```

### Type-Check, Compile and Minify for Production

```sh
pnpm build
```

### Linting and Formatting

```sh
pnpm lint
```
13 changes: 13 additions & 0 deletions packages/apps/human-app/frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
65 changes: 65 additions & 0 deletions packages/apps/human-app/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "human-app-frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest",
"prepare": "husky"
},
"lint-staged": {
"*.{ts,tsx}": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@fontsource/roboto": "^5.0.8",
"@hookform/resolvers": "^3.3.4",
"@mui/icons-material": "^5.15.7",
"@mui/material": "^5.15.7",
"@tanstack/react-query": "^5.18.1",
"i18next": "^23.8.2",
"lodash": "^4.17.21",
"mui-image": "^1.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.50.0",
"react-i18next": "^14.0.2",
"react-imask": "^7.4.0",
"react-number-format": "^5.3.1",
"react-router-dom": "^6.22.0",
"vite-plugin-svgr": "^4.2.0",
"zod": "^3.22.4",
"zustand": "^4.5.0"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.18.1",
"@tanstack/react-query-devtools": "^5.18.1",
"@types/lodash": "^4.14.202",
"@types/mui-image": "^1.0.5",
"@types/node": "^20.11.16",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"jsdom": "^24.0.0",
"@vercel/style-guide": "^5.2.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/ui": "^1.4.0",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-refresh": "^0.4.5",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"prettier": "^3.2.5",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vitest": "^1.2.2"
}
}
Loading

0 comments on commit 5bb322f

Please sign in to comment.