Creating Zango project
Creating a project with Zango is a straightforward process. After you have completed the pre-requisites, follow below steps to create your project's root folder, initialize the project, and configure the necessary settings:
1. Choose a Directory:
Navigate to the directory where you want to create your project's root folder. You can use your preferred file explorer or the command line to create and navigate to this directory.
2. Install Zango and Start a New Project:
After installing Zango, you can use the zango start-project command, provided by zango CLI to initiate the creation of a new project. Replace "MyFirstProject" with your preferred project name.
zango start-project "MyFirstProject"
3. Provide Database Credentials:
During the project setup, you'll be prompted to provide your PostgreSQL database credentials. These credentials include:
Database Name
Database Username
Database Password
Database Host
Database Port (default is usually 5432)
If the provided credentials are incorrect or if there are issues with the database connection, the setup process will throw errors and cancel the project creation. This is because Zango will create schemas and perform migrations during the project's creation.
4. Migrate Schemas and Create Public Tenant:
Upon successful database connection, the setup process will automatically migrate schemas and create a public tenant. This ensures that your project is ready to go with the necessary database structure.
5. Configure Default Platform User:
Next, you'll be asked to provide details for the default platform user. This user serves as the first administrator and will have access to App Panel, where you can begin creating apps. You'll need to provide the following information:
Platform User Email Address
Password
Password Confirmation
Once you've entered these details, the setup process will create the default platform user for your project.
6. Project Folder Structure and Boilerplate Code:
With all the necessary configurations in place, the setup process will proceed to create your project's folder structure and populate it with boilerplate code. You're now ready to start developing your healthcare apps within the Zango platform.
Project Structure
project_name/ # Project root directory
├── manage.py # Django command-line utility for administrative tasks
└── project_name/ # Django project package
├── __init__.py
├── asgi.py # ASGI config for the project
├── settings.py # Project settings (database, static files, etc.)
├── urls_public.py # Public URL patterns
├── urls_tenant.py # Tenant-specific URL pattern
├── urls.py # Project-level URL patterns
└── wsgi.py # WSGI config for the project
Follow this guide, and you'll be well on your way to creating powerful and efficient healthcare applications using Zango.
Starting the celery worker and celery beat
Perform the below steps from the root directory of the project
celery -A <project_name> worker -l INFO
Starting Celery beat
celery -A <project_name> beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
Running the development server
Now that you've created up your project using Zango, the next step is to start the development server. This server allows you to access App Panel, where you can begin creating your healthcare apps. Follow these steps to run the development server:
1. Navigate to Your Project Folder:
Open your terminal or command prompt and navigate to the directory where you created your project's root folder. You can use the cd (change directory) command to move to the project directory. For example:
cd path/to/your/project
Replace path/to/your/project with the actual path to your project folder.
2. Start the Development Server:
Once you're inside the project folder, you can start the development server using the following command:
python manage.py runserver
Before running the runserver command, make sure your redis and celery worker are up and running
This command will start the development server, and you'll see output indicating that the server is running. By default, the server will be available at http://localhost:8000/.
Access your project's app panel
In Zango, App is like an individual django project which is isolated at both code level and database level but exists under one main zango project. Multiple apps can be created and deployed under same zango project saving upto 70% infrastructure cost and efforts of managing multiple projects.
Each app has an app panel (or dashboard) which is used to configure different app level settings like users, user roles, permissions, packages, logs etc
To access the app panel go to http://localhost:8000/platform
, and enter the platform username and password that you entered while creating the project.
You're all set to develop your start developing your applications on Zango 🎉. Now, lets move to the next step and launch our first Zango app.