Skip to content

Commit 244638b

Browse files
committed
update getting started page for cloud
1 parent 58a20c3 commit 244638b

File tree

3 files changed

+75
-141
lines changed

3 files changed

+75
-141
lines changed

_includes/docs-sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ <h2 class="mt-2">RESTHeart Cloud <span class="text-small text-white">Coming soon
2222
</a>
2323
<ul id="cloud" class="collapse">
2424
<li><a href="/docs/cloud">Overview</a></li>
25-
<li><a href="/docs/cloud/root-user-setup">Root user setup</a></li>
2625
<li><a href="/docs/cloud/getting-started">Getting Started</a></li>
26+
<li><a href="/docs/cloud/root-user-setup">Root user setup</a></li>
2727
<li><a href="/docs/cloud/examples">Examples & Use Cases</a></li>
2828
<li><a href="/docs/cloud/user-management">User Management</a></li>
2929
<li><a href="/docs/cloud/security">Security</a></li>

_includes/root-user-config.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,12 @@ <h3 class="mb-3">🔧 Configuration</h3>
7777
</p>
7878
</div>
7979

80-
<div class="mt-3 d-flex justify-content-between align-items-center">
81-
<button @click="setLocalhostDefaults()" class="btn btn-primary me-2">
82-
🏠 Use Localhost
83-
</button>
80+
<div class="mt-3 d-flex justify-content-end align-items-center">
8481
<div class="d-flex align-items-center">
82+
<button @click="clearValues()" class="btn ms-2">Clear Values</button>
8583
<small class="text-light-emphasis ms-2"
8684
>Values are saved in your browser</small
8785
>
88-
<button @click="clearValues()" class="btn ms-2">Clear Values</button>
8986
</div>
9087
</div>
9188
</div>

docs/cloud/getting-started.adoc

Lines changed: 72 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -5,193 +5,130 @@ menu: cloud
55
liquid: true
66
---
77

8-
Welcome to RESTHeart Cloud's interactive documentation! Configure your connection details below to see personalized examples throughout the documentation.
9-
108
++++
119
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
1210
<script src="/js/interactive-docs-config.js"></script>
13-
{% include interactive-docs-config.html %}
1411
++++
1512

16-
== Getting Started
13+
Welcome to RESTHeart Cloud! This guide will walk you through setting up your first API and getting ready to use all the examples in our documentation.
1714

18-
Now that you've configured your connection details, you can follow along with the examples below. All code snippets will automatically use your configuration.
15+
== Step 1: Sign Up for RESTHeart Cloud
1916

20-
== Basic Operations
17+
First, create your free account and set up your API instance:
2118

19+
. *Visit https://cloud.restheart.com* and sign up for a free account
20+
. *Create a new API* by clicking "Create API"
21+
. *Choose the "Dev" tier* - it's completely free and perfect for getting started
22+
. *Note your API URL* - it will look something like `https://705560.eu-west-1-test-free-1.restheart.com`
2223

24+
TIP: Keep the RESTHeart Cloud dashboard open in another tab - you'll need to copy some values from it in the next step.
2325

24-
==== JavaScript
26+
== Step 2: Set Up Root User
2527

26-
[source,javascript]
27-
----
28-
fetch('[INSTANCE-URL]/mydb/mycollection', {
29-
method: 'POST',
30-
headers: {
31-
'Authorization': 'Basic [BASIC-AUTH]',
32-
'Content-Type': 'application/json'
33-
},
34-
body: JSON.stringify({
35-
name: 'John',
36-
age: 30
37-
})
38-
})
39-
.then(response => {
40-
if (response.ok) {
41-
console.log('Document created successfully');
42-
} else {
43-
console.error('Failed to create document:', response.status);
44-
}
45-
})
46-
.catch(error => console.error('Error:', error));
47-
----
28+
Before you can use your API, you need to create a root user with full privileges. This requires the Temporary Admin JWT from your cloud dashboard.
29+
30+
. *Get your Temporary Admin JWT* from the RESTHeart Cloud dashboard
31+
. *Follow the root user setup guide*: link:/docs/cloud/root-user-setup[Root User Setup]
32+
. *Create your root user* with username and password of your choice
33+
34+
WARNING: The Temporary Admin JWT is only valid for a short time and should only be used to create the root user.
35+
36+
== Step 3: Configure the Documentation Examples
4837

