-
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.
Upgrade the documentation, and fireback module generation features
As title.
- Loading branch information
Showing
208 changed files
with
3,105 additions
and
1,115 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: Database Support | ||
sidebar_position: 5 | ||
--- | ||
|
||
Fireback is written based on the GORM library, so it can support connecting out of the box to the following database. | ||
|
||
You can update the database config interactively, using `fireback config db`, | ||
and it would open a prompt and guide you to set the database parameters. | ||
|
||
```bash | ||
ali@alis-MacBook-Pro fireback % fireback config db | ||
Use the arrow keys to navigate: ↓ ↑ → ← | ||
? Database type: | ||
▸ sqlite (:memory:) | ||
sqlite | ||
mysql | ||
postgres | ||
``` | ||
|
||
*Important:* SQLite memory database only lives until the server is closed. | ||
|
||
This interactive command would later modify the configuration file, (usually `fireback-configuration.yml` or `yourproject-configuration.yml` file) | ||
with following possible data: | ||
|
||
## Mysql | ||
|
||
Connecting to mysql is done by providing normal credentials, and database name. | ||
|
||
```yaml | ||
database: | ||
vendor: mysql | ||
database: mydb | ||
username: root | ||
password: root | ||
host: localhost | ||
port: 3306 | ||
``` | ||
## Sqlite | ||
SQLite is a file based database system, and you just need to specifiy the path of the file, and `Vendor` to `sqlite` | ||
|
||
In your `config.yml` | ||
|
||
```yaml | ||
database: | ||
vendor: sqlite | ||
database: /tmp/fireback.db | ||
``` | ||
|
||
## Postgres | ||
|
||
Postgres is also supported in fireback, (CTE and Pivot queries might be covered in later versions) | ||
and you can use `fireback config db` |
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,13 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Entities in Fireback | ||
|
||
As might be discussed in other documents, entities are tables in database, similar to Entity Framework | ||
and other ORMs concept of 'entity', which is a table mapped to a class or struct in the programming language. | ||
|
||
The major difference between Fireback entities is, it provides functionality by default on top of the entity, | ||
which could be used directly as http api or cli, without creating much controller. Every entity supposed | ||
to be able to be created easily, updated, deleted, obey permission role requirements. | ||
|
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,31 @@ | ||
--- | ||
title: Starting web server | ||
sidebar_position: 6 | ||
--- | ||
|
||
Fireback itself, or any projects, microservices built using fireback can serve on http, | ||
using `fireback start` command. It would lift normal gin http server will all routes. | ||
|
||
You can set `PORT` env variable, or set the port in configuration file as well. environment variable | ||
will override the configuration, which overrides 4500 default port. | ||
|
||
```bash | ||
ali@alis-MacBook-Pro ~ % fireback start | ||
|
||
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached. | ||
|
||
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. | ||
- using env: export GIN_MODE=release | ||
- using code: gin.SetMode(gin.ReleaseMode) | ||
|
||
[GIN-debug] GET /socket.io/*any --> github.com/gin-gonic/gin.WrapH.func1 (4 handlers) | ||
[GIN-debug] POST /socket.io/*any --> github.com/gin-gonic/gin.WrapH.func1 (4 handlers) | ||
[GIN-debug] GET /books --> pixelplux.com/fireback/modules/books.HttpQueryBooks (4 handlers) | ||
... | ||
``` | ||
|
||
If you are running fireback itself, you can see an open api document on `http://localhost:4500/docs` | ||
and also fireback administration ui on `http://localhost:4500`. | ||
|
||
For projects built manually you might need to create your own UI and place it into your binary, | ||
if thats how you would like to distribute UI. |
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,45 @@ | ||
--- | ||
title: Download and install fireback | ||
sidebar_position: 1 | ||
--- | ||
|
||
## Recommended installers | ||
|
||
Fireback comes with MSI intallers for Windows, Packages for mac, and Debian packages for ubuntu. | ||
Installers will register the binary in the PATH and are recommended way to install: | ||
|
||
### Macosx installers: | ||
|
||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback_silicon_arm64.pkg">https://github.com/torabian/fireback/releases/latest/download/fireback_silicon_arm64.pkg</a> | ||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback_intel_amd64.pkg">https://github.com/torabian/fireback/releases/latest/download/fireback_intel_amd64.pkg</a> | ||
|
||
### Windows msi installers: | ||
|
||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback_win_amd64_installer.msi">https://github.com/torabian/fireback/releases/latest/download/fireback_win_amd64_installer.msi</a> | ||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback_win_arm64_installer.msi">https://github.com/torabian/fireback/releases/latest/download/fireback_win_arm64_installer.msi</a> | ||
|
||
### Debian installers: | ||
|
||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback-amd64.deb">https://github.com/torabian/fireback/releases/latest/download/fireback-amd64.deb</a> | ||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback-arm64.deb">https://github.com/torabian/fireback/releases/latest/download/fireback-arm64.deb</a> | ||
|
||
### Vscode extension | ||
|
||
Gives you fireback assist, such as Module3 auto completion | ||
<a target="_blank" href="https://github.com/torabian/fireback/releases/latest/download/fireback-tools.vsix">https://github.com/torabian/fireback/releases/latest/download/fireback-tools.vsix</a> | ||
|
||
|
||
### Using 'go install' | ||
|
||
You can install fireback using `go install github.com/torabian/fireback/cmd/fireback@latest` | ||
This would install it from source, and should be available in `go/bin` folder. | ||
Sometimes, your `go/bin` folder is not in your path, you need to add it. (Also check the next section) | ||
|
||
You might need to add the go/bin to your path, for example mac or linux: | ||
|
||
```bash | ||
echo 'export PATH="$PATH:$HOME/go/bin"' >> ~/.bashrc && source ~/.bashrc | ||
``` | ||
|
||
If your system is reporting that the `fireback` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the go/bin directory in your User's home directory is not in the PATH environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt. | ||
|
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,41 @@ | ||
--- | ||
title: Passports Introduction | ||
description: Signup and Signin management through passports | ||
--- | ||
|
||
Fireback provides a core user system for every project. Fireback project tends to be complete in itself, | ||
therefor ABAC solution is built right into it. | ||
|
||
For almost every interaction with Fireback or projects built with it, you need to be authenticated. This authentication | ||
is basically a token, which defines what kind of access level current session has. | ||
|
||
Because most of fireabck actions are written in specific workspace by a user, generally all actions of an entity | ||
are locked to that feature. You can have of course public access scope on an entity, for example public newsletter | ||
sign up without authentication or some statisics if needed. | ||
|
||
## What passport entity is | ||
|
||
Passport entity represents a tool such as email address, or phone number, or could be a google login | ||
to authenticate a user. Passports belong to the root, and modifying them is only other custom actions | ||
such as signup, change passport and more. | ||
|
||
Passports do not have authentication level, they just verify that the user is what who pretends he is, and | ||
in theory each user can have multiple passports, they can extra email to their user account or remove, although | ||
this feature might not be available in current version, database design supports it. | ||
|
||
## Passport method | ||
|
||
Passport method is another table in the database, which would define what method of authentication are available | ||
in the project, and modifying it is also root access only. Using passport method, you can define very specific authentication options, remove an option, or specifiy different methods for different countries. | ||
|
||
This section is accessible via `fireback passport method` command. | ||
|
||
## Login via CLI | ||
|
||
After creating a new project - or just installing pure Fireback itself - you need to initialize an environment. | ||
This could be done by `fireback init` or `./app init` if you are in your own project. | ||
|
||
If you continue the prompt questions, they will ask you about a admin user, with a name or last name. This command is independently available on `fireback passport new` function, which would create a user, workspace, assign roles, | ||
generate a token and authenticate the cli with that. Current authenticated user could be show by `fireback ws view` | ||
which would export a lot of different details of current user access. | ||
|
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
Oops, something went wrong.