# Tutorial

The tutorial in this section creates a Spring Boot personal (i.e., single-user) Web service on **`http://localhost:8080`** that uses Inrupt’s Java client library to:

* Read the Pod URLs associated with the user’s [WebID](https://docs.inrupt.com/reference/glossary#webid).
* Store and manage expense records in the user’s Pod. The expense records are stored as [Resource Description Framework (RDF) resource](https://docs.inrupt.com/reference/glossary#rdf-resource).

{% hint style="info" %}
The locally-run personal Web service uses the [Client Credentials](https://www.rfc-editor.org/rfc/rfc6749) flow; that is, the service logs in with its credentials on behalf of the user who registered the client.
{% endhint %}

For this part of the tutorial, an expense record (with date, description, provider, amount, currency, category information) is stored as a file in the Pod with the following structure and sample values (shown in Turtle):

```turtle
<https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense>
    <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> &#x3C;https://schema.org/Invoice> ;
    <https://schema.org/purchaseDate>  "2023-03-07T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
    <https://schema.org/provider>      "Example Restaurant" ;
    <https://schema.org/description>   "Team Lunch";
    <https://schema.org/category>      "Travel and Entertainment" ;
    <https://schema.org/priceCurrency> "USD" ;
    <https://schema.org/totalPrice>    "120"^^<http://www.w3.org/2001/XMLSchema#decimal> .
```

{% hint style="info" %}

* The **`subject`** and the **`predicates`** are URLs.
* The **`object`** may be URLs or literals.
  {% endhint %}

Attach a receipt to the expense:

* Store the receipt (as a non-RDF **`.png`** , **`.pdf`** , or **`.jpeg`** file) to the user’s Pod.
* Update the the Expense resource by adding a link to the saved receipt file.

```turtle
 <https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense>
     <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://schema.org/Invoice> ;
     <https://schema.org/purchaseDate>  "2023-03-07T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
     <https://schema.org/provider>      "Example Restaurant" ;
     <https://schema.org/description>   "Team Lunch";
     <https://schema.org/category>      "Travel and Entertainment" ;
     <https://schema.org/priceCurrency> "USD" ;
     <https://schema.org/totalPrice>    "120"^^<http://www.w3.org/2001/XMLSchema#decimal> ;
    <strong> <https://schema.org/image>     <https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense_somerandomsuffix.jpg> .
```
