Quick Start #
Node.js #
Recommended API:
git clone https://github.com/nervatura/nervatura-examples.git
cd nervatura-examples/node
npm install
npm start
Open your browser to http://localhost:8080
You do not need a Nervatura backend server to use the
CLI and
CGO. Automatic server start can be turned off with NT_EXAMPLE_SERVICE_DISABLED=true
(see in the nervatura-examples/node/.env
file).
Python #
Recommended API:
-
Download the Python examples
git clone https://github.com/nervatura/nervatura-examples.git
cd nervatura-examples/python
pip install -r requirements.txt
python main.py
Open your browser to http://localhost:8000
-
Nervatura backend
-
Linux
sudo snap install nervatura
sudo systemctl stop snap.nervatura.nervatura.service
The CLI and CGO is ready to use. To use the gRPC and HTTP, start Nervatura service with the .env.example settings (
nervatura-examples/python
directory):/snap/nervatura/current/nervatura -tray -env $(pwd)/.env.example
-
Windows:
winget install --id Nervatura.Nervatura --source winget
- change the value of the
NT_EXAMPLE_SERVICE_PATH
(nervatura-examples/python/.env.example
file): “/snap/nervatura/current/nervatura” -> “C:/Program Files/Nervatura/nervatura.exe” - change the value of the
NT_EXAMPLE_SERVICE_LIB
(nervatura-examples/python/.env.example
file): “/snap/nervatura/current/nervatura.so” -> “C:/ProgramData/Nervatura/nervatura.dll”
Start the Nervatura backend server ( gRPC and HTTP examples) with the .env.example settings (
nervatura-examples/python
directory):& "C:\Program Files\Nervatura\nervatura.exe" -tray -env .env.example
- change the value of the
-
Docker (without CGO)
Change the value of the
NT_EXAMPLE_SERVICE_PATH
(nervatura-examples/python/.env.example
file): “/snap/nervatura/current/nervatura” -> “docker”Start the Nervatura backend server with the .env.example settings (
nervatura-examples/python
directory):docker run -i -t --rm --name nervatura --env-file .env.example -p 5000:5000 -p 9200:9200 -v $(pwd)/data:/data nervatura/nervatura:latest
Go #
Recommended API:
-
Download the Go examples
git clone https://github.com/nervatura/nervatura-examples.git
cd nervatura-examples/go
go mod vendor
go run ./main.go
Open your browser to http://localhost:7000
-
Nervatura backend (
nervatura-examples/go
directory)
-
Docker
docker run -i -t --rm --name nervatura --env-file .env.example -p 5000:5000 -p 9200:9200 -v $(pwd)/data:/data nervatura/nervatura:latest
-
Linux and Windows
Follow the instructions in the python example
PHP #
Recommended API:
-
Download and install the PHP examples (linux)
git clone https://github.com/nervatura/nervatura-examples.git
cd nervatura-examples/php
composer install
cd public
php -S localhost:8000
Open your browser to http://localhost:8000
-
gRPC install (linux, optional)
sudo pecl install grpc
sudo pecl install protobuf
php -d extension=grpc.so -d extension=protobuf.so -S localhost:8000
More details or Windows installation: Install gRPC for PHP
-
Nervatura backend (
nervatura-examples/php
directory)
-
Docker
docker run -i -t --rm --name nervatura --env-file .env.example -p 5000:5000 -p 9200:9200 -v $(pwd)/data:/data nervatura/nervatura:latest
-
Linux and Windows
Follow the instructions in the python example
Flutter and Dart #
Recommended API:
-
Download the Flutter/Dart examples
git clone https://github.com/nervatura/nervatura-examples.git
cd nervatura-examples/flutter
-
Nervatura backend
-
Linux
sudo snap install nervatura
sudo systemctl stop snap.nervatura.nervatura.service
The CLI and CGO is ready to use. To use the gRPC and HTTP, start Nervatura service with the .env.example settings (
nervatura-examples/flutter
directory):/snap/nervatura/current/nervatura -env $(pwd)/.env.example
-
Windows:
winget install --id Nervatura.Nervatura --source winget
- change the value of the
NT_EXAMPLE_SERVICE_PATH
(nervatura-examples/flutter/.env.example
file): “/snap/nervatura/current/nervatura” -> “C:/Program Files/Nervatura/nervatura.exe” - change the value of the
NT_EXAMPLE_SERVICE_LIB
(nervatura-examples/flutter/.env.example
file): “/snap/nervatura/current/nervatura.so” -> “C:/ProgramData/Nervatura/nervatura.dll”
Start the Nervatura backend server ( gRPC and HTTP examples) with the .env.example settings (
nervatura-examples/flutter
directory):& "C:\Program Files\Nervatura\nervatura.exe" -env .env.example
- change the value of the
-
Docker (without CGO)
Change the value of the
NT_EXAMPLE_SERVICE_PATH
(nervatura-examples/flutter/.env.example
file): “/snap/nervatura/current/nervatura” -> “docker”Start the Nervatura backend server with the .env.example settings (
nervatura-examples/flutter
directory):docker run -i -t --rm --name nervatura --env-file .env.example -p 5000:5000 -p 9200:9200 -v $(pwd)/data:/data nervatura/nervatura:latest
-
Dart backend
Install the dependencies and start the Dart backend server with the .env.example settings (
nervatura-examples/flutter
directory):dart pub get -C server
-
Run without CGO settings:
dart run server/lib/server.dart
-
Run with CGO (linux example):
NT_API_KEY=EXAMPLE_API_KEY NT_TOKEN_PUBLIC_KID=PUBLIC_KID NT_TOKEN_PUBLIC_KEY=data/public.key dart run server/lib/server.dart
- Flutter client
-
Install the all dependencies (
nervatura-examples/flutter/client
directory):flutter pub get
-
Windows or Linux desktop:
Run without CGO settings (linux example):
flutter run -d linux --dart-define-from-file=env-example.json
Run with CGO (linux example):
NT_API_KEY=EXAMPLE_API_KEY NT_TOKEN_PUBLIC_KID=PUBLIC_KID NT_TOKEN_PUBLIC_KEY="../data/public.key" NT_ALIAS_DEMO="sqlite://file:../data/demo.db?cache=shared&mode=rwc" flutter run -d linux --dart-define-from-file=env-example.json
-
Web or other platform:
flutter run -d chrome --dart-define-from-file=env-example.json
Examples #
Create a demo database #
Basic password login #
Custom token (passwordless) login #
Nervatura Client custom token login #
Using external API for token based authentication #
- HTTP, gRPC
- use of an external identification service provider (Facebook, GitHub, Google, Firebase and others)
Nervatura Client language translation #
- client_config.json file example
Create an invoice #
- HTTP, CLI, CGO , gRPC
- creating or updating a new or existing customer, customer address and contact data
- create a new invoice
- create and download a PDF invoice