Skip to content

Commit

Permalink
feat: transferred dtm frontend to dronte tm
Browse files Browse the repository at this point in the history
  • Loading branch information
varun2948 committed Jun 26, 2024
1 parent d7d7248 commit bc20630
Show file tree
Hide file tree
Showing 200 changed files with 8,636 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SITE_NAME="DTM-Drone Tasking Manager"
BASE_URL=https://dronetm-api.naxa.com.np
API_URL_V1=https://dronetm-api.naxa.com.np
8 changes: 8 additions & 0 deletions src/frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
vite.config.ts
src/vite-env.d.ts
src/schemas/types/vite-env.d.ts
src/constants/Proxies.ts
tailwind.config.js
postcss.config.js
54 changes: 54 additions & 0 deletions src/frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'airbnb',
'plugin:react/recommended',
// 'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json'],

extraFileExtensions: ['.json'],
tsconfigRootDir: __dirname,
},
plugins: ['react-hooks', 'prettier'],
rules: {
'prettier/prettier': 'error',
'no-console': 'error',
'react/react-in-jsx-scope': 0,
'react/jsx-props-no-spreading': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/forbid-prop-types': 'off',
'react/prop-types': 'off',
'no-unsafe-optional-chaining': 'warn',
'import/no-import-module-exports': 'off',
'react/function-component-definition': 'off',
'react/jsx-filename-extension': 'off',
'import/prefer-default-export': 'warn',
'react/require-default-props': 'off',
'object-curly-newline': 'off',
'no-undef': 0,
'import/no-unresolved': 0,
'prefer-template': 1,
'react/jsx-no-useless-fragment': 0,
'import/extensions': 0,
'no-plusplus': 0,
'no-unused-vars': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'class-methods-use-this': 'warn',
'react/state-in-constructor': 0,
'react/destructuring-assignment': 0,
'no-param-reassign': 'warn',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/control-has-associated-label': 'off',
},
};
28 changes: 28 additions & 0 deletions src/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/*
.vite/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# **/__test__/
.env
todo.txt
3 changes: 3 additions & 0 deletions src/frontend/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,ts,tsx}": "eslint --fix"
}
1 change: 1 addition & 0 deletions src/frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.16.0
9 changes: 9 additions & 0 deletions src/frontend/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 80,
endOfLine: 'auto',
arrowParens: 'avoid',
plugins: ['prettier-plugin-tailwindcss'],
};
41 changes: 41 additions & 0 deletions src/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

## Getting started with the starter kit



1. Do not use npm to install packages, use yarn. If you want to run `npm install` then delete the `yarn.lock` file and install the packages using npm.

2. Create a .env file and copy .env.sample to .env

3. Run `yarn dev` to start the development server.

4. If there is error on "/dashboard" route then comment out the proxy setup part on `vite.config.ts` file.



## Folder Structure



- [API](./src/api/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Api's for the project

- [Wrappers](./src/api/wrappers/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Wrappers

- [Routes](./src/routes/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Routes

- [Utils](./src/utils/readme.md)

- [UI](./src/ui/readme.md)



## Example to add shadcn component (select component- [link](https://ui.shadcn.com/docs/components/select) )

npx shadcn-ui add select
give path as
**./src/ui/atoms/common/**

- resolve all classes with tailwind prefix
- replace classes with color variables with project color variables
- add missing dependencies ( if npx failed to install dependencies automatically e.g: @radix-ui/react-select )

16 changes: 16 additions & 0 deletions src/frontend/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/assets/css/tailwind.css",
"baseColor": "slate",
"cssVariables": true
},
"aliases": {
"components": "components/RadixComponents",
"utils": "@/lib/utils"
}
}
28 changes: 28 additions & 0 deletions src/frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0" /> -->
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"
/>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Symbols+Outlined"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Symbols+Outlined"
rel="stylesheet"
/>
<title>Drone Tasking Manager</title>
</head>

<body>
<div id="backdrop-root"></div>
<div id="overlay-root"></div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
103 changes: 103 additions & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"name": "starterkit-v2",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "vite",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint ./src/ --ext .ts,.tsx --fix"
},
"dependencies": {
"@mapbox/mapbox-gl-draw": "^1.4.2",
"@mapbox/mapbox-gl-draw-static-mode": "^1.0.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-popover": "^1.0.6",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.6",
"@reduxjs/toolkit": "^1.9.3",
"@tailwindcss/container-queries": "^0.1.1",
"@tanstack/react-query": "^4.32.6",
"@tanstack/react-query-devtools": "^4.32.6",
"@tanstack/react-table": "^8.9.3",
"@terraformer/wkt": "^2.2.0",
"@turf/area": "^7.0.0",
"@turf/centroid": "^7.0.0",
"@turf/flatten": "^7.0.0",
"@turf/length": "^7.0.0",
"@types/file-saver": "^2.0.5",
"@types/geojson": "^7946.0.10",
"@types/mapbox__mapbox-gl-draw": "^1.4.0",
"@types/papaparse": "^5.3.8",
"@types/react-transition-group": "^4.4.6",
"@types/terraformer__wkt": "^2.0.0",
"@types/turf": "^3.5.32",
"autoprefixer": "^10.4.14",
"axios": "^1.3.4",
"class-variance-authority": "^0.6.1",
"clsx": "^2.0.0",
"date-fns": "^2.30.0",
"dom-to-code": "^1.5.4",
"dotenv": "^16.0.3",
"geojson": "^0.5.0",
"geojson-validation": "^1.0.2",
"html2canvas": "^1.4.1",
"lucide-react": "^0.260.0",
"maplibre-gl": "^3.2.0",
"papaparse": "^5.4.1",
"react": "^18.2.0",
"react-day-picker": "^8.8.1",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.4",
"react-hook-form": "^7.52.0",
"react-redux": "^8.0.5",
"react-router-dom": "^6.10.0",
"react-toastify": "^9.1.3",
"react-transition-group": "^4.4.5",
"recharts": "^2.7.2",
"redux-persist": "^6.0.0",
"redux-saga": "^1.2.3",
"reselect": "^4.1.8",
"shpjs": "^5.0.1",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.6",
"uuid": "^9.0.0",
"wkt": "^0.1.1"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^4.29.4",
"@types/geojson-validation": "^1.0.3",
"@types/node": "^18.15.11",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/shpjs": "^3.4.7",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-react": "^3.1.0",
"eslint": "8.2.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"lint-staged": "^13.2.2",
"postcss": "^8.4.23",
"prettier": "^3.0.2",
"prettier-plugin-tailwindcss": "^0.5.3",
"tailwindcss": "^3.3.1",
"typescript": "^4.9.3",
"vite": "^4.2.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --cache --write"
]
}
}
7 changes: 7 additions & 0 deletions src/frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
plugins: {
'tailwindcss/nesting': {},
tailwindcss: {},
autoprefixer: {},
},
};
Binary file added src/frontend/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/frontend/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/frontend/public/favicon.ico
Binary file not shown.
Loading

0 comments on commit bc20630

Please sign in to comment.