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.
recommended for setting up zendro using docker
Execute this commands to install Zendro:
$ git clone https://github.com/Zendro-dev/zendro.git
$ cd zendro
$ npm install
$ npm link #sudo 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 the following command from within your project directory:
$ 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 from within your project directory 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> #for us the container id worked, the name did not
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:
-
- The default keycloak username is admin and the password is admin.
-
-
SPA:
-
- The default zendro username is zendro-admin and the password is admin.
-
-
GraphQL API:
-
GraphiQL interface with filter functionality:
-
- 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.





