This template helps you to get started with creating a Solid Web app.
- Community Solid Server (CSS) to test with pods locally.
- Comunica for querying pods and other data sources.
- Solid Authentication library for authenticating with an identity provider. You find the browser-specific documentation here.
- webpack to bundle the React application.
- Cypress to test our app.
- Clone this repository via
git clone https://github.com/SolidLabResearch/solid-web-app-react-template.git
- Install the dependencies via
npm i
- Prepare the pods via
npm run prepare:pods
- Start Solid server with the pods via
The server is ready when the following message appears in the terminal
npm run start:pods
Keep this process running.Listening to server at http://localhost:3000/
- In another terminal serve the app using webpack via
The app is ready when the following message appears in the terminal
npm start
webpack 5.88.1 compiled successfully
- Browse to http://localhost:8080 to use the app.
- Click the button "Show book wish list (public)" to view a public list of books on the pod at http://localhost:3000/example/wish-list.
- Log in with the WebID http://localhost:3000/example/profile/card#me.
The email and password of the account are defined in
seeded-pod-config.json
. This file is used also in step 3 to prepare the pods. - Click the button "Show book wish list (private)" to view a private list of books on the pod at http://localhost:3000/example/favourite-books.
If at some point you want to reset the pod data, you do
npm run reset:pods
You find the initial pod data in the folder initial-pod-data
.
It has two resources:
favourite-books
: this list contains the favourite books of the user. This list is private. only the user has read, write, and control access. This is specified infavourite-books.acl
.wish-list
: this list contains the wish list of book of the user. This list is public: everybody can read the list, but only the user can write and control it. This is specified inwish-list.acl
.
You find the shape to which the above two resources adhere in shapes/book-list.ttl
.
You can add more accounts by updating the file seeded-pod-config.json
.
You find more information about this file
here
We use Cypress for our tests. Execute the following steps to run the tests.
- Start Solid server with the pods via
The server is ready when the following message appears in the terminal
npm run start:pods
Keep this process running.Listening to server at http://localhost:3000/
- In another terminal serve the app using webpack via
The app is ready when the following message appears in the terminal
npm start
webpack 5.88.1 compiled successfully
- In yet another terminal start Cypress via
npm test
- A new window opens.
- Click on "E2E Testing".
- Select the browser you want to test with.
- Click on "Start E2E Testing in [browser]".
- The selected browser opens.
- Click on "spec.cy.js" to select the tests.
- The tests are automatically executed.
You find all details of the tests in cypress/e2e/spec.cy.js
.
You find all documentation about Cypress here.
This code is copyrighted by Ghent University – imec and released under the MIT license.