Usage ===== This section explains how to use the **lback** framework to build and manage your applications. --- Creating a New Project ---------------------- To create a new Lback project: .. code-block:: bash lback createproject myproject Replace ``myproject`` with your desired project name. This command sets up a new directory structure for your project, including all necessary files and boilerplate code. The new project will include: .. code-block:: bash myproject/ ├── alembic/ │ ├── versions/ │ ├── env.py │ └── script.py.mako ├── myproject/ # Main project package folder │ ├── __init__.py │ ├── urls.py # Main URL configurations │ └── wsgi.py # WSGI entry point for production deployment ├── .env # Environment variables file (optional) ├── config.json # Additional JSON format config file (optional) ├── manage.py # Command-line utility for project management └── settings.py # Main settings file --- App Management -------------- You can create a new app within your project: .. code-block:: bash python manage.py startapp myapp Replace ``myapp`` with your desired app name. This command creates a new directory structure for your app within the project, pre-filled with essential files. The new app will include: .. code-block:: bash myproject/ └── myapp/ # App folder ├── __init__.py ├── admin.py # Register models with the admin panel ├── models.py # Define data models for the app (SQLAlchemy) ├── serializer.py # Serialization tools for API (if the app has API endpoints) ├── urls.py # URL configurations for the app └── views.py # Define View functions or classes that handle requests --- Database Management & Migrations -------------------------------- Lback leverages database migrations to manage changes to your database schema as your application evolves. * **Create New Migration Files:** Scans your models for changes and generates new migration scripts. .. code-block:: bash python manage.py makemigrations * **Apply Database Migrations:** Applies all pending migration scripts to update your database schema to the latest version. .. code-block:: bash python manage.py migrate * **Rollback Migrations for a Table:** Reverts migrations for a specific database table to a previous state. Replace ``