Skip to content

Commit d4ef326

Browse files
author
jb5513
authored
Add files via upload
1 parent db85a76 commit d4ef326

11 files changed

Lines changed: 11493 additions & 0 deletions

frontend/.eslintrc.cjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}

frontend/.refactoring

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
src
2+
- App.tsx
3+
- main.tsx
4+
- vite-env.d.ts
5+
- App.scss
6+
7+
./scss/FileValidator.scss

frontend/README.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Open Geodata Model Validator
2+
This is a simple website which validates if an excel/geodata-file is valid according to the Open Geodata Model.
3+
4+
In case you're more interested in the Open Geodata Model specification you'll find it [here](https://github.com/openkfw/open-geodata-model)
5+
6+
The Validator - Tool itself can be accessed [here](https://mapme-initiative.github.io/ogm-validator/)
7+
8+
### This project is built with [Vite](https://vitejs.dev/) and React using TypeScript. Below are instructions to run and manage the project locally.
9+
10+
---
11+
12+
### Prerequisites
13+
14+
* **Node.js** (version 14 or higher)
15+
* **npm** (version 6 or higher) or **yarn**
16+
17+
Ensure you have Node.js and npm installed:
18+
19+
```bash
20+
node -v
21+
npm -v
22+
```
23+
24+
---
25+
26+
### Getting Started
27+
28+
1. **Clone the repository**
29+
30+
```bash
31+
git clone https://github.com/mapme-initiative/ogm-validator;
32+
cd ogm-validator;
33+
```
34+
35+
36+
37+
2. **Install dependencies**
38+
39+
```bash
40+
npm install
41+
# or using yarn
42+
yarn install
43+
````
44+
45+
---
46+
47+
### Running Locally
48+
49+
To start the development server and begin working on the project:
50+
51+
```bash
52+
npm run dev
53+
```
54+
55+
This will:
56+
57+
* Launch Vite in development mode.
58+
* Enable hot module replacement (HMR).
59+
* Serve the app on `http://localhost:5173/` by default.
60+
61+
You should see output similar to:
62+
63+
```
64+
vite vX.X.X dev server running at:
65+
> Local: http://localhost:5173/
66+
> Network: use --host to expose
67+
```
68+
69+
Open your browser and navigate to `http://localhost:5173/` to view the app.
70+
71+
---
72+
73+
### Linting
74+
75+
To ensure code quality and consistency, run:
76+
77+
```bash
78+
npm run lint
79+
```
80+
81+
This will use ESLint to analyze all `.ts` and `.tsx` files and enforce rules, reporting any unused disable directives and failing if there are any warnings or errors.
82+
83+
---
84+
85+
### Configuration
86+
87+
* **Vite config:** `vite.config.ts` contains project-specific Vite configurations (e.g., path aliases, plugins).
88+
* **TypeScript config:** `tsconfig.json` sets up TypeScript compilation options.
89+
* **ESLint config:** `.eslintrc.*` contains linting rules and settings.
90+
91+
---
92+
93+
### Troubleshooting
94+
95+
* If you encounter port conflicts, you can specify a different port:
96+
97+
```bash
98+
vite --port 3000 --mode development
99+
```
100+
101+
* Clear Vite cache:
102+
103+
```bash
104+
rm -rf node_modules/.vite
105+
```
106+
107+
* For detailed error stacks, enable debug logging:
108+
109+
```bash
110+
DEBUG=vite:* npm run dev
111+
```
112+
113+
---
114+
115+
### Contributing
116+
117+
Feel free to open issues or submit pull requests. Please follow the existing coding conventions and ensure all lint checks pass.
118+
119+
---
120+
121+

frontend/babel.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', {targets: {node: 'current'}}],
4+
'@babel/preset-typescript',
5+
],
6+
};

frontend/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>OGM VALIDATOR</title>
9+
</head>
10+
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="/src/main.tsx"></script>
14+
</body>
15+
16+
</html>

0 commit comments

Comments
 (0)