This is a quickstart guide on how to create a new Zendro project with default parameters. It uses pre-defined datamodels, database and environment variables.
If you want to know more about Zendro or a detailed explanation on how to set up Zendro from scratch, check this.
- NodeJS version 14+ is required.
- docker
- docker-compose
Execute this commands to install Zendro:
$ git clone https://github.com/Zendro-dev/zendro.git
$ cd zendro
$ npm install
$ npm link
The easiest way to set up Zendro is using the Zendro CLI tool with minimal steps and configuration. Execute:
$ zendro set-up -d <name>
By default, three data models with associations will be used for this instance:
- city
- country
- river
Also a default SQLite database will be used. You can find the database on graphql-server folder.
Edit NEXTAUTH_SECRET to your expected secret word in the following files:
- SPA in development mode: ./single-page-app/.env.development
- SPA in production mode: ./single-page-app/.env.production
- GraphiQL in development mode: ./graphiql-auth/.env.development
- GraphiQL in production mode: ./graphiql-auth/.env.production
If you want to know more about the enviroment variables, you can check this.
To start Zendro in development mode run
$ zendro dockerize -u
This will start Zendro in development mode. All servers are listening to live changes you make in the files. Especially the SPA and graphiql-auth web-services will be slow to use since they compile pages on demand when opening them. To avoid that either change the docker-compose-dev.yml to compile and deploy the webservices (see docker-compose-prod.yml) or start Zendro in production mode.
In development mode there is no reverse proxy to map the docker-services. Instead this is done by exposing the ports.
Note: We recommend to use Linux system for development mode.
Execute this command to start Zendro in production mode.
$ zendro dockerize -u -p
This command will create docker containers for each Zendro component:
- Keycloak: manage users and roles
- Single Page App (SPA): graphical interface to send CRUD requests to a Zendro GraphQL endpoint
- API: CRUD API that can be accessed through a GraphQL query language
- GraphiQL interface: An implementation of the GraphQL IDE with Zendro login and advanced filter functionalities.
- traefik reverse-proxy: A reverse-proxy using traefik that maps the above docker services.
You can check docker containers by:
$ docker ps
You can check docker logs by:
$ docker logs -f <container name>
Please wait until logs indicate the app is running on XXXX port to access Zendro services.
In default config, the running containers will be:
-
Keycloak:
-
Development mode: http://localhost:8081/auth
-
Production mode: http://localhost/auth/
- The default keycloak username is admin and the password is admin.
-
-
SPA:
-
Development mode: http://localhost:8080/spa
-
Production mode: http://localhost/spa
- The default zendro username is zendro-admin and the password is admin.
-
-
GraphQL API:
- Development mode: http://localhost:3000/graphql
- Production mode: http://localhost/api/graphql
-
GraphiQL interface with filter functionality:
-
Development mode: http://localhost:7000/graphiql
-
Production mode: http://localhost/graphiql
- The default zendro username is zendro-admin and the password is admin.
-
Also, for the default database you can install sqlite3 with:
$ sudo apt install sqlite3
Then, go to graphql-server folder and run:
$ sqlite3 data.db
You can see tables and do querys inside sqlite by:
sqlite> .tables
sqlite> SELECT * FROM <table>;
sqlite> .exit
Execute this command to stop Zendro and remove all volumes.
# Production
$ zendro dockerize -d -p -v
# Development
$ zendro dockerize -d -v
Note: If you want to persist your data, that includes user data as well as other data, remove the -v flag from the above command.





