Test environment for react web app.
Website is deployed at https://kat-kel.github.io/lostma-website-test/.
-
Check your version of
node
. (22 or >22)npm update -g npm
-
Check your version of
npm
. (10 or >10)nvm install node
-
Install the app's dependencies.
npm install
-
Run the app to test its development environment.
npx next dev
3 types of information need to be able to be updated easily and without knowledge of the website's JavaScript and/or internal React architecture.
Information | JSON Location |
---|---|
Team / Collaborators | public/data/people.json |
News | public/data/feed.json |
Data model | public/data/recordTypes.json |
Update the names of team members and collaborators directly in the JSON file.
{
"forename": "Philippe de",
"surname": "Vitry",
"role": "Troubadour"
}
The JSON file has 2 key-value pairs: Team
, Collaborators
. The value of each is an array of people that can be added in any order. The website's JavaScript orders the array alphabetically by surname. When a person's last name is preceded by a particle (i.e. 'de', 'van'), which should not be part of the alphabetisation, add it to the end of the forename field.
Update the news feed JSON file.
[
{
"classification": "Publication",
"date": "2022-10-26",
"title": "Lost Manuscripts and Extinct Texts : A Dynamic Model of Cultural Transmission",
"authors": ["Jean-Baptiste Camps", "Julien Randon-Furling"],
"body": "How did written works evolve....",
"link": "https://shs.hal.science/halshs-03827975"
}
]
The website's JavaScript orders the array alphabetically by date, so you can add them in any order you want.
The body of the post can contain HTML, but it's best to try sticking to simple text. Images are not currently supported.
A list of authors is optional. But when there is no author, provide an empty list, i.e. "authors": []
.
All posts will be given an icon indicating what kind of information they present. As the value of classification
, provide one of the following:
Publication
Presentation
Meeting
Conference
Other
Unlike the other information, do not update the data model by manually editing the JSON.
Re-run the heurist-api
CLI tool, developped for the LostMa project, which will freshly export the architecture of the database in a JSON format.
-
Install and set up the tool. (Follow instructions)
-
Run the
doc
subcommand.$ heurist --database DATABASE --login USERNAME --password PASSWORD doc --output-type json --outdir ./src/data/
If information JSON files have been updated:
-
Make sure you're working with the most up-to-date version of the web application's repository with
git pull
. -
Commit and push the updated JSON files to the repository.
-
If your terminal is not at the root of
./docs
, change to that directory. -
From
./docs
, runnpm run predeploy
to tell Node to generate new static files in the./build
folder. Don't manually edit anything in that folder; let Node do it via thepredeploy
script. -
Finally, run
npm run deploy
to commit and push the build's files to the remote repository'sgh-pages
branch. Again, don't manually mess with thegh-pages
branch. Let the project's scripts manage it. -
Check the deployment's success in the Actions tab / automated workflows page of the GitHub repository online. Locally,
npm run deploy
should have triggered a push that GitHub will show as apages build and deployment
action.
When it's done, the website should have the new information. Confirm at the depolyment's URL.