Welcome to Fastberry
Fastberry, is built with FastAPI and Strawberry that is why is named Fastberry.
The Command-Line-Interface (CLI) is built with Click.
Description
A tool for building GraphQL — API(s) with Python.
You can create . . .
GraphQL—Query(s) andMutation(s).API— HTTPOperation(s).Commands— To create automated processes and more . . .
Built With
| Module | Is Used To... |
|---|---|
| Click | Manage the server, development process and custom Commands. |
| FastAPI | Core Web Framework |
| Strawberry | GraphQL Library |
| Uvicorn | Run the server in Development mode. |
| Gunicorn | Run the server in Staging and Production mode. |
| SPOC | FrameWork tool for building this Framework. |
| DBController | Database Controller for SQL and Mongo. |
Install Fastberry (Demo)
Install Fastberry Mongo
Install Fastberry SQL
SQL Options
| Database | Extra Installation(s) |
|---|---|
| PostgreSQL | "databases[postgresql]" |
| MySQL | "databases[mysql]" |
| Sqlite | "databases[sqlite]" |
Install Gunicorn
Project Flowchart
You can create . . .
Command(s) | API(s) | GraphQL Components.
| (API) Application Programming Interface | (CLI) Command-Line Interface |
|---|---|
1. Load all Settings. |
1. Load all Settings. |
2. Load Environment Variables. |
2. Load Environment Variables. |
3. Load all Apps (Modules). |
3. Load all Apps (Modules). |
4. Start the API Server. |
4. Start the CLI Manager. |
flowchart LR;
A{Click} --> B[Uvicorn];
A --> C[Gunicorn];
A <--> D[Load Settings & Modules];
B --> E{FastAPI};
C --> E;
E <--> F[Load Settings & Modules];
D <--> |Strawberry-GraphQL| G{Your Commands};
F <--> |Strawberry-GraphQL| H{Your API};
H <--> Z{Your Code};
G <--> Z;
Core Layout
root/ --> <Directory> - Project's Root.
|
|-- apps/ --> <Directory> - Project's Apps.
|
|-- config/ --> <Directory> - Configurations.
| |
| |-- .env/ --> <Directory> - Environments.
| | |-- development.toml --> <File> - Development | Settings.
| | |-- production.toml --> <File> - Production | Settings.
| | `-- staging.toml --> <File> - Staging | Settings.
| |
| |-- docs.md --> <File> - API's Documentation in HERE.
| |-- settings.py --> <File> - API (Pythonic) | Settings.
| `-- spoc.toml --> <File> - API (TOML) | Settings.
|
|-- pyproject.toml --> <File> - Project (TOML) | Settings.
|
`-- etc...
Inspired By Django
There are several things from Django that inspire this tool.
Some of the commands and the installation of modules (aka: INSTALLED_APPS) inside a Django project.
Fastberry comes with a few key commands:
| Command | Is Used To... |
|---|---|
startproject |
Create a new Fastberry project. |
./manage.py run |
Run FastApi Server. |
./manage.py schema |
Build GraphQL (Schema & More). |
./manage.py start-app |
Create a Fastberry App inside your "apps" directory. |
./manage.py --help |
For more information. |
startproject
Careful with the command startproject. Only use it once and make sure you are in a new folder.
It will write files and folders.