Create your project

This guide uses the dashboard to manage your project - an API and CLI are in progress.
1

Create your project

After creating your account, head to the Dashboard and create a new project using the button on the top right.

2

Note your project ID, database URL, and API key (keep this a secret!)

3

You can test everything is working by making a sample fetch request to your database:

Make sure to replace <YOUR_PROJECT_ID> and <YOUR_API_KEY>.

GET Project Details
fetch("https://api.basic.tech/project/<YOUR_PROJECT_ID>", {
  headers: {
      "Authorization": "Bearer <YOUR_API_KEY>",
  },
}).then(response => response.json())
.then(data => console.log(data));

Create your database

Databases on Basic are currently document collections, similar to MongoDB or Firebase. Support for SQL databases is coming soon!
1

Go the Schema tab, and create a new table.

2

You can now query all the documents in the table

GET database table
fetch("https://api.basic.tech/project/<YOUR_PROJECT_ID>/db/<ACCOUNT_ID>/<TABLE_NAME>", {
headers: {
"Authorization": "Bearer <YOUR_API_KEY>",
},
}).then(response => response.json())
.then(data => console.log(data));

Since we don’t have any documents created yet, this should return an empty array. For the account_id parameter, you can use “self”.

3

Add your first document

POST add item
fetch("https://api.basic.tech/project/<YOUR_PROJECT_ID>/db/<ACCOUNT_ID>/<TABLE_NAME>", {
method: "POST",
headers: {
"Authorization": "Bearer <YOUR_API_KEY>",
},
body: JSON.stringify({
"hello": "world"
})
}).then(response => response.json())
.then(data => console.log(data));

If we retry the query from step 2, you should now see your document!

4

Update the document

Let’s update the document now. We’ll provide a document ID, and some additional data we want to store. By default, this will merge the data, instead of replacing it.

POST update item
fetch("https://api.basic.tech/project/<YOUR_PROJECT_ID>/db/<ACCOUNT_ID>/<TABLE_NAME>", {
method: "POST",
headers: {
"Authorization": "Bearer <YOUR_API_KEY>",
},
body: JSON.stringify({
"sup": "universe"
})
}).then(response => response.json())
.then(data => console.log(data));

Next steps

You can now start building your app! Create tables, add items, and query to your hearts content.

In this limited preview, you are only able to store data for your own account. Support for adding additional users to your app coming soon.