Skip to content

React JS prototype for LostMa project's static site (to be hosted on GitHub Pages)

License

Notifications You must be signed in to change notification settings

kat-kel/lostma-website-test

Repository files navigation

Test

Test environment for react web app.

Deployment

Website is deployed at https://kat-kel.github.io/lostma-website-test/.

Testing Environment

  1. Check your version of node. (22 or >22)

    npm update -g npm
  2. Check your version of npm. (10 or >10)

    nvm install node
  3. Install the app's dependencies.

    npm install
  4. Run the app to test its development environment.

    npx next dev

Updating Information

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

People

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.

News

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

Data model

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.

  1. Install and set up the tool. (Follow instructions)

  2. Run the doc subcommand.

    $ heurist --database DATABASE --login USERNAME --password PASSWORD doc --output-type json --outdir ./src/data/

Updating Deployment

If information JSON files have been updated:

  1. Make sure you're working with the most up-to-date version of the web application's repository with git pull.

  2. Commit and push the updated JSON files to the repository.

  3. If your terminal is not at the root of ./docs, change to that directory.

  4. From ./docs, run npm 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 the predeploy script.

  5. Finally, run npm run deploy to commit and push the build's files to the remote repository's gh-pages branch. Again, don't manually mess with the gh-pages branch. Let the project's scripts manage it.

  6. 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 a pages build and deployment action.

When it's done, the website should have the new information. Confirm at the depolyment's URL.

About

React JS prototype for LostMa project's static site (to be hosted on GitHub Pages)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published