Try our demo


Take Imagine's demo apps for a spin.

Play around with our and get a feel of our compiler's functionality by running a simple command in your terminal.

Our demo apps will be organized by the key frameworks we support. We currently have a demo app for Django, and as we release support for more frameworks, we will add demo apps for each below.

Django

Here's a simple step-by-step walk through of what you can do with our demo app:

  • Copy and paste the command below into your terminal to download our demo django-app on your machine.
npm install -g imagine && imagine demo django-app
  • Note: running the above command requires the npm package manager being installed on your computer. If you get the error npm: command not found when you run the command, you will need to install npm first.

  • You will now be able to see the created files for the demo app when you list the files in the current directory by running ls.

ls
Dockerfile demo docker-compose.yml mypi.ini nginx setup.cfg
Makefile django-app.im manage.py myservice pyproject.toml
  • You can install all the dependencies for the Django app by running make install in your terminal. This will install all project dependencies for Django, REST, GraphQL etc.

  • You can run your Django app by running make run in your terminal. This will open a web server at http://127.0.0.1:8000/demo/

  • You can also open the files that are a part of the Django demo-app in your code editor. In this demo, these are the files that are generated by Imagine's SmartCompiler from a single django-app.im Imagine config file:

.
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ Makefile
โ”œโ”€โ”€ Pipfile
โ”œโ”€โ”€ demo
โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”œโ”€โ”€ admin.py
โ”‚ย ย  โ”œโ”€โ”€ apps.py
โ”‚ย ย  โ”œโ”€โ”€ management
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ commands
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ initialize.py
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ dummymodel.py
โ”‚ย ย  โ”œโ”€โ”€ migrations
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ __init__.py
โ”‚ย ย  โ”œโ”€โ”€ models
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ album.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ custom_user_model.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ musician.py
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ song.py
โ”‚ย ย  โ”œโ”€โ”€ permissions.py
โ”‚ย ย  โ”œโ”€โ”€ serializers.py
โ”‚ย ย  โ”œโ”€โ”€ tests
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ albumApiFetchUpdateSerializer_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ albumApiFetchUpdate_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ albumApi_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ albumSerializer_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ factories.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ musicianApiFetchSerializer_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ musicianApiFetch_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ musicianApi_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ musicianSerializer_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ songApi_test.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ songSerializer_test.py
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ utils.py
โ”‚ย ย  โ”œโ”€โ”€ urls.py
โ”‚ย ย  โ””โ”€โ”€ views.py
โ”œโ”€โ”€ django-app.im
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ manage.py
โ”œโ”€โ”€ mypi.ini
โ”œโ”€โ”€ myservice
โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”œโ”€โ”€ asgi.py
โ”‚ย ย  โ”œโ”€โ”€ settings
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ __init__.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ base.py
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ development.py
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ production.py
โ”‚ย ย  โ”œโ”€โ”€ urls.py
โ”‚ย ย  โ””โ”€โ”€ wsgi.py
โ”œโ”€โ”€ nginx
โ”‚ย ย  โ”œโ”€โ”€ Dockerfile
โ”‚ย ย  โ””โ”€โ”€ nginx.conf
โ””โ”€โ”€ setup.cfg
  • You can now make changes to the django-app.im Imagine config file and use the Imagine SmartCompiler's compile command to generate code with your changes. (learn about the various domains we support and how you can write our simple config syntax for each domain)

As an example, lets open the file django-app.im and add a new field rating to one of the Data Models called Album.

Model Album {
id integer [primary key]
name string [maxlength 80]
release_date datetime []
num_stars integer [range 0 5]
rating integer [default 0]
}
}
  • You can now run imagine compile django-app.im to generate new Django code with this change.

  • This would update a number of files - demo/mutations/album.py, demo/tests/factories.py, demo/tests/musicianApi_test.py, demo/tests/albumApi_test.py, demo/types.py, demo/models/album.py. For example, if you now look at the file demo/models/album.py, you will see your newly added field rating.

class Album(models.Model) :
artist = models.ForeignKey('Musician', on_delete=models.CASCADE, related_name='records')
id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=80)
release_date = models.DateField()
num_stars = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(5)])
rating = models.IntegerField(default=0)
  • You can also check the test coverage for this app (including any updates you make) using the following command. All Imagine generated code has 100% test coverage for unit tests and end-to-end tests ๐Ÿ˜
imagine run coverage

Node

coming soon, with ๐Ÿงก


React

coming soon, with ๐Ÿ’›


React Native

coming soon with ๐Ÿ’œ