Skip to content

Commit 548d8a7

Browse files
committed
Initial commit
0 parents  commit 548d8a7

9 files changed

+248
-0
lines changed

.eslintrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2020": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:react-hooks/recommended"
11+
],
12+
"ignorePatterns": [
13+
"dist",
14+
".eslintrc.json"
15+
],
16+
"parser": "@typescript-eslint/parser",
17+
"plugins": [
18+
"react-refresh"
19+
],
20+
"rules": {
21+
"react-refresh/only-export-components": [
22+
"warn",
23+
{
24+
"allowConstantExport": true
25+
}
26+
]
27+
}
28+
}

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"endOfLine": "lf"
4+
}

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 class="h-full bg-white">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/farmis_small.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Farmis Cloud 2.0</title>
8+
</head>
9+
<body class="h-full">
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "frontend",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@headlessui/react": "^2.0.3",
14+
"@heroicons/react": "^2.1.3",
15+
"@mui/material": "^5.15.20",
16+
"@mui/x-data-grid-premium": "^7.7.0",
17+
"@mui/x-license-pro": "^6.10.2",
18+
"@tailwindcss/forms": "^0.5.7",
19+
"@types/date-fns": "^2.6.0",
20+
"axios": "^1.7.2",
21+
"bson": "^6.7.0",
22+
"date-fns": "^3.6.0",
23+
"nanoid": "^5.0.7",
24+
"react": "^17.0.0 || ^18.0.0",
25+
"react-day-picker": "^8.10.1",
26+
"react-dom": "^17.0.0 || ^18.0.0",
27+
"react-router-dom": "^6.23.1"
28+
},
29+
"devDependencies": {
30+
"@types/react": "^18.3.3",
31+
"@types/react-dom": "^18.2.22",
32+
"@typescript-eslint/eslint-plugin": "^7.13.0",
33+
"@typescript-eslint/parser": "^7.13.0",
34+
"@vitejs/plugin-react-swc": "^3.5.0",
35+
"autoprefixer": "^10.4.19",
36+
"eslint": "^8.57.0",
37+
"eslint-plugin-react-hooks": "^4.6.0",
38+
"eslint-plugin-react-refresh": "^0.4.6",
39+
"postcss": "^8.4.38",
40+
"tailwindcss": "^3.4.3",
41+
"typescript": "^5.2.2",
42+
"vite": "^5.2.0",
43+
"vite-tsconfig-paths": "^4.3.2"
44+
},
45+
"peerDependencies": {
46+
"react": "^17.0.0 || ^18.0.0",
47+
"react-dom": "^17.0.0 || ^18.0.0"
48+
}
49+
}

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

src/defaultTheme.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { createTheme, Theme } from '@mui/material/styles';
2+
import { csCZ } from '@mui/x-data-grid-premium/locales';
3+
import type {} from '@mui/x-data-grid-premium/themeAugmentation';
4+
5+
const theme: Theme = createTheme(
6+
{
7+
typography: {
8+
fontSize: 14,
9+
fontFamily: 'Roboto Condensed',
10+
},
11+
components: {
12+
MuiDataGrid: {
13+
styleOverrides: {
14+
root: {
15+
'& .MuiDataGrid-footerContainer': {
16+
minHeight: '32px',
17+
border: '0',
18+
},
19+
'& .MuiDataGrid-row.Mui-selected': {
20+
backgroundColor: 'rgba(0, 0, 0, 0.2)',
21+
},
22+
'& .MuiDataGrid-row.Mui-hovered': {
23+
backgroundColor: 'rgba(9,234,135,0.8)',
24+
},
25+
'& .MuiDataGrid-row.Mui-focused': {
26+
backgroundColor: 'rgba(255,60,143,0.73)',
27+
},
28+
'& .MuiDataGrid-row.Mui-selected.Mui-hovered': {
29+
backgroundColor: 'rgba(44,44,44,0.4)',
30+
},
31+
'& .MuiDataGrid-editInputCell>.MuiInputBase-input': {
32+
paddingLeft: '9px',
33+
},
34+
'& .MuiDataGrid-cell.MuiDataGrid-cell--editing': {
35+
paddingTop: '0px',
36+
},
37+
'& .MuiDataGrid-columnHeader': {
38+
// currently unused, changed to container--top
39+
backgroundColor: 'rgb(69,153,236)',
40+
color: 'white',
41+
},
42+
'& .MuiDataGrid-withBorderColor.MuiDataGrid-withBorderColor': {
43+
borderColor: 'rgba(44, 44, 44, 0.4)',
44+
},
45+
'& .MuiDataGrid-columnHeader.MuiDataGrid-withBorderColor': {
46+
borderColor: 'white',
47+
},
48+
// '& .MuiDataGrid-virtualScrollerContent': {
49+
// border: '1px solid rgba(44, 44, 44, 0.4)',
50+
// },
51+
},
52+
},
53+
},
54+
},
55+
},
56+
csCZ,
57+
);
58+
59+
export default theme;

