-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
282 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
# from .commands.swagger import list_routes | ||
import typer | ||
|
||
from blitz.cli.commands.clone import clone_project | ||
from blitz.cli.commands.callback import callback | ||
|
||
from .commands.create import create_blitz_app | ||
from .commands.list import list_blitz_app | ||
from .commands.release import release_blitz | ||
from .commands.start import start_blitz | ||
from .commands.swagger import list_routes | ||
|
||
app = typer.Typer() | ||
app = typer.Typer(no_args_is_help=True) | ||
app.command(name="create")(create_blitz_app) | ||
app.command(name="list")(list_blitz_app) | ||
app.command(name="start")(start_blitz) | ||
app.command(name="release")(release_blitz) | ||
app.command(name="swagger")(list_routes) | ||
app.command(name="clone")(clone_project) | ||
app.callback(invoke_without_command=True)(callback) | ||
# dev only | ||
# app.command(name="clean")(clean_blitz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import Annotated, Optional | ||
import typer | ||
from blitz import __version__ | ||
|
||
def version_callback(show_version: bool) -> None: | ||
if show_version: | ||
print(__version__) | ||
|
||
def callback(version: Annotated[Optional[bool], typer.Option("--version", help="Show the Blitz version.", callback=version_callback)] = None) -> None: | ||
if version: | ||
print(__version__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,143 @@ | ||
!!! warning | ||
**WORK IN PROGRESS** | ||
# API | ||
|
||
The Blitz API contains all the exposed CRUD operations defined on the [Blitz File](/blitz/blitzfile/), but also the `/blitz-file` which is, as its name suggests, the Json representation of the running Blitz File. | ||
|
||
This feature is used for the [clone command](/blitz/cli/clone/) and the [--url option of the start command](/blitz/cli/start). | ||
|
||
This feature can be disabled with the `--no-config-route` option of the start command. | ||
|
||
For exemple, this is the return of the demo `/blitz-file`: | ||
|
||
```json | ||
{ | ||
"config":{ | ||
"name":"Demo Blitz App", | ||
"description":"This is a demo blitz app", | ||
"version":"0.1.0" | ||
}, | ||
"resources":{ | ||
"Food":{ | ||
"name":{ | ||
"type":"str", | ||
"nullable":false, | ||
"unique":true | ||
}, | ||
"expiration_date":{ | ||
"type":"datetime", | ||
"nullable":false, | ||
"unique":false | ||
} | ||
}, | ||
"Ingredient":{ | ||
"food_id":{ | ||
"type":"uuid", | ||
"foreign_key":"Food.id", | ||
"nullable":true, | ||
"unique":false | ||
}, | ||
"food":{ | ||
"type":"relationship", | ||
"relationship":"Food", | ||
"relationship_list":false, | ||
"nullable":false, | ||
"unique":false | ||
}, | ||
"recipe_id":{ | ||
"type":"uuid", | ||
"foreign_key":"Recipe.id", | ||
"nullable":true, | ||
"unique":false | ||
}, | ||
"recipe":{ | ||
"type":"relationship", | ||
"relationship":"Recipe", | ||
"relationship_list":false, | ||
"nullable":false, | ||
"unique":false | ||
} | ||
}, | ||
"Recipe":{ | ||
"name":{ | ||
"type":"str", | ||
"nullable":false, | ||
"unique":true | ||
}, | ||
"ingredients":{ | ||
"type":"relationship", | ||
"relationship":"Ingredient", | ||
"relationship_list":true, | ||
"nullable":false, | ||
"unique":false | ||
}, | ||
"cook_id":{ | ||
"type":"uuid", | ||
"foreign_key":"Cook.id", | ||
"nullable":true, | ||
"unique":false | ||
}, | ||
"cook":{ | ||
"type":"relationship", | ||
"relationship":"Cook", | ||
"relationship_list":false, | ||
"nullable":false, | ||
"unique":false | ||
} | ||
}, | ||
"Cook":{ | ||
"name":{ | ||
"type":"str", | ||
"nullable":false, | ||
"unique":true | ||
}, | ||
"age":{ | ||
"type":"int", | ||
"nullable":false, | ||
"unique":false | ||
}, | ||
"recipes":{ | ||
"type":"relationship", | ||
"relationship":"Recipe", | ||
"relationship_list":true, | ||
"nullable":false, | ||
"unique":false | ||
}, | ||
"rat":{ | ||
"type":"relationship", | ||
"relationship":"Rat", | ||
"relationship_list":false, | ||
"nullable":false, | ||
"unique":false | ||
} | ||
}, | ||
"Rat":{ | ||
"name":{ | ||
"type":"str", | ||
"nullable":false, | ||
"unique":true | ||
}, | ||
"age":{ | ||
"type":"int", | ||
"nullable":false, | ||
"unique":false | ||
}, | ||
"cook_id":{ | ||
"type":"uuid", | ||
"foreign_key":"Cook.id", | ||
"nullable":true, | ||
"unique":true | ||
}, | ||
"cook":{ | ||
"type":"relationship", | ||
"relationship":"Cook", | ||
"relationship_list":false, | ||
"nullable":false, | ||
"unique":false | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
!!! tip "Want to master the syntax of Blitz?" | ||
|
||
You can **[learn here](/blitz/blitzfile/)** how the Blitz File work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Clone | ||
|
||
With clone you can create a new Blitz project from a Blitz App running on a remote server. | ||
|
||
A Blitz App can expose the `/blitz-file` endpoint which is the Blitz file of the current running Blitz App. | ||
|
||
!!! tip | ||
You can desactivate this feature with `blitz start --no-config-route` option. | ||
|
||
You can try it with the demo: | ||
```console | ||
blitz clone https://demo.blitz.paperz.app/blitz-file | ||
``` | ||
|
||
<!-- termynal --> | ||
|
||
<div class="termy"> | ||
|
||
```console | ||
$ blitz clone https://demo.blitz.paperz.app/blitz-file | ||
|
||
<span style="color: #af87ff; font-weight: bold;">Demo Blitz App</span> created successfully ! | ||
To start your app, you can use: | ||
<span style="color: #af87ff; font-weight: bold;">blitz start demo-blitz-app</span> | ||
``` | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Admin | ||
The admin is provided by [Starlette Admin](https://github.com/jowilf/starlette-admin) | ||
|
||
Check the [admin from the Live Demo](https://demo.blitz.paperz.app/admin/). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Blitz File Editor | ||
|
||
The Dashboard has a Blitz file editor (only JSON for now) to directly create or update your resources. | ||
|
||
You can test our [Blitz file editor in the Live Demo](https://demo.blitz.paperz.app/dashboard/projects/demo-blitz-app/blitz-file). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Diagram | ||
|
||
The demo diagram is [available here](https://demo.blitz.paperz.app/dashboard/projects/demo-blitz-app/diagram). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# GPT Builder | ||
|
||
You can chat with GPT to create or improve Blitz file. | ||
|
||
You have to set an OpenAI API Key in the settings (or as environment variable for local projects). | ||
|
||
We will automaticly detect valid Blitz File and you will be able to copy to clipboard or download in yaml or Json. | ||
|
||
You can [chat with our builder in the Live Demo](https://demo.blitz.paperz.app/dashboard/gpt). | ||
|
||
Features: | ||
|
||
- Detect valid and invalid Blitz files. | ||
- Change or update the pre-prompt, to provide your context and your needs to GPT. | ||
- Choose between GPT 3.5 turbo and GPT 4. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
Blitz has a dashboard and an admin. | ||
# Overview | ||
Blitz has a native dashboard and an admin. | ||
|
||
You can test it in our [Live Demo](https://demo.blitz.paperz.app) | ||
|
||
# Main features | ||
- **Swagger UI**: You can interect with the swagger ui directly in the Blitz Dashboard. | ||
- **Blitz File Editor**: The dashboard provides users with direct access to the Blitz file, allowing them to make instantaneous modifications as needed. | ||
- **Panel Admin Data Management**: Interface for managing database resources, ensuring efficient organization, manipulation, and retrieval of data | ||
- **Dynamic Blitz File Generation**: Utilizing GPT capabilities, users can prompt the system to generate new Blitz files on demand, streamlining the process of creating and updating Blitz files. | ||
- **Mermaid Diagram Visualization** | ||
- **Log Visualization**. | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Logs | ||
|
||
The log page of the dashboard is always in WIP. | ||
|
||
The [demo version](https://demo.blitz.paperz.app/dashboard/projects/demo-blitz-app/logs) is anonymised. | ||
|
||
Run the [blitz demo locally](/blitz/) to see more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Swagger | ||
|
||
You can interact with the swagger directly inside the Blitz Dashboard. | ||
|
||
You can play with the [Swagger from the Live Demo](https://demo.blitz.paperz.app/dashboard/projects/demo-blitz-app/swagger). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters