Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add seaography documentation #41

Merged
merged 14 commits into from
Sep 12, 2022
Merged
8 changes: 8 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
- name: Build SeaORM Docs
run: sh build.sh

- name: Build Seaography Docs
run: |
cd Seaography
npm i
npm run build
[[ -d ../docs/Seaography ]] && rm -r ../docs/Seaography
mv build ../docs/Seaography

- name: Deploy GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- [SeaQL Blog](https://www.sea-ql.org/blog/)
- [SeaORM Documentation](https://www.sea-ql.org/SeaORM/)
- [StarfishQL Documentation](https://www.sea-ql.org/StarfishQL/)
- [Seaography Documentation](https://www.sea-ql.org/Seaography/)
20 changes: 20 additions & 0 deletions Seaography/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions Seaography/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions Seaography/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Empty file added Seaography/blog/.gitkeep
Empty file.
56 changes: 56 additions & 0 deletions Seaography/docs/01-getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Getting started


## Installing CLI
```bash
cargo install seaography-cli
```

## CLI parameters

```bash
seaography-cli

USAGE:
seaography-cli [OPTIONS] <DATABASE_URL> <CRATE_NAME> <DESTINATION>

ARGS:
<DATABASE_URL>
<CRATE_NAME>
<DESTINATION>

OPTIONS:
-c, --complexity-limit <COMPLEXITY_LIMIT>
-d, --depth-limit <DEPTH_LIMIT>
-e, --expanded-format <EXPANDED_FORMAT>
-h, --help Print help information
-V, --version Print version information
```

* **DATABASE_URL:** a valid URL pointing to the database.
examples: `mysql://user:pass@127.0.0.1:1235/database_name`, `sqlite://my_db.db`, `postgres://user:pass@127.0.0.1/base_name`
* **CRATE_NAME:** the cargo crate name of the generated project
* **DESTINATION:** path pointing to the output folder, it will create it if does not exist
* **COMPLEXITY_LIMIT:** [Number] Limit GraphQL query complexity so it cannot be greater than this number
* **DEPTH_LIMIT:** [Number] Limit GraphQL query depth so it cannot be greater than this number
* **EXPANDED_FORMAT:** [Boolean] If you want the Sea ORM Entities to be in [extended format](https://www.sea-ql.org/SeaORM/docs/generate-entity/expanded-entity-structure/)

## Prerequisites

In order to understand how the generated code works its recommended to study the following resources:

1. [async-graphql](https://docs.rs/async-graphql/latest/async_graphql/)

Is a server side GraphQL library for Rust.

2. [sea-orm](https://docs.rs/sea-orm/latest/sea_orm/)

SeaORM is a relational ORM to help you build web services in Rust with the familiarity of dynamic languages.

3. [poem](https://docs.rs/crate/poem/latest)

A full-featured and easy-to-use web framework with the Rust programming language.

4. [tokio*](https://docs.rs/tokio/latest/tokio/)

A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language.
Loading