Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Setup (#1)
Browse files Browse the repository at this point in the history
* feat: devcontainer configuration

* ci: add workflows

* feat: set default shell

* refactor: remove comments

* feat: structure cargo project

* feat: logo

* docs: basic layout
  • Loading branch information
jonassterud authored Dec 13, 2022
1 parent efd4485 commit 418bf30
Show file tree
Hide file tree
Showing 21 changed files with 226 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <your-package-list-here>
50 changes: 50 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions Cargo.lock

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

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[workspace]
members = ["crates/*"]

[package]
name = "fpt"
version = "0.0.0"
authors = ["Jonas Mathisrud Sterud <[email protected]>"]
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"
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 11 additions & 0 deletions crates/fpt_api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "fpt_api"
version = "0.0.0"
authors = ["Jonas Mathisrud Sterud <[email protected]>"]
edition = "2021"
description = "Financial portfolio tracker - API"
repository = "https://github.com/jonassterud/fpt"
license = "MIT"

[dependencies]
anyhow = "1.0"
7 changes: 7 additions & 0 deletions crates/fpt_api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mod tests;

use anyhow::Result;

pub fn start() -> Result<()> {
todo!()
}
2 changes: 2 additions & 0 deletions crates/fpt_api/src/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[allow(unused_imports)]
use super::*;
11 changes: 11 additions & 0 deletions crates/fpt_web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "fpt_web"
version = "0.0.0"
authors = ["Jonas Mathisrud Sterud <[email protected]>"]
edition = "2021"
description = "Financial portfolio tracker - web server"
repository = "https://github.com/jonassterud/fpt"
license = "MIT"

[dependencies]
anyhow = "1.0"
7 changes: 7 additions & 0 deletions crates/fpt_web/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mod tests;

use anyhow::Result;

pub fn start() -> Result<()> {
todo!()
}
2 changes: 2 additions & 0 deletions crates/fpt_web/src/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[allow(unused_imports)]
use super::*;
7 changes: 7 additions & 0 deletions media/colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"bg-gradient-0": "#783192",
"bg-gradient-1": "#59BCC8",
"icon": "#ffffff",
"font": "#ffffff",
"slogan": "#ffffff"
}
Binary file added media/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/vector/default-monochrome-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/vector/default-monochrome-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/vector/default-monochrome.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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(())
}

0 comments on commit 418bf30

Please sign in to comment.