Skip to content

Commit

Permalink
add sea-orm and sqlx
Browse files Browse the repository at this point in the history
  • Loading branch information
thebino committed Aug 28, 2023
1 parent 33b2f41 commit eb5b041
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 108 deletions.
63 changes: 5 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 39 additions & 37 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,95 +35,97 @@ members = [

# define dependencies to be inherited by members of the workspace
[workspace.dependencies]
# local crates
accounts = { path = "./crates/accounts" }
activity_pub = { path = "./crates/activity_pub" }
common = { path = "./crates/common" }
media = { path = "./crates/media" }
oauth_authorization_server = { path = "./crates/oauth_authorization_server" }
oauth_authentication = { path = "./crates/oauth_authentication" }

# 3rd party dependencies
abi_stable = { version = "0.11.1" }
activitypub_federation = "0.4.6"
async-trait = { version = "0.1.73" }
axum = { version = "0.6.20", features = ["ws", "headers"] }
axum-test = { version = "12.1.0" }
anyhow = { version = "1.0.72" }

core_extensions = { version = "1.5.2", default_features = false, features = ["std"] }
chrono = { version = "0.4.26", features = ["serde"] }

futures = "0.3.25"
futures-channel = "0.3.25"
futures-util = "0.3.25"

http = { version = "0.2.9" }
hyper = { version = "0.14", features = ["full"] }
mime = { version = "0.3" }
mockall = { version = "0.11.4" }

rstest = { version = "0.18.1" }
rumqttc = { version = "0.22.0" }

sea-orm = { version = "0.12.2", features = [ "runtime-tokio-rustls", "debug-print", "mock" ] }
serde = "1.0.183"
serde = { version = "1.0.183" }
serde_json = { version = "1.0.104", features = ["raw_value"] }
smallvec = "1.8.0"
sqlx = { version = "0.7.1" }

time = { version = "0.3.27" }
tokio = { version = "1.30.0", features = ["full"] }
tokio-stream = { version = "0.1.11", features = ["net"] }
tokio-util = { version = "0.7.4", features = ["rt"] }
tower = { version = "0.4.13", features = ["util"] }
tower-http = { version = "0.4.3", features = ["fs", "tracing", "trace", "cors"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["registry", "fmt", "std", "json"] }
tracing-appender = "0.2.2"

uuid = { version = "1.4.1", features = ["serde", "v4"] }
# core_api = { version = "=0.1.0", path = "./crates/core_api" }
# core_api_crud = { version = "=0.1.0", path = "./crates/api_crud" }
# core_apub = { version = "=0.1.0", path = "./crates/activity_pub" }






[dependencies.photos_network_plugin]
version = "0.2.0"
path = "./crates/plugin_interface"

[dependencies]
accounts = { workspace = true }
activity_pub = { workspace = true }
common = { workspace = true }
media = { workspace = true }
oauth_authentication = { workspace = true }
oauth_authorization_server = { workspace = true }



[dependencies]
# local crates
accounts.workspace = true
activity_pub.workspace = true
common.workspace = true
media.workspace = true
oauth_authentication.workspace = true
oauth_authorization_server.workspace = true


# Plugin
abi_stable.workspace = true
core_extensions.workspace = true

abi_stable = "0.11.1"
core_extensions = { version = "1.5.2", default_features = false, features = ["std"] }
serde = "1.0.157"
# de/serialization
serde.workspace = true
serde_json.workspace = true
smallvec = "1.8.0"

# error handling
anyhow.workspace = true

anyhow = "1.0.70"
axum = { version = "0.6.2", features = ["ws"] }
# http
axum.workspace = true
tokio.workspace = true
tower-http.workspace = true
tokio-stream.workspace = true
tokio-util.workspace = true

# logging
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-appender.workspace = true

# oxide-auth = "0.5"
# oxide-auth-axum = "0.3.0"

futures = "0.3.25"
futures-channel = "0.3.25"
futures-util = "0.3.25"

rumqttc = "0.22.0"

tokio.workspace = true
tokio-stream = { version = "0.1.11", features = ["net"] }
tokio-util = { version = "0.7.4", features = ["rt"] }

tower-http.workspace = true
# database
sea-orm.workspace = true
sqlx.workspace = true


[dev-dependencies]
Expand Down
60 changes: 49 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# Photos.network

[![License](https://img.shields.io/github/license/photos-network/core)](./LICENSE.md)
[![GitHub contributors](https://img.shields.io/github/contributors/photos-network/core?color=success)](https://github.com/photos-network/core/graphs/contributors)
[![Discord](https://img.shields.io/discord/793235453871390720)](https://discord.gg/dGFDpmWp46)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/photos-network/core/check%20code%20quality)
[![License](https://img.shields.io/github/license/photos-network/core?style=for-the-badge)](./LICENSE.md)
[![GitHub contributors](https://img.shields.io/github/contributors/photos-network/core?color=success&style=for-the-badge)](https://github.com/photos-network/core/graphs/contributors)
[![Discord](https://img.shields.io/discord/793235453871390720?style=for-the-badge)](https://discord.gg/dGFDpmWp46)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/photos-network/core/check.yaml?style=for-the-badge)


[Photos.network](https://photos.network) is a free and open source, privacy first, self-hosted photo storage and sharing service for fediverse.

Its core features are:

- Upload photos and videos without resolution or quality constraints
- Share photos with friends, family or public
- Filter / Search photos by attributes like location or date
- Group photos by their content like people or objects
- Share photos with friends, family or public
- Upload photos and videos without resolution or quality constraints


## Core

## 🧠 Core

This repository contains the **core** system of the project.
It is responsible for main tasks e.g.:

- **Authentication** (validate the identity of users)
- **Authorization** (handle access privileges of resources like photos or albums)
- **Plugin Handling** (extend the feature set by plugins)
- **Plugin Handling** (extend the feature-set by plugins)
- **Persistency** (read / write data)
- **Task Processing** (keep track of running tasks)



## 🧩 Contribution

This is a free and open project and lives from contributions of the community.

See our [Contribution Guide](CONTRIBUTING.md)



## 🧪 Development

The core is written in [Rust](https://rust-lang.org/) and highly customizably by using a Plugin-system.
The core is written in 🦀 [Rust](https://rust-lang.org/) and highly customizably by using a Plugin-system.



#### 📄 Documentation
Expand All @@ -41,14 +51,20 @@ With the nightly version of `cargo doc` an additional index-page will be created
$ RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all --no-deps --document-private-items --all-features
```



#### 🔬 Testing

With the following command, an continuous check on all files is done in the background and will trigger `cargo test` on each file change.
An continuous check on all files is done in the background and will trigger `cargo test` on each file change.

```shell
$ cargo test --workspace --all-targets
$ cargo watch --exec test
```

To run tests for all crates in this workspace, run:
```shell
$ cargo test --workspace --all-targets
```


### 📜 Roadmap (MvP)
Expand Down Expand Up @@ -79,3 +95,25 @@ The fastest start into development can be archived by using [Visual Studio Code]
6. Launch **Photos.network** from the `RUN` window.

![VS Code with devcontainers](vscode.gif)



## 🏛️ License

```
Photos.network · A privacy first photo storage and sharing service for fediverse
Copyright (C) 2020 Photos network developers
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
```
1 change: 1 addition & 0 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ doctest = false
async-trait = { workspace = true }
axum = { workspace = true }
http = { workspace = true }
sea-orm = { workspace = true, features = ["sqlx-postgres", "runtime-tokio-rustls"] }
serde = { workspace = true, features = ["derive"] }
time = { workspace = true }
uuid = { workspace = true, features = ["serde"] }
Loading

0 comments on commit eb5b041

Please sign in to comment.