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.
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.
Clone your Blox project repository from GitHub:
git clone /~https://github.com/Softleek/blox.git [project_name]
cd [project_name]
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 in editable mode using pip. This allows you to make changes to the code and have them immediately available without reinstallation:
pip install -e .
After installing Blox CLI, setup your project dependencies and configurations.
blox newsite
Apply database migrations if needed:
blox migrate
To start the development server:
blox start dev
The server will start and typically be accessible at http://localhost:3000
.
Blox CLI commands start with blox
. Here are the available commands:
blox install
Migrate database schema changes.
blox migrate
Start the development server.
blox start dev
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
Create and start a new application.
blox newapp [appname]
Example:
blox installapp myapp
Delete an application.
blox unistallapp [appname]
Example:
blox uninstallapp myapp
Create and start a new module.
blox newmodule [appname] [modulename]
Example:
blox addmodule myapp mymodule
Delete a module.
blox dropmodule [appname] [modulename]
Example:
blox dropmodule myapp mymodule
To contribute to Blox CLI development, follow these steps:
- Clone the repository:
git clone /~https://github.com/Softleek/blox.git
- Navigate to the cloned directory:
cd blox
- Install development dependencies:
blox install
- Make your changes.
- Test thoroughly.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.