New greener region discount. Save 3% on Upsun resource usage. Learn how.
LoginFree trial
FeaturesPricingBlogAbout us

Upsunify: improving onboarding with `upsun project:init`

24 January 2024
Antonis Kalipetis
Antonis Kalipetis
Cloud Engineer, Special Projects

Embarking on a new project should be an exciting journey, not a labyrinth of configuration struggles. At Upsun, we understand the value of a smooth onboarding process and a great developer experience, and that's why we introduced the upsun project:init command, or Upsunify. To strengthen our mission to empower developers by eliminating the headaches of project setup and allowing them to focus on what they do best as quickly as possible: crafting great applications.

Detecting your stack

Upsunify is not just another command; it's your intelligent onboarding companion. Using a combination of sophisticated heuristics and pattern recognition, the command swiftly identifies your project stack—whether it's Django, Express.js, Strapi, Flask, Laravel, or another popular framework. No more tedious manual configuration, Upsunify automagically tailors the setup for your specific tech stack, putting you on the express lane to deployment. All you have to do is commit and push your code to Upsun and we’ll handle the rest.

Configuring a Django project

Let's dive into the magic with a Python Django example, with a PostgreSQL database and a Redis cache. Run upsun project:init in your project directory, and watch the enchantment unfold:    

➜ django4 git:(main) ✗ upsun project:init
  Welcome to Upsun!
  Let's get started with a few questions.
  We need to know a bit more about your project. This will only take a minute!
  ✓ Detected stack: Django
  ✓ Detected runtime: Python
  ✓ Detected dependency managers: Poetry
  Select all the services you are using:
  Use arrows to move, space to select, type to filter
    [ ]  MariaDB
    [ ]  MySQL
    [x]  PostgreSQL
    [ ]  Redis
    [x]  Redis Persistent
    [ ]  Memcached
    [ ]  OpenSearch

That’s it, all you have to do is select the services you’d like to use—in our case a persistent Redis cache and a PostgreSQL database—and you’re ready to go.

Below you can find a few Django-related snippets in the configuration:

# .upsun/config.yaml Django-specific sections

# Gunicorn is automatically configured
            start: "poetry run gunicorn  -b unix:$SOCKET myapp.wsgi --log-file -"
# Poetry is installed (as it was detected) and static files are built
          build: |
            set -eux

            # Set PIP_USER to 0 so that Poetry does not complain
            export PIP_USER=0

            # Install poetry as a global tool
            python -m venv /app/.global
            pip install poetry==$POETRY_VERSION
            poetry install

            # Collect static files so that they can be served by Upsun
            poetry run python collectstatic --noinput

# Migrations are run on deployment
          deploy: |
            set -eux
            poetry run python migrate

# Static files are served with caching by Upsun
              passthru: true
              allow: true
              expires: "1h"
              root: "static"

Within moments, Upsunify analyzes your project structure, identifies the dependencies, and generates the perfect configuration files. It's like having a wizard in your terminal enabling you to wave goodbye to tedious setup and embrace onboarding simplicity.

Try Upsunify for yourself

Getting started with Upsunify is a breeze, simply follow these steps to install the CLI and kickstart your project.

Upsunify will guide you through the process, ensuring a hassle-free setup tailored to your project's unique requirements. We’re always looking for ways to improve Upsunify and the CLI itself, so if you’d like us to include your favorite stack, have suggestions for improvements or corrections, or just want to see how everything works, you can check out the open-source GitHub repositories for our CLI and the library itself below:

In the dynamic world of development, where time is of the essence, Upsunify emerges as your trusted ally. Say goodbye to configuration headaches and embrace a new era of onboarding simplicity with upsun project:init. Elevating your development experience, one command at a time. Register for Upsun today and get started with your first project.

Upsun Logo
Join the community