|
1 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
| 1 | +This project uses the React library to present Intermagnet Metadata from the Geomagnetism Community Metadata Database, which is hosted at BGS in the UK. The project was originally created using the [Create React App](https://github.com/facebook/create-react-app). Create React App was deprecated in 2025 and project was migrated to the [Vite framework](https://vite.dev/). |
2 | 2 |
|
3 | | -## Available Scripts |
| 3 | +## Developing the project |
4 | 4 |
|
5 | | -In the project directory, you can run: |
| 5 | +The project has been successfully compiled on Ubuntu, but development should be possible on any Linux distribution that can run [Node](https://nodejs.org/en). To set up a development environment: |
6 | 6 |
|
7 | | -### `npm start` |
| 7 | +1. Install the Node Version Manager (nvm): https://github.com/nvm-sh/nvm |
| 8 | +1. Use nvm to install node V22: |
8 | 9 |
|
9 | | -Runs the app in the development mode.<br> |
10 | | -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
| 10 | +``` |
| 11 | + nvm install 22 |
| 12 | + nvm use 22 |
| 13 | +``` |
11 | 14 |
|
12 | | -The page will reload if you make edits.<br> |
13 | | -You will also see any lint errors in the console. |
| 15 | +To install the project dependencies: |
14 | 16 |
|
15 | | -### `npm test` |
| 17 | +``` |
| 18 | + # To do a clean install, remove transitory dependency files |
| 19 | + rm -rf node_modules package-lock.json |
| 20 | + # Install the dependencies |
| 21 | + npm install |
| 22 | +``` |
16 | 23 |
|
17 | | -Launches the test runner in the interactive watch mode.<br> |
18 | | -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 24 | +To run the project tests: |
19 | 25 |
|
20 | | -### `npm run build` |
| 26 | +``` |
| 27 | + npm run test |
| 28 | + npm run test:watch # run tests and then wait for changes to files |
| 29 | + npm run test:coverage |
| 30 | +``` |
21 | 31 |
|
22 | | -Builds the app for production to the `build` folder.<br> |
23 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
| 32 | +To run the project: |
24 | 33 |
|
25 | | -The build is minified and the filenames include the hashes.<br> |
26 | | -Your app is ready to be deployed! |
| 34 | +``` |
| 35 | + npm run dev |
| 36 | +``` |
27 | 37 |
|
28 | | -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| 38 | +This will run a development server in the background and launch a web browser window where you can interact with the project components. The page will reload if you make edits. You will also see any lint errors in the console (you can run the linter separately: ```npm run lint```). The console also has a simple command structure allowing you to interact with the server - to see the available commands type "h<ENTER>". |
29 | 39 |
|
30 | | -### `npm run eject` |
| 40 | +To preview the project: |
31 | 41 |
|
32 | | -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
| 42 | +``` |
| 43 | + npm run build |
| 44 | + npm run preview |
| 45 | +``` |
33 | 46 |
|
34 | | -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. |
| 47 | +This will build the project's static pages in the ./dist folder, then run a web server to view these static pages. This mirrors the action taken during deployment, so is a further check that the project is working correctly before commiting changes to GitHub. |
35 | 48 |
|
36 | | -Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. |
| 49 | +## Deploying the project |
37 | 50 |
|
38 | | -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. |
39 | | - |
40 | | -## Learn More |
41 | | - |
42 | | -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
43 | | - |
44 | | -To learn React, check out the [React documentation](https://reactjs.org/). |
45 | | - |
46 | | -### Code Splitting |
47 | | - |
48 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting |
49 | | - |
50 | | -### Analyzing the Bundle Size |
51 | | - |
52 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size |
53 | | - |
54 | | -### Making a Progressive Web App |
55 | | - |
56 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app |
57 | | - |
58 | | -### Advanced Configuration |
59 | | - |
60 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration |
61 | | - |
62 | | -### Deployment |
63 | | - |
64 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/deployment |
65 | | - |
66 | | -### `npm run build` fails to minify |
67 | | - |
68 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify |
| 51 | +A GitHub action (in .github/workflows/pages.yml) builds the Vite + React app and deploys the resulting static site to GitHub Pages. All pushes to the default branch on GitHub will trigger the deployment of the site (pushes to other branches will not cause a deployment to take place). |
0 commit comments