Skip to content

Commit d55f7f2

Browse files
Cleanup (#9)
1 parent 6d043b6 commit d55f7f2

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

docs/guides/ldo_react.md renamed to docs/guides/building_your_first_solid_app_with_ldo_and_react.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# **Guide to Building Your First Solid App with LDO & React**
1+
# Building Your First Solid App with LDO & React
22

33
Welcome to Solid! The ecosystem has dozens of excellent tools to help you build your first application. This guide provides a clear, step-by-step path using one popular and powerful combination: **React** for the user interface and **Linked Data Objects (LDO)** to handle data.
44

5-
## **What is Solid?**
5+
## What is Solid?
66

77
The Solid ecosystem is built on a simple but powerful idea: separating applications from the data they create. This gives users control over their own information. It consists of three main parts:
88

@@ -12,7 +12,7 @@ The Solid ecosystem is built on a simple but powerful idea: separating applicati
1212

1313
This model means you can use multiple apps to manage the same data, and you can switch apps without losing your information.
1414

15-
## **What is Linked Data and LDO?**
15+
## What is Linked Data and LDO?
1616

1717
To make sure different apps can understand the same data, Solid uses a standard called the **Resource Description Framework (RDF)**. RDF, often called "Linked Data," is a flexible way to describe things and the relationships between them.
1818

@@ -22,7 +22,7 @@ LDO uses **ShEx (Shape Expressions)** to define the "shape" of your data. Think
2222

2323
In this tutorial, we'll build a simple micro-blogging web app that allows you to write notes and upload photos to your Solid Pod.
2424

25-
## **1. Getting Your Solid Identity and Pod**
25+
## 1. Getting Your Solid Identity and Pod
2626

2727
Before you can build an app, you need a place to store your data. We'll get you set up with a free Solid Identity and Pod from solidcommunity.net.
2828

@@ -31,7 +31,7 @@ Before you can build an app, you need a place to store your data. We'll get you
3131

3232
That's it! You now have a Solid Identity to log in with and a Pod to store your data.
3333

34-
## **2. Setting Up Your React Project**
34+
## 2. Setting Up Your React Project
3535

3636
This guide assumes you are familiar with React. Let's initialize a new project using Vite, a modern and fast build tool. Since LDO works best with TypeScript, we'll use the TypeScript template.
3737

@@ -148,7 +148,7 @@ export const Post: FunctionComponent = () => {
148148

149149
Start your application by running npm run dev. You should see a basic, unstyled page with a header, a form, and a placeholder for a post.
150150

151-
## **3. Integrating LDO for Solid**
151+
## 3. Integrating LDO for Solid
152152

153153
With the basic structure in place, let's install LDO and connect our app to the Solid ecosystem.
154154

@@ -180,7 +180,7 @@ const App: FunctionComponent = () => {
180180
export default App;
181181
```
182182

183-
## **4. Implementing Login and Logout**
183+
## 4. Implementing Login and Logout
184184

185185
Now we can implement authentication. The useSolidAuth hook from LDO gives us everything we need to manage user sessions.
186186

@@ -252,7 +252,7 @@ export const Blog: FunctionComponent = () => {
252252

253253
Now, try logging in. You'll be redirected to solidcommunity.net, and after you approve the application, you'll be sent back to your app, now in a logged-in state.
254254

255-
## **5. Defining Data Shapes with ShEx**
255+
## 5. Defining Data Shapes with ShEx
256256

257257
Before we can read or write data, we need to tell LDO what our data looks like. We do this using **ShEx**. Let's set up our project for shapes.
258258

@@ -297,7 +297,7 @@ npm run build:ldo
297297
298298
This command reads your .shex files and generates corresponding code in the .ldo folder, which we'll use in the next step.
299299
300-
## **6. Fetching and Displaying Profile Data**
300+
## 6. Fetching and Displaying Profile Data
301301
302302
Let's make our header more personal by displaying the user's name instead of their WebID. We can do this by fetching their profile data from their Pod.
303303
@@ -346,7 +346,7 @@ export const Header: FunctionComponent = () => {
346346
};
347347
```
348348
349-
### **How useResource and useSubject Work Together**
349+
### How useResource and useSubject Work Together
350350
351351
This code introduces two fundamental LDO hooks that are important to understand:
352352
@@ -357,11 +357,11 @@ This separation is powerful. You can load multiple resources (e.g., a profile, a
357357
358358
Refresh your app, and you should now see your name in the header after logging in!
359359
360-
## **7. Creating and Storing Posts**
360+
## 7. Creating and Storing Posts
361361
362362
Now for the core of our app: creating and saving blog posts.
363363
364-
### **Defining the Post Shape**
364+
### Defining the Post Shape
365365
366366
First, we need a ShEx shape for our posts. Create a new file at **src/.shapes/post.shex** and add the following:
367367
@@ -399,7 +399,7 @@ Run the build command again to generate the typings for our new shape:
399399
npm run build:ldo
400400
```
401401
402-
### **Finding Where to Save Data**
402+
### Finding Where to Save Data
403403
404404
A common question in Solid is: "Where do I save my app's data?" The best practice is to create a dedicated folder for your app inside the user's Pod. We can find the root of their storage space using the sp:storage property from their profile.
405405
@@ -462,7 +462,7 @@ In this useEffect, we:
462462
463463
We also started logic to render posts. mainContainer.children() gets a list of all items in our app's folder. We then filter for just the containers (since each post will be in its own container) and map over them to render a Post component for each one.
464464
465-
### **Creating a New Post**
465+
### Creating a New Post
466466
467467
Now let's wire up the **src/MakePost.tsx** component to actually create data.
468468
@@ -549,7 +549,7 @@ This is the most complex step, so let's break it down:
549549
3. **Create Structured Data:** We define where our structured data will live (index.ttl). Then, createData(PostShapeShapeType, ...) gives us a special LDO object (post) that conforms to our PostShape. We can then set its properties (articleBody, uploadDate, image) like a normal object.
550550
4. **Commit Data:** commitData(post) takes our local changes and sends them to the Solid Pod, creating the index.ttl file with the correct RDF data.
551551
552-
## **8. Displaying the Post Content**
552+
## 8. Displaying the Post Content
553553
554554
Finally, let's update **src/Post.tsx** to fetch and display the data for each post.
555555
@@ -608,7 +608,7 @@ A key detail is how we handle images. Most data in a Pod is private. If we simpl
608608
609609
We've also added a delete button that simply deletes the entire container for the post.
610610
611-
## **9. Building and Deploying Your App**
611+
## 9. Building and Deploying Your App
612612
613613
Congratulations! You've built a fully functional, decentralized Solid application. To deploy it, you first need to create a production build.
614614

docs/guides/solid_next_ldo_demo.md renamed to docs/guides/solid_nextjs_ldo_demo_application.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Solid + Next.js + LDO: Demo Application Guide
1+
# Solid + Next.js + LDO: Demo Application
22

33
This is a tutorial on how to create a Solid Application using [Next.js](https://nextjs.org/), [LDO](https://ldo.js.org/latest/) and [ACP](https://solidproject.org/TR/acp).
44

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
## Guides
44

5-
- [Building your first Solid App with LDO & React](guides/ldo_react)
6-
- [Demo Application using Solid + Next.js + LDO](guides/solid_next_ldo_demo.md)
5+
- [Building your first Solid App with LDO & React](guides/building_your_first_solid_app_with_ldo_and_react)
6+
- [Demo Application using Solid + Next.js + LDO](guides/solid_nextjs_ldo_demo_application)

0 commit comments

Comments
 (0)