diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..cc3602a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,5 @@ +ARG VARIANT="buster" +FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT} + +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3c66ca7 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,50 @@ +{ + "name": "Rust", + "build": { + "dockerfile": "Dockerfile", + "args": { + "VARIANT": "buster" + } + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + "customizations": { + "vscode": { + "settings": { + "lldb.executable": "/usr/bin/lldb", + "files.watcherExclude": { + "**/target/**": true + }, + "rust-analyzer.checkOnSave.command": "clippy", + "terminal.integrated.defaultProfile.linux": "zsh", + "editor.formatOnSave": true, + "html.completion.attributeDefaultValue": "singlequotes", + "[html][handlebars]": { + "editor.defaultFormatter": "vscode.html-language-features" + }, + "[javascript][javascriptreact][typescript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[json][jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[css][scss][less]": { + "editor.defaultFormatter": "vscode.css-language-features" + } + }, + "extensions": [ + "vadimcn.vscode-lldb", + "mutantdino.resourcemonitor", + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "serayuzgur.crates" + ] + } + }, + // "forwardPorts": [], + "postCreateCommand": "rustc --version", + "remoteUser": "vscode" +} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7b5be9e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --all --verbose + - name: Run tests + run: cargo test --all --verbose \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bd23820 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + release: + types: [created] + +jobs: + release: + name: release ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl] + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUSTTARGET: ${{ matrix.target }} + EXTRA_FILES: "README.md LICENSE" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 088ba6b..f0e3bca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,2 @@ -# Generated by Cargo -# will have compiled files and executables -/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 +/target +**/*.rs.bk \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..313cda7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,32 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "fpt" +version = "0.0.0" +dependencies = [ + "anyhow", + "fpt_api", + "fpt_web", +] + +[[package]] +name = "fpt_api" +version = "0.0.0" +dependencies = [ + "anyhow", +] + +[[package]] +name = "fpt_web" +version = "0.0.0" +dependencies = [ + "anyhow", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..fb18a25 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,17 @@ +[workspace] +members = ["crates/*"] + +[package] +name = "fpt" +version = "0.0.0" +authors = ["Jonas Mathisrud Sterud "] +edition = "2021" +description = "Financial portfolio tracker" +repository = "https://github.com/jonassterud/fpt" +license = "MIT" + +[dependencies] +fpt_api = { path = "crates/fpt_api" } +fpt_web = { path = "crates/fpt_web" } + +anyhow = "1.0" diff --git a/README.md b/README.md index b74fc62..f90e1d6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ -# fpt -Financial portfolio tracker +![fpt](src/www/logo/cover.png) + +## About +**fpt** is a financial portfolio tracker. + +## Configuration +... + +## Contributing +Feel free to contribute! + +Use tools such as [Rustfmt](https://github.com/rust-lang/rustfmt) and [Clippy](https://github.com/rust-lang/rust-clippy) to improve your code. +Commit messages should follow [conventionalcommits.org](https://www.conventionalcommits.org). +Where type is one of the following: `feat`, `fix`, `ci`, `docs` or `refactor`. + +## License +This project is licensed under the MIT License - see the [LICENSE](./LICENSE) for details. diff --git a/crates/fpt_api/Cargo.toml b/crates/fpt_api/Cargo.toml new file mode 100644 index 0000000..41a4b0e --- /dev/null +++ b/crates/fpt_api/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fpt_api" +version = "0.0.0" +authors = ["Jonas Mathisrud Sterud "] +edition = "2021" +description = "Financial portfolio tracker - API" +repository = "https://github.com/jonassterud/fpt" +license = "MIT" + +[dependencies] +anyhow = "1.0" diff --git a/crates/fpt_api/src/lib.rs b/crates/fpt_api/src/lib.rs new file mode 100644 index 0000000..da223c5 --- /dev/null +++ b/crates/fpt_api/src/lib.rs @@ -0,0 +1,7 @@ +mod tests; + +use anyhow::Result; + +pub fn start() -> Result<()> { + todo!() +} diff --git a/crates/fpt_api/src/tests.rs b/crates/fpt_api/src/tests.rs new file mode 100644 index 0000000..6e56d6b --- /dev/null +++ b/crates/fpt_api/src/tests.rs @@ -0,0 +1,2 @@ +#[allow(unused_imports)] +use super::*; diff --git a/crates/fpt_web/Cargo.toml b/crates/fpt_web/Cargo.toml new file mode 100644 index 0000000..a3f720a --- /dev/null +++ b/crates/fpt_web/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fpt_web" +version = "0.0.0" +authors = ["Jonas Mathisrud Sterud "] +edition = "2021" +description = "Financial portfolio tracker - web server" +repository = "https://github.com/jonassterud/fpt" +license = "MIT" + +[dependencies] +anyhow = "1.0" diff --git a/crates/fpt_web/src/lib.rs b/crates/fpt_web/src/lib.rs new file mode 100644 index 0000000..da223c5 --- /dev/null +++ b/crates/fpt_web/src/lib.rs @@ -0,0 +1,7 @@ +mod tests; + +use anyhow::Result; + +pub fn start() -> Result<()> { + todo!() +} diff --git a/crates/fpt_web/src/tests.rs b/crates/fpt_web/src/tests.rs new file mode 100644 index 0000000..6e56d6b --- /dev/null +++ b/crates/fpt_web/src/tests.rs @@ -0,0 +1,2 @@ +#[allow(unused_imports)] +use super::*; diff --git a/media/colors.json b/media/colors.json new file mode 100644 index 0000000..bcb4851 --- /dev/null +++ b/media/colors.json @@ -0,0 +1,7 @@ +{ + "bg-gradient-0": "#783192", + "bg-gradient-1": "#59BCC8", + "icon": "#ffffff", + "font": "#ffffff", + "slogan": "#ffffff" +} \ No newline at end of file diff --git a/media/cover.png b/media/cover.png new file mode 100644 index 0000000..49ff975 Binary files /dev/null and b/media/cover.png differ diff --git a/media/profile.png b/media/profile.png new file mode 100644 index 0000000..61f3c89 Binary files /dev/null and b/media/profile.png differ diff --git a/media/vector/default-monochrome-black.svg b/media/vector/default-monochrome-black.svg new file mode 100644 index 0000000..bd2c014 --- /dev/null +++ b/media/vector/default-monochrome-black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/vector/default-monochrome-white.svg b/media/vector/default-monochrome-white.svg new file mode 100644 index 0000000..03f51d9 --- /dev/null +++ b/media/vector/default-monochrome-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/vector/default-monochrome.svg b/media/vector/default-monochrome.svg new file mode 100644 index 0000000..c5311d3 --- /dev/null +++ b/media/vector/default-monochrome.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..c96f62a --- /dev/null +++ b/src/main.rs @@ -0,0 +1,10 @@ +use anyhow::Result; + +fn main() -> Result<()> { + fpt_api::start()?; + fpt_web::start()?; + + println!("Access fpt at: 127.0.0.1:8080"); + + Ok(()) +}