Skip to content

alirezatsh/Hansi

Repository files navigation

hansi

Have you ever struggled with setting up a new project?
Was it difficult to configure everything and create all the files manually?
Have you ever wished you could bootstrap your entire project with just a single command?

Now you can — with hansi.

hansi is a CLI tool for fast bootstrapping and structuring your projects.
It helps you quickly set up frameworks like Django, and soon also FastAPI and Node.js, while providing a clean, local-development-ready structure right out of the box.

Features

  • Fast and easy project initialization
  • Database options: SQLite or PostgreSQL
  • Optional setup with Dockerfile and Docker Compose
  • Automatically handles essentials:
    • Create and activate the venv
    • Runs migrations
    • Creates a superuser
    • Generates necessary files like .gitignore and .env
    • Creates a requirements.txt file with the most used packages

Requirements

At the moment, hansi only works on Linux systems.
Before installing hansi, make sure the following are installed on your machine:

Guides

For every project you create with hansi, a guide.txt file is automatically generated in the root directory.
Before doing anything else, you should read this file to get familiar with the setup process and understand how the project works.

Installation

You can install hansi globally using npm:

npm install -g hansi

Commands

hansi local django init

Initialize a Django project with default sqlite DB.

USAGE
  $ hansi local django init [--db sqlite|postgres] [--dockerfile] [--dockercompose]

FLAGS
  --db=<option>    [default: sqlite] Database type
                   <options: sqlite|postgres>
  --dockercompose  Create docker-compose.yml
  --dockerfile     Create Dockerfile

DESCRIPTION
  Initialize a Django project with optional DB, Docker, and docker-compose

hansi local django init --db sqlite --dockerfile

Initialize a Django project with sqlite DB and a running Dockerfile

USAGE
  $ hansi local django init --db sqlite --dockerfile

DESCRIPTION
  Creates a Django project with SQLite database.
  Generates and start a Dockerfile for containerized development.
  Migrations and superuser creation are done manually inside the container.

hansi local django init --db postgres

Initialize a Django project with postgres DB.

USAGE
  $ hansi local django init --db postgres

DESCRIPTION
  Creates a Django project configured for PostgreSQL.
  You need to update your .env file with correct DB credentials manually.

hansi local django init --db postgres --dockerfile

USAGE
  $ hansi local django init --db postgres --dockerfile

DESCRIPTION
  Creates a Django project with PostgreSQL database.
  Dockerfile is created but migrations and superuser creation are NOT run automatically.
  Update your .env with DB credentials and run:

hansi local django init --db postgres --dockercompose

USAGE
  $ hansi local django init --db postgres --dockercompose

DESCRIPTION
  Creates a Django project configured for PostgreSQL with docker-compose setup.
  Both web and db services are defined and running.
  Migrations and superuser are run automatically inside the containers.

About

This is a CLI tool to quickly initialize, configure, and structure your projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors