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

[docs] Fix images in docs #1143 #1144

Merged
merged 13 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@

<p align="center">
<br/>
<a href="./docs/queries.md"><img width="100" src="./agdb_web/public/images/db.png" alt="db"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="./docs/api.md"><img width="100" src="./agdb_web/public/images/api.png" alt="api"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="./docs/studio.md"><img width="100" src="./agdb_web/public/images/studio.png" alt="studio"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="./docs/server.md"><img width="100" src="./agdb_web/public/images/server.png" alt="server"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="./docs/cloud.md"><img width="100" src="./agdb_web/public/images/cloud.png" alt="cloud"></a>
<a href="/docs/queries.md"><img width="100" src="/docs/images/db.png" alt="db"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="/docs/api.md"><img width="100" src="/docs/images/api.png" alt="api"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="/docs/studio.md"><img width="100" src="/docs/images/studio.png" alt="studio"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="/docs/server.md"><img width="100" src="/docs/images/server.png" alt="server"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="/docs/cloud.md"><img width="100" src="/docs/images/cloud.png" alt="cloud"></a>
</p>

<p align="center">
<picture><a href="./docs/guides/rust.md"><img width="25" src="./agdb_web/public/images/rust.png" alt="rust"></a>
<picture><a href="./docs/guides/typescript.md"><img width="25" src="./agdb_web/public/images/ts.png" alt="ts"></a>
<picture><a href="./docs/guides/typescript.md"><img width="25" src="./agdb_web/public/images/js.png" alt="js"></a>
<picture><img width="25" src="./agdb_web/public/images/python.png" alt="python"></picture>
<picture><img width="25" src="./agdb_web/public/images/java.png" alt="java"></picture>
<picture><img width="25" src="./agdb_web/public/images/c.png" alt="c"></picture>
<picture><img width="25" src="./agdb_web/public/images/cpp.png" alt="cpp"></picture>
<picture><img width="25" src="./agdb_web/public/images/csharp.png" alt="csharp"></picture>
<a href="/docs/guides/rust.md"><img width="25" src="/docs/images/rust.png" alt="rust"></a>
<a href="/docs/guides/typescript_javascript.md"><img width="25" src="/docs/images/ts.png" alt="ts"></a>
<a href="/docs/guides/typescript_javascript.md"><img width="25" src="/docs/images/js.png" alt="js"></a>
<img width="25" src="/docs/images/python.png" alt="python">
<img width="25" src="/docs/images/java.png" alt="java">
<img width="25" src="/docs/images/c.png" alt="c">
<img width="25" src="/docs/images/cpp.png" alt="cpp">
<img width="25" src="/docs/images/csharp.png" alt="csharp">
</p>

<p align="center">
Expand All @@ -38,19 +38,19 @@
</p>

<!-- <p align="center">
<img width="25" src="./agdb_web/public/images/reddit.png" alt="reddit"> &nbsp;
<img width="25" src="./agdb_web/public/images/x.png" alt="x"> &nbsp;
<img width="25" src="./agdb_web/public/images/linkedin.png" alt="lkinkedin"> &nbsp;
<img width="25" src="./agdb_web/public/images/stackoverflow.png" alt="stackoverflow"> &nbsp;
<img width="25" src="/docs/images/reddit.png" alt="reddit"> &nbsp;
<img width="25" src="/docs/images/x.png" alt="x"> &nbsp;
<img width="25" src="/docs/images/linkedin.png" alt="lkinkedin"> &nbsp;
<img width="25" src="/docs/images/stackoverflow.png" alt="stackoverflow"> &nbsp;
</p> -->

## <img width="25" src="./agdb_web/static/logo.svg" alt="agdb logo">&nbsp;&nbsp;Agnesoft Graph Database

<p align="center">
<a href="/agdb_web/content/en/docs/1.guides/2.quickstart.md">Quickstart Db</a> | <a href="/agdb_web/content/en/docs/1.guides/3.quickstart_client.md">Quickstart Client</a> | <a href="./docs/queries.md">QUERIES</a> | <a href="#decision-tree">DECISION TREE</a>
<a href="/agdb_web/content/en/docs/1.guides/2.quickstart.md">Quickstart Db</a> | <a href="/agdb_web/content/en/docs/1.guides/3.quickstart_client.md">Quickstart Client</a> | <a href="/docs/queries.md">QUERIES</a> | <a href="#decision-tree">DECISION TREE</a>
</p>
<p align="center">
<a href="./docs/but_why.md">Why not SQL?</a>
<a href="/docs/but_why.md">Why not SQL?</a>
</p>

The Agnesoft Graph Database (aka _agdb_) is persistent, optionally memory mapped graph database with native object 'no-text' queries. It can be used as a main persistent storage, data analytics platform as well as fast in-memory cache. Its typed schema-less data store allows for flexible and seamless data updates with no downtime or costly migrations. All queries are constructed via a builder pattern or directly as objects with no special language or text parsing.
Expand All @@ -65,14 +65,14 @@ The Agnesoft Graph Database (aka _agdb_) is persistent, optionally memory mapped
## <img width="25" src="./agdb_web/static/logo.svg" alt="agdb logo">&nbsp;&nbsp;Key Features

- Data plotted on a graph
- Typed [key-value properties](docs/concepts.md#data-types) attached to graph elements (nodes & edges)
- Typed [key-value properties](/docs/concepts.md#data-types) attached to graph elements (nodes & edges)
- Persistent platform agnostic file based storage (transferable between platforms)
- ACID compliant
- [Object queries](docs/queries.md) with builder pattern (no text, no query language)
- [Object queries](/docs/queries.md) with builder pattern (no text, no query language)
- Memory mapped for fast querying
- [Server mode](docs/server.md)
- [OpenAPI clients](docs/api.md) in any programming language
- [Cloud](docs/cloud.md) hosted SaaS database
- [Server mode](/docs/server.md)
- [OpenAPI clients](/docs/api.md) in any programming language
- [Cloud](/docs/cloud.md) hosted SaaS database
- _Db itself has no dependencies_

## <img width="25" src="./agdb_web/static/logo.svg" alt="agdb logo">&nbsp;&nbsp;At a glance [Db]
Expand All @@ -81,7 +81,7 @@ The Agnesoft Graph Database (aka _agdb_) is persistent, optionally memory mapped
cargo add agdb
```

Basic usage demonstrating creating a database, inserting graph elements with data and querying them back with select and search. The function using this code must handle `agdb::DbError` and [`agdb::QueryError`](docs/queries.md#queryerror) error types for operator `?` to work:
Basic usage demonstrating creating a database, inserting graph elements with data and querying them back with select and search. The function using this code must handle `agdb::DbError` and [`agdb::QueryError`](/docs/queries.md#queryerror) error types for operator `?` to work:

```Rust
use agdb::{Db, DbId, QueryBuilder, UserValue, DbUserValue, Comparison::Equal};
Expand Down Expand Up @@ -150,7 +150,7 @@ println!("{:?}", user);
// User { db_id: Some(DbId(3)), username: "Bob" }
```

For database concepts and primitive data types see [concepts](docs/concepts.md). For comprehensive overview of all queries see the [queries](docs/queries.md) reference or continue with more in-depth [efficient agdb](docs/guides/efficient_agdb.md).
For database concepts and primitive data types see [concepts](/docs/concepts.md). For comprehensive overview of all queries see the [queries](/docs/queries.md) reference or continue with more in-depth [efficient agdb](/docs/guides/efficient_agdb.md).

## <img width="25" src="./agdb_web/static/logo.svg" alt="agdb logo">&nbsp;&nbsp;Crate Features

Expand Down Expand Up @@ -204,24 +204,24 @@ The following are planned features:

## <img width="25" src="./agdb_web/static/logo.svg" alt="agdb logo">&nbsp;&nbsp;Reference

- [API](docs/api.md)
- [API](/docs/api.md)

- [But why?](docs/but_why.md)
- [But why?](/docs/but_why.md)

- [Cloud](docs/cloud.md)
- [Cloud](/docs/cloud.md)

- [Concepts](docs/concepts.md)
- [Concepts](/docs/concepts.md)

- [Efficient agdb](docs/guides/efficient_agdb.md)
- [Efficient agdb](/docs/guides/efficient_agdb.md)

- [Guides](docs/guides/)
- [Guides](/docs/guides/)

- [Performance](docs/performance.md)
- [Performance](/docs/performance.md)

- [Queries](docs/queries.md)
- [Queries](/docs/queries.md)

- [Server](docs/server.md)
- [Server](/docs/server.md)

- [Studio](docs/studio.md)
- [Studio](/docs/studio.md)

- [Troubleshooting](docs/troubleshooting.md)
- [Troubleshooting](/docs/troubleshooting.md)
20 changes: 10 additions & 10 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ navigation:

# api

The [agdb server](guides/server.md) can be accessed using OpenAPI (REST) via any HTTP client. In addition to the API specification `agdb` offers wide range of clients for many languages that uses the same API but provides convenience and ease-of-use:
The [agdb server](/docs/server.md) can be accessed using OpenAPI (REST) via any HTTP client. In addition to the API specification `agdb` offers wide range of clients for many languages that uses the same API but provides convenience and ease-of-use:

<p>
<picture><a href="./docs/guides/rust.md"><img width="50" src="./agdb_web/public/images/rust.png" alt="rust"></a>
<picture><a href="./docs/guides/typescript.md"><img width="50" src="./agdb_web/public/images/ts.png" alt="ts"></a>
<picture><a href="./docs/guides/typescript.md"><img width="50" src="./agdb_web/public/images/js.png" alt="js"></a>
<picture><img width="50" src="./agdb_web/public/images/python.png" alt="python"></picture>
<picture><img width="50" src="./agdb_web/public/images/java.png" alt="java"></picture>
<picture><img width="50" src="./agdb_web/public/images/c.png" alt="c"></picture>
<picture><img width="50" src="./agdb_web/public/images/cpp.png" alt="cpp"></picture>
<picture><img width="50" src="./agdb_web/public/images/csharp.png" alt="csharp"></picture>
<p align="center">
<a href="/docs/guides/rust.md"><img width="50" src="/docs/images/rust.png" alt="rust"></a>
<a href="/docs/guides/typescript_javascript.md"><img width="50" src="/docs/images/ts.png" alt="ts"></a>
<a href="/docs/guides/typescript_javascript.md"><img width="50" src="/docs/images/js.png" alt="js"></a>
<img width="50" src="/docs/images/python.png" alt="python">
<img width="50" src="/docs/images/java.png" alt="java">
<img width="50" src="/docs/images/c.png" alt="c">
<img width="50" src="/docs/images/cpp.png" alt="cpp">
<img width="50" src="/docs/images/csharp.png" alt="csharp">
</p>

## openapi.json
Expand Down
21 changes: 11 additions & 10 deletions docs/guides/how_to_run_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
title: "How to run the server?"
description: "How to run the server, Agnesoft Graph Database"
navigation:
title: "How to run the server?"
title: "How to run the server?"
---

# How to run the server?

The following is a guide how to run a local instance of the `agdb_server` on any platform/OS supported by Rust building from source.

<br/>1. Install git from the [officail source](https://git-scm.com/) (skip if you already have it).
<br/>
<br/><br/>

<br/>2. Install Rust toolchain from the [official source](https://www.rust-lang.org/tools/install) (mininum required version is `1.75.0`).
<br/>
<br/><br/>

<br/>3. Clone the `agdb` repository: `git clone https://github.com/agnesoft/agdb.git` (or `[email protected]:agnesoft/agdb.git` if using SSH).
<br/><br/>
Expand Down Expand Up @@ -42,9 +42,9 @@ cargo run --release -p agdb_server

The server upon starting will create few things in its working directory:

- `agdb_server.yaml`: Configuration file. You can alter it as you wish. You would need to restart the server for the changes to take effect.
- `agdb_server.agdb` (`.agdb_server.agdb`): Internal databse of the server (uses `agdb` itself) + its write ahead file (the dotfile).
- `agdb_data_dir/`: Folder for stroing the user data. It can be changed in the configuration file (requires restart of the server).
- `agdb_server.yaml`: Configuration file. You can alter it as you wish. You would need to restart the server for the changes to take effect.
- `agdb_server.agdb` (`.agdb_server.agdb`): Internal databse of the server (uses `agdb` itself) + its write ahead file (the dotfile).
- `agdb_data_dir/`: Folder for stroing the user data. It can be changed in the configuration file (requires restart of the server).

and report where it listens at:

Expand All @@ -56,8 +56,9 @@ NOTE: You can prepare the configuration file before starting the server. It supp

```yaml
# agdb_server.yaml
host: localhost # host address to listen on
port: 3000 # port to bind to
bind: :::3000 # host address to listen on
address: localhost:3000 # address of incoming connections
basepath: "" # optional prefix to allow running behind a reverse proxy
admin: admin # the admin user that will be created automatically for the server, the password will be the same as name (admin by default, recommended to change after startup)
data_dir: agdb_server_data # directory to store user data
```
Expand All @@ -72,7 +73,7 @@ data_dir: agdb_server_data # directory to store user data
curl -v localhost:3000/api/v1/status # should return 200 OK
```

<br/>8. It is recommended by optional to create a user to use for the database management rather than using the `admin` user (which is however still possible):
<br/>8. It is recommended but optional to create a regular user rather than using the `admin` user (which is however still possible):
<br/><br/>

```bash
Expand All @@ -84,7 +85,7 @@ curl -X POST -H "Authorization: Bearer ${token}" localhost:3000/api/v1/admin/use
token=$(curl -X POST -H 'Content-Type: application/json' localhost:3000/api/v1/user/login -d '{"username":"my_db_user","password":"password123"}')
```

<br/>9. To interact with the database you can either continue using `curl`, interactive OpenAPI GUI from any browser `localhost:3000/api/v1` (provided by `rapidoc`) or choose one of the [available API clients](/api.md). The raw OpenAPI specification can be downloaded from the server at `localhost:3000/api/v1/openapi.json`.
<br/>9. To interact with the database you can either continue using `curl`, interactive OpenAPI GUI from any browser `localhost:3000/api/v1` (provided by `rapidoc`) or choose one of the [available API clients](/docs/api.md). The raw OpenAPI specification can be downloaded from the server at `localhost:3000/api/v1/openapi.json`.
<br/><br/>

<br/>10. The server can be shutdown with `CTRL+C` or programmatically posting to the shutdown endpoint as logged in server admin:
Expand Down
99 changes: 14 additions & 85 deletions docs/guides/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ The following is the quickstart guide for the agdb emebedded/application databas
[Looking for server client guide instead?](/docs/guides/quickstart_client)

<br/>1. First install Rust toolchain from the [official source](https://www.rust-lang.org/tools/install) (mininum required version is `1.75.0`).
<br/>
<br><br>

<br/>2. Create an applicaiton folder, for example `agdb_app` and initialize your application using cargo:
<br/><br/>
<br><br>

```bash
mkdir agdb_app
cd agdb_app
cargo init
```

<br/> 3. Add `agdb` as a dependency:
<br/><br/>
<br/>3. Add `agdb` as a dependency:
<br><br>

```bash
cargo add agdb
```

<br/> 4. Create the memory mapped database in your code:
<br/><br/>
<br/>4. Create the memory mapped database in your code:
<br><br>

```rs
use agdb::QueryError;
Expand All @@ -44,8 +44,8 @@ fn main() -> Result<(), QueryError> {
}
```

<br/> 5. Run your first query against the database inserting a node with alias "users":
<br/><br/>
<br/>5. Run your first query against the database inserting a node with alias "users":
<br><br>

```rs
db.exec_mut(&QueryBuilder::insert()
Expand All @@ -54,8 +54,8 @@ db.exec_mut(&QueryBuilder::insert()
.query())?;
```

<br/> 6. Insert additional nodes representing some users and connect them with the "users" node:
<br/><br/>
<br/>6. Insert additional nodes representing some users and connect them with the "users" node:
<br><br>

```rs
// We derive from agdb::UserValue
Expand Down Expand Up @@ -91,8 +91,8 @@ db.exec_mut(
)?;
```

<br/> 7. Find a user in the database matching some conditions:
<br/><br/>
<br/>7. Find a user in the database matching some conditions:
<br><br>

```rust
// We combine search & select into a single query like so:
Expand All @@ -118,76 +118,5 @@ println!("{:?}", users);
// Vec [User { db_id: Some(DbId(3)), username: "John", age: 20 }, User { db_id: Some(DbId(3)), username: "Bob", age: 30 }]
```

<br/> 8. Full program:
<br/><br/>

Cargo.toml:

```
[package]
name = "agdb_app"
edition = "2021"
[dependencies]
agdb = "0.7.0"
```

src/main.rs:

```rs
use agdb::QueryError;
use agdb::Db;
use agdb::QueryBuilder;
use agdb::UserValue
use agdb::Comparison::LessThan;

#[derive(Debug, UserValue)]
struct User {
db_id: Option<DbId>,
username: String
age: u64,
}

fn main() -> Result<(), QueryError> {
let mut db = Db::new("agdb_app.agdb")?;

db.exec_mut(&QueryBuilder::insert().nodes().aliases("users").query())?;

let users = vec![User { db_id: None, username: "Alice".to_string(), age: 40 },
User { db_id: None, username: "Bob".to_string(), age: 30 },
User { db_id: None, username: "John".to_string(), age: 20 }];

let db_users = db.exec_mut(&QueryBuilder::insert()
.nodes()
.values(&users)
.query())?;

db.exec_mut(
&QueryBuilder::insert()
.edges()
.from("users")
.to(&db_users)
.query(),
)?;

let users: Vec<User> = db
.exec(
&QueryBuilder::select()
.values(User::db_keys())
.ids(
QueryBuilder::search()
.from("users")
.where_()
.key("age")
.value(LessThan(40.into()))
.query(),
)
.query(),
)?
.try_into()?;

println!("{:?}", users);

Ok(())
}
```
<br/>8. Full program: https://github.com/agnesoft/agdb/tree/main/examples/app_db
<br><br>
Loading