> For the complete documentation index, see [llms.txt](https://icure.gitbook.io/icure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://icure.gitbook.io/icure/icure-data-stack/what-is-icure/get-started-with-a-database-1.md).

# Get Started with a Database

iCure Data Stack helps developers create connected apps for healthcare in no time. Let's give it a quick try by creating a node application that lets you store and access encrypted patients in a cloud data store.

First head to [Register on our cloud platform](/icure/icure-data-stack/what-is-icure/install-icure.md) and create a database and a user. You will need the username and password below.

[Node 15](https://nodejs.org/en/blog/release/v15.0.0/) and [Yarn](https://classic.yarnpkg.com/en/docs/install) are needed for this example.

```bash
mkdir patient-manager
cd patient-manager
yarn init -y
yarn add @icure/api

#if you are using node two other dependencies are needed
yarn add node-fetch node-localstorage
```

{% hint style="info" %}
The `@icure/api`is the JS library used to simplify access to the iCure application server and to abstract the complexity of the cryptographic layer.

Node 15 is required because it includes the crypto compatibility layer
{% endhint %}

Now create a file name index.mjs

{% code title="How to use" %}

```javascript
import {Api, hex2ua, Patient} from '@icure/api'
import {crypto} from '@icure/api/node-compat.js'

const host = 'https://kraken.icure.dev/rest/v1';
const {
	patientApi,
	userApi,
	healthcarePartyApi,
	cryptoApi
} = Api(host, 'esmith', 'mypassword', crypto)

const loggedUser = await userApi.getCurrentUser();
const loggedHcp = await healthcarePartyApi.getCurrentHealthcareParty()

await cryptoApi.loadKeyPairsAsTextInBrowserLocalStorage(
	loggedUser.healthcarePartyId,
	hex2ua("308204bc02...473a613059")
)

const patient = await patientApi.createPatientWithUser(loggedUser,
	await patientApi.newInstance(
		loggedUser,
		new Patient({
			firstName: 'Gustave',
			lastName: 'Eiffel',
			profession: 'Architect & Engineer',
			dateOfBirth: 19731012,
			note: 'A very private information'
		}))
)
const fetchedPatient = await patientApi.getPatientWithUser(loggedUser, patient.id)
console.log(JSON.stringify(fetchedPatient, null, ' '))
```

{% endcode %}

{% hint style="info" %}
Replace `'demo'` / `'demo'` by your username and password. If you are writing code for the browser, omit to import`crypto` and call`Api`with just 3 arguments.
{% endhint %}

```bash
$ node index.mjs
```

##


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://icure.gitbook.io/icure/icure-data-stack/what-is-icure/get-started-with-a-database-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