49-
=== Querying Documents
38+
Now you're ready to use all the interactive examples throughout our documentation! Configure the documentation to point to your API:
5039

51-
Query documents using the `filter={<query>}` query parameter. :
40+
. *Set your Instance URL* to your API URL (e.g., `https://705560.eu-west-1-test-free-1.restheart.com`)
41+
. *Set your Username* to the root user you created
42+
. *Set your Password* to the root user password you created
43+
44+
++++
45+
{% include interactive-docs-config.html %}
46+
++++
47+
48+
== Step 4: Test Your Setup
49+
50+
Let's verify everything is working by creating your first collection:
5251

5352
==== cURL
5453

5554
[source,bash]
5655
----
57-
curl -X GET "[INSTANCE-URL]/mydb/mycollection?filter={'age':{\$gt:25}}" \
56+
curl -X PUT "[INSTANCE-URL]/test-collection" \
5857
-H "Authorization: Basic [BASIC-AUTH]"
5958
----
6059

6160
==== HTTPie
6261

6362
[source,bash]
6463
----
65-
http GET "[INSTANCE-URL]/mydb/mycollection" \
66-
Authorization:"Basic [BASIC-AUTH]" \
67-
filter=="{'age':{\$gt:25}}"
64+
http PUT "[INSTANCE-URL]/test-collection" \
65+
Authorization:"Basic [BASIC-AUTH]"
6866
----
6967

7068
==== JavaScript
7169

