Skip to content

muruthigitau/masafa

Repository files navigation

Blox CLI

Blox CLI is a command-line interface tool designed to streamline development tasks for projects using the Blox framework, which integrates seamlessly with Django and Next.js.

Installation

Prerequisites

Before installing Blox CLI, ensure you have the following installed on your system:

  • Python: Blox CLI requires Python 3.x. If you don't have Python installed, download and install it from python.org.
  • Pip: Pip is the package installer for Python. It should be installed automatically when you install Python.
  • Node.js: Blox CLI requires Node.js version 20. If you don't have Node.js installed, download and install it from nodejs.org.

Setup Environment

Clone the Repository

Clone your Blox project repository from GitHub:

git clone /~https://github.com/Softleek/blox.git [project_name]
cd [project_name]

Create a Virtual Environment

It's a good practice to use a virtual environment to isolate your project dependencies from other Python projects.

Using venv:

  • Windows:

    python -m venv env
  • Unix or MacOS:

    python3 -m venv env

Activate the virtual environment:

  • Windows:

    env\Scripts\activate
  • Unix or MacOS:

    source env/bin/activate

Install Blox CLI

Install Blox CLI in editable mode using pip. This allows you to make changes to the code and have them immediately available without reinstallation:

pip install -e .

Setup Your Project

After installing Blox CLI, setup your project dependencies and configurations.

Install Site & Dependencies

blox newsite

Apply Migrations

Apply database migrations if needed:

blox migrate

Start Development Server

To start the development server:

blox start dev

The server will start and typically be accessible at http://localhost:3000.

Usage

Blox CLI commands start with blox. Here are the available commands:

Setup and update Site environment

blox install

Command: blox migrate

Migrate database schema changes.

blox migrate

Command: blox start

Start the development server.

blox start dev

Command: blox install

Install dependencies or packages.

blox install

Install node dependencies.

blox npm install dep1 dep2

Install node dependencies for a custom app.

blox npm install --app appname dep1 dep2

or

blox npm i dep1 dep2
blox npm i --app appname dep1 dep2

Install python packages.

blox pip install package1 package1

Install python packages for a custom app..

blox pip install --app appname  package1 package1

or

blox pip i package1 package1
blox pip i --app appname  package1 package1

Command: blox startapp

Create and start a new application.

blox newapp [appname]

Example:

blox installapp myapp

Command: blox deleteapp

Delete an application.

blox unistallapp [appname]

Example:

blox uninstallapp myapp

Command: blox addmodule

Create and start a new module.

blox newmodule [appname] [modulename]

Example:

blox addmodule myapp mymodule

Command: blox deletemodule

Delete a module.

blox dropmodule [appname] [modulename]

Example:

blox dropmodule myapp mymodule

Development

To contribute to Blox CLI development, follow these steps:

  1. Clone the repository: git clone /~https://github.com/Softleek/blox.git
  2. Navigate to the cloned directory: cd blox
  3. Install development dependencies: blox install
  4. Make your changes.
  5. Test thoroughly.
  6. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published