tailwind.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('tailwindcss').Config} */
2+
import forms from '@tailwindcss/forms';
3+
import defaultTheme from 'tailwindcss/defaultTheme';
4+
5+
export default {
6+
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
7+
theme: {
8+
fontFamily: {
9+
...defaultTheme.fontFamily,
10+
sans: ['Asap Condensed', ...defaultTheme.fontFamily.sans],
11+
},
12+
extend: {},
13+
},
14+
plugins: [forms],
15+
};

tsconfig.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2022",
4+
"useDefineForClassFields": true,
5+
"lib": [
6+
"ES2022",
7+
"DOM",
8+
"DOM.Iterable"
9+
],
10+
"module": "ESNext",
11+
"skipLibCheck": true,
12+
/* Bundler mode */
13+
"moduleResolution": "bundler",
14+
"allowSyntheticDefaultImports": true,
15+
"allowImportingTsExtensions": true,
16+
"resolveJsonModule": true,
17+
"isolatedModules": true,
18+
"noEmit": true,
19+
"jsx": "react-jsx",
20+
/* Linting */
21+
"strict": true,
22+
"noUnusedLocals": true,
23+
"noUnusedParameters": true,
24+
"noFallthroughCasesInSwitch": true,
25+
"outDir": "./dist",
26+
"paths": {
27+
"@types": [
28+
"./src/ClientTypes/ClientMergedTypes"
29+
],
30+
"@routes/*": [
31+
"./src/shared/routes/"
32+
],
33+
"@constants/*": [
34+
"./src/shared/constants/*"
35+
]
36+
},
37+
"include": [
38+
"vite.config.ts",
39+
"src"
40+
],
41+
}
42+
}

vite.config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { defineConfig } from 'vite';
2+
import react from '@vitejs/plugin-react-swc';
3+
import tsconfigPaths from 'vite-tsconfig-paths';
4+
import path from 'path';
5+
// https://vitejs.dev/config/
6+
export default defineConfig({
7+
plugins: [tsconfigPaths(), react()],
8+
build: {
9+
outDir: '../server/reactapp',
10+
target: ['esnext'], // Transpile for modern browsers
11+
},
12+
server: {
13+
host: 'localhost',
14+
proxy: {
15+
'^/api/.*': {
16+
target: 'http://localhost:5001',
17+
changeOrigin: true,
18+
secure: false,
19+
rewrite: (path) => {
20+
return path.replace(/^\/api/, '');
21+
},
22+
},
23+
},
24+
},
25+
resolve: {
26+
alias: {
27+
'@types': path.resolve(__dirname, './src/shared/types/types.ts'),
28+
'@routes': path.resolve(__dirname, './src/shared/routes'),
29+
'@constants': path.resolve(__dirname, './src/shared/constants'),
30+
},
31+
},
32+
});

0 commit comments

Comments
 (0)