7270
[source,javascript]
7371
----
74-
const filter = encodeURIComponent("{'age':{\$gt:25}}");
75-
fetch(`[INSTANCE-URL]/mydb/mycollection?filter=${filter}`, {
72+
fetch('[INSTANCE-URL]/test-collection', {
73+
method: 'PUT',
7674
headers: {
7775
'Authorization': 'Basic [BASIC-AUTH]'
7876
}
7977
})
80-
.then(response => response.json())
81-
.then(data => {
82-
console.log('Query results:', data);
78+
.then(response => {
79+
if (response.ok) {
80+
console.log('Collection created successfully!');
81+
} else {
82+
console.error('Failed to create collection:', response.status);
83+
}
8384
})
8485
.catch(error => console.error('Error:', error));
8586
----
8687

87-
== Advanced Operations
88+
If this returns a success response, congratulations! Your RESTHeart Cloud API is ready to use.
8889

89-
=== Bulk Operations
90+
== What's Next?
9091

91-
Perform bulk insert POSTing an array of documents.
92+
Now that your API is set up and configured, you can:
9293

93-
==== cURL
94+
* *Explore Examples*: Check out link:/docs/cloud/examples[RESTHeart Cloud Examples] for real-world use cases
95+
* *Learn the Basics*: Start with link:/docs/mongodb-rest/tutorial[MongoDB REST Tutorial]
96+
* *Secure Your API*: Set up proper link:/docs/cloud/user-management[User Management] and link:/docs/cloud/security[Security]
97+
* *Go Advanced*: Try link:/docs/mongodb-rest/aggregations[Aggregations], link:/docs/mongodb-websocket/examples[WebSockets], or link:/docs/mongodb-graphql/getting-started[GraphQL]
9498

95-
[source,bash]
96-
----
97-
curl -X POST [INSTANCE-URL]/mydb/mycollection \
98-
-H "Authorization: Basic [BASIC-AUTH]" \
99-
-H "Content-Type: application/json" \
100-
-d '[
101-
{"name": "Alice", "age": 25},
102-
{"name": "Bob", "age": 35},
103-
{"name": "Charlie", "age": 28}
104-
]'
105-
----
99+
== Configuration Persistence
106100

107-
==== HTTPie
101+
Your configuration settings (Instance URL, Username, Password) are saved in your browser and will persist across documentation pages. This means you can browse through all our interactive examples and they'll automatically use your RESTHeart Cloud API.
108102

109-
[source,bash]
110-
----
111-
echo '[
112-
{"name": "Alice", "age": 25},
113-
{"name": "Bob", "age": 35},
114-
{"name": "Charlie", "age": 28}
115-
]' | http POST [INSTANCE-URL]/mydb/mycollection \
116-
Authorization:"Basic [BASIC-AUTH]" \
117-
Content-Type:application/json
118-
----
103+
== Troubleshooting
119104

120-
==== JavaScript
105+
*Authentication Issues*
121106

122-
[source,javascript]
123-
----
124-
const documents = [
125-
{name: 'Alice', age: 25},
126-
{name: 'Bob', age: 35},
127-
{name: 'Charlie', age: 28}
128-
];
129-
130-
fetch('[INSTANCE-URL]/mydb/mycollection', {
131-
method: 'POST',
132-
headers: {
133-
'Authorization': 'Basic [BASIC-AUTH]',
134-
'Content-Type': 'application/json'
135-
},
136-
body: JSON.stringify(documents)
137-
})
138-
.then(response => {
139-
if (response.ok) {
140-
console.log('Bulk documents created successfully');
141-
} else {
142-
console.error('Failed to create bulk documents:', response.status);
143-
}
144-
})
145-
.catch(error => console.error('Error:', error));
146-
----
107+
- Make sure you completed the root user setup
108+
- Verify your username and password are correct
109+
- Check that your Instance URL doesn't have a trailing slash
147110

148-
=== Aggregation Pipeline
111+
*Connection Issues*
149112

150-
==== cURL
113+
- Confirm your API URL is correct (check the RESTHeart Cloud dashboard)
114+
- Ensure your API instance is running (check the dashboard status)
151115

152-
[source,bash]
153-
----
154-
curl -X POST [INSTANCE-URL]/mydb/mycollection/_aggrs/pipeline \
155-
-H "Authorization: Basic [BASIC-AUTH]" \
156-
-H "Content-Type: application/json" \
157-
-d '[
158-
{"$group": {"_id": null, "avgAge": {"$avg": "$age"}}},
159-
{"$project": {"_id": 0, "averageAge": "$avgAge"}}
160-
]'
161-
----
116+
*Need Help?*
162117

163-
==== HTTPie
118+
- Join our community on Slack
119+
- Check the link:/docs/faq[FAQ] for common questions
120+
- Contact support through the RESTHeart Cloud dashboard
164121

165-
[source,bash]
166-
----
167-
echo '[
168-
{"$group": {"_id": null, "avgAge": {"$avg": "$age"}}},
169-
{"$project": {"_id": 0, "averageAge": "$avgAge"}}
170-
]' | http POST [INSTANCE-URL]/mydb/mycollection/_aggrs/pipeline \
171-
Authorization:"Basic [BASIC-AUTH]" \
172-
Content-Type:application/json
173-
----
122+
== Free Tier Limits
174123

175-
==== JavaScript
124+
The Dev tier includes:
176125

177-
[source,javascript]
178-
----
179-
const pipeline = [
180-
{$group: {_id: null, avgAge: {$avg: '$age'}}},
181-
{$project: {_id: 0, averageAge: '$avgAge'}}
182-
];
126+
- *120 Requests/Minute Limit*
127+
- *100 Mb storage*
128+
- *Community support*
183129

184-
fetch('[INSTANCE-URL]/mydb/mycollection/_aggrs/pipeline', {
185-
method: 'POST',
186-
headers: {
187-
'Authorization': 'Basic [BASIC-AUTH]',
188-
'Content-Type': 'application/json'
189-
},
190-
body: JSON.stringify(pipeline)
191-
})
192-
.then(response => response.json())
193-
.then(data => {
194-
console.log('Aggregation results:', data);
195-
})
196-
.catch(error => console.error('Error:', error));
197-
----
130+
Perfect for development, testing, and small projects. You can upgrade anytime as your needs grow.
131+
132+
---
133+
134+
Ready to build amazing APIs? Let's dive into the examples! 🚀

0 commit comments

Comments
 (0)