1
- # Fauna dotnet sample app
1
+ # Fauna .NET sample app
2
2
3
3
## Overview
4
4
5
5
This sample app shows how to use [ Fauna] ( https://fauna.com ) in a production application.
6
6
7
- The app uses dotnet and the [ Fauna v10 dotnet
7
+ The app uses .NET and the [ Fauna v10 .NET
8
8
driver] ( https://github.com/fauna/fauna-dotnet ) to create HTTP API endpoints for an
9
9
e-commerce store. You can use the app's API endpoints to manage products,
10
10
customers, and orders for the store.
@@ -67,7 +67,7 @@ To run the app, you'll need:
67
67
- A [ Fauna account] ( https://dashboard.fauna.com/register ) . You can sign up for a
68
68
free account at https://dashboard.fauna.com/register .
69
69
70
- - dotnet 6.0 or later.
70
+ - .NET 6.0 or later.
71
71
72
72
- The [ Fauna CLI] ( https://docs.fauna.com/fauna/current/tools/shell/ ) . To install
73
73
the CLI, run:
@@ -83,7 +83,7 @@ docs](https://docs.fauna.com/fauna/current/tools/shell/).
83
83
84
84
# # Setup
85
85
86
- 1. In your terminal, clone the repo and navigate to the ` js -sample-app`
86
+ 1. In your terminal, clone the repo and navigate to the ` dotnet -sample-app`
87
87
directory. For example:
88
88
89
89
` ` ` sh
@@ -96,7 +96,7 @@ docs](https://docs.fauna.com/fauna/current/tools/shell/).
96
96
[` .fauna-project` ](https://docs.fauna.com/fauna/current/tools/shell/# proj-config)
97
97
file that contains defaults for the Fauna CLI. The file indicates:
98
98
99
- - ` ECommerce ` is the default database for the project.
99
+ - ` EcommerceDotnet ` is the default database for the project.
100
100
101
101
- The project stores Fauna Schema Language (FSL) files in the
102
102
` schema` directory.
@@ -112,13 +112,13 @@ docs](https://docs.fauna.com/fauna/current/tools/shell/).
112
112
[Forgot Password](https://dashboard.fauna.com/forgot-password) workflow.
113
113
114
114
115
- 3. Use the Fauna CLI to create the ` ECommerce ` database:
115
+ 3. Use the Fauna CLI to create the ` EcommerceDotnet ` database:
116
116
117
117
` ` ` sh
118
- fauna create-database --environment=' ' ECommerce
118
+ fauna create-database --environment=' ' EcommerceDotnet
119
119
` ` `
120
120
121
- 4. Push the FSL files in the ` schema` directory to the ` ECommerce `
121
+ 4. Push the FSL files in the ` schema` directory to the ` EcommerceDotnet `
122
122
database:
123
123
124
124
` ` ` sh
@@ -129,10 +129,10 @@ docs](https://docs.fauna.com/fauna/current/tools/shell/).
129
129
and user-defined functions (UDFs) defined in the FSL files of the
130
130
` schema` directory.
131
131
132
- 5. Create a key with the ` server` role for the ` ECommerce ` database:
132
+ 5. Create a key with the ` server` role for the ` EcommerceDotnet ` database:
133
133
134
134
` ` ` sh
135
- fauna create-key --environment=' ' ECommerce server
135
+ fauna create-key --environment=' ' EcommerceDotnet server
136
136
` ` `
137
137
138
138
Copy the returned ` secret` . The app can use the key' s secret to authenticate
@@ -156,7 +156,7 @@ docs](https://docs.fauna.com/fauna/current/tools/shell/).
156
156
157
157
## Run the app
158
158
159
- The app runs an HTTP API server. From the root directory, run:
159
+ The app runs an HTTP API server. From the `sample-app` directory, run:
160
160
161
161
```sh
162
162
dotnet run
@@ -172,11 +172,11 @@ Once started, the local server is available at http://localhost:5049.
172
172
### Make API requests
173
173
174
174
You can use the endpoints to make API requests that read and write data from
175
- the `ECommerce ` database.
175
+ the `EcommerceDotnet ` database.
176
176
177
177
For example, with the local server running in a separate terminal tab, run the
178
178
following curl request to the `POST /products` endpoint. The request creates a
179
- `Product` collection document in the `ECommerce ` database.
179
+ `Product` collection document in the `EcommerceDotnet ` database.
180
180
181
181
```sh
182
182
curl -v \
@@ -191,8 +191,8 @@ curl -v \
191
191
}'
192
192
```
193
193
194
-
195
- ## Expand the app
194
+ <!-- TODO: Uncomment + update after sample data is done. -->
195
+ <!-- ## Expand the app
196
196
197
197
You can further expand the app by adding fields and endpoints.
198
198
@@ -227,7 +227,7 @@ Customer documents and related API responses:
227
227
228
228
Save ` schema/collections.fsl` .
229
229
230
- 3. Push the updated schema to the ` ECommerce ` database:
230
+ 3. Push the updated schema to the ` EcommerceDotnet ` database:
231
231
232
232
` ` ` sh
233
233
fauna schema push
0 commit comments