|
| 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 | + |
0 commit comments