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

feat(all): initial commit #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OS
Thumbs.db
.DS_Store

# Editors
.vs/
.vscode/
.idea/
.fleet/
18 changes: 18 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:

- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
timezone: "Europe/Warsaw"
day: "friday"
time: "18:00"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
timezone: "Europe/Warsaw"
day: "friday"
time: "18:00"
47 changes: 47 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci & cd

on:
push:
branches:
- "main" # Trigger on main branch.
tags:
- "v*.*.*" # Trigger on semantic version tags.
pull_request: # Validation only (without pushing).

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Run Cargo:fmt
run: cargo +nightly fmt --all -- --check

- name: Run Cargo:clippy
run: cargo clippy --all-features -- -D warnings

- name: Run Cargo:test
run: cargo test --verbose --all-features

publish:
runs-on: ubuntu-22.04
if: github.event_name == 'push'
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Publish
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
62 changes: 47 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,53 @@
# Generated by Cargo
# will have compiled files and executables
# OS
Thumbs.db
.DS_Store
.ignore*/

# Editors
.vs/
.vscode/
.idea/
.fleet/

# Lang: Rust
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# Lang: Node
node_modules/
package-lock.json
env.d.ts
*-env.d.ts

# Lang: Astro
.vite/
.astro/

# Output
dist/
typing/
output/
build/

# Generated
crates/runtime/protobuf/

# Binaries
*.exe
*.exe~
*.dll
*.so
*.dylib

# Environment
env/
.env
.env*

# Logs
logs/
*.log
*.log*
67 changes: 67 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
resolver = "2"
members = [
"./crates/cli",
"./crates/database",
"./crates/graph",
"./crates/runtime",
"./crates/server",
]

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "Axiston License 1.0"
publish = false

authors = ["Axiston <[email protected]>"]
repository = "https://github.com/axiston/axiston"
homepage = "https://github.com/axiston/axiston"
documentation = "https://docs.rs/axiston"

# TODO: Import axiston-database-migrate from crates.io.
# TODO: Import axiston-database-schema from crates.io.

[workspace.dependencies]
axiston-db-generate = { path = "../database/crates/generate" }
axiston-db-migrate = { path = "../database/crates/migrate" }
axiston-db-connect = { path = "./crates/database", version = "0.1.0" }

axiston-graph = { path = "./crates/graph", version = "0.1.0" }
axiston-runtime = { path = "./crates/runtime", version = "0.1.0" }
axiston-server = { path = "./crates/server", version = "0.1.0" }

tokio = { version = "1.41", features = ["rt-multi-thread", "macros"] }
deadpool = { version = "0.12", features = ["rt_tokio_1"] }
futures = { version = "0.3", features = [] }
thiserror = { version = "2.0", features = [] }
anyhow = { version = "1.0", features = ["backtrace"] }

tracing = { version = "0.1", features = [] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "time"] }
tracing-opentelemetry = { version = "0.28", features = [] }
opentelemetry = { version = "0.27", features = [] }

axum = { version = "0.7", features = ["http2", "macros", "ws"] }
axum-server = { version = "0.7.1", features = ["tls-rustls"] }
axum-extra = { version = "0.9", features = ["typed-header"] }
axum-test = { version = "16.4", features = [] }
tower = { version = "0.4", features = ["full"] }
tower-http = { version = "0.5", features = ["full"] }

derive_more = { version = "1.0", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_with = { version = "3.11", features = [] }
serde_toml = { package = "toml", version = "0.8", features = [] }
serde_json = { version = "1.0", features = [] }
ts-rs = { version = "10.1", features = ["uuid-impl"] }

bytes = { version = "1.9", features = ["serde"] }
uuid = { version = "1.11", features = ["v4", "serde"] }
time = { version = "0.3", features = ["serde"] }
base64 = { version = "0.22", features = [] }
ecow = { version = "0.2", features = ["serde"] }
cron = { version = "0.13", features = [] }
ipnet = { version = "2.10", features = ["serde"] }
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Compile & build the application.
FROM rust:latest AS build
WORKDIR /usr/src/runtime/

# Configurate & run the application.
FROM debian:buster-slim AS run
WORKDIR /usr/bin/runtime/
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 axiston
Copyright (c) 2024 Axiston

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
# axiston
### axiston/axiston

[![Build Status][action-badge]][action-url]
[![Crate Coverage][coverage-badge]][coverage-url]

[action-badge]: https://img.shields.io/github/actions/workflow/status/axiston/axiston/build.yaml
[action-url]: https://github.com/axiston/axiston/actions/workflows/build.yaml
[coverage-badge]: https://img.shields.io/codecov/c/github/axiston/axiston
[coverage-url]: https://app.codecov.io/gh/axiston/axiston

The open source Zapier alternative.

#### Notes

- Lorem Ipsum.
- Lorem Ipsum.
- Lorem Ipsum.

#### Usage

```cmd
axiston --port 8080
```
54 changes: 54 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# https://doc.rust-lang.org/cargo/reference/manifest.html

[package]
name = "axiston-cli"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
readme = "./README.md"

authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
documentation = { workspace = true }

[[bin]]
name = "axiston"
path = "main.rs"

[features]
default = []

# - Enables HTTPS support with the axum-server crate.
# - Spawns a server that redirects incoming HTTP requests.
support-https = ["dep:axum-server"]

# - Builds the graph editor app into the app directory.
# - Enables service that serves files from app directory.
support-files = []

[dependencies]
axiston-server = { workspace = true }

clap = { version = "4.5", features = ["derive"] }
tokio = { workspace = true }
anyhow = { workspace = true }

tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-opentelemetry = { workspace = true }
opentelemetry = { workspace = true }

axum = { workspace = true }
axum-server = { workspace = true, optional = true }
axum-extra = { workspace = true }
tower = { workspace = true }
tower-http = { workspace = true }

serde = { workspace = true }
serde_toml = { workspace = true }
serde_json = { workspace = true }

[dev-dependencies]
axum-test = { workspace = true }
9 changes: 9 additions & 0 deletions crates/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### axiston/cli

Cli and Http/https server. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum.

#### Notes

- Lorem Ipsum.
- Lorem Ipsum.
- Lorem Ipsum.
15 changes: 15 additions & 0 deletions crates/cli/config/load_json.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use std::path::Path;

use crate::config::Args;

/// - Reads the entire contents of a file into a bytes vector.
/// - Deserializes an instance of type [`Args`] from the read content.
///
/// # Errors
///
/// - See [std::fs::read] and [`serde_json::from_slice`] documentation for details.
pub fn load_json<P: AsRef<Path>>(path: P) -> anyhow::Result<Args> {
let file_content = std::fs::read(path)?;
let parsed_args = serde_json::from_slice(&file_content)?;
Ok(parsed_args)
}
15 changes: 15 additions & 0 deletions crates/cli/config/load_toml.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use std::path::Path;

use crate::config::Args;

/// - Reads the entire contents of a file into a string buffer.
/// - Deserializes an instance of type [`Args`] from the read content.
///
/// # Errors
///
/// - See [std::fs::read_to_string] and [`serde_toml::from_str`] documentation for details.
pub fn load_toml<P: AsRef<Path>>(path: P) -> anyhow::Result<Args> {
let file_content = std::fs::read_to_string(path)?;
let parsed_args = serde_toml::from_str(&file_content)?;
Ok(parsed_args)
}
Loading
Loading