Skip to content

Commit

Permalink
Migrate to a new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Raduc4 committed Jan 14, 2024
0 parents commit 04501a3
Show file tree
Hide file tree
Showing 172 changed files with 6,573 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#####################################################
# Do not edit or add properties here #
#####################################################
# Create a new `.env` file that will be git ignored #
# In `.env` set all needed properties #
#####################################################

# https://www.contentful.com/developers/docs/

# test
NEXT=next
9 changes: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["prettier"],
"parserOptions": {
"tsconfigRootDir": "./"
}
}
78 changes: 78 additions & 0 deletions .github/workflows/webdriver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Validate branch
on:
workflow_call:
push:
branches: ['master']
pull_request:
branches: ['master']

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
# 40 MiB stack
RUST_MIN_STACK: 40971520
RUST_LOG: 'citadel=warn'

jobs:
# a single job named test
test:
# the display name of the test job
name: WebDriverIO Test Runner

# we want to run on the latest linux environment
runs-on: ubuntu-latest

# the steps our job runs **in order**
steps:
# checkout the code on the workflow runner
- uses: actions/checkout@v2
- uses: Avarok-Cybersecurity/gh-actions-deps@master
# install system dependencies that Tauri needs to compile on Linux.
# note the extra dependencies for `tauri-driver` to run which are: `webkit2gtk-driver` and `xvfb`
- name: Tauri dependencies
run: >-
sudo apt-get update &&
sudo apt-get install -y
libgtk-3-dev
libayatana-appindicator3-dev
libwebkit2gtk-4.0-dev
webkit2gtk-driver
xvfb
# install the latest Rust stable
- name: Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

# # we run our rust tests before the webdriver tests to avoid testing a broken application
- name: Cargo test
run: cargo test --package citadel-workspace
# # build a release build of our application to be used during our WebdriverIO tests
- name: Cargo build
run: cargo build --package citadel-workspace --release

# install the latest stable node version at the time of writing
- name: Node v16
uses: actions/setup-node@v2
with:
node-version: 16.x

# install our Node.js dependencies with Yarn
- name: Yarn install
run: yarn install

# install the latest version of `tauri-driver`.
# note: the tauri-driver version is independent of any other Tauri versions
- name: Install tauri-driver
run: cargo install tauri-driver

# run the WebdriverIO test suite.
# we run it through `xvfb-run` (the dependency we installed earlier) to have a fake
# display server which allows our application to run headless without any changes to the code
- name: WebdriverIO
run: xvfb-run yarn test
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

/target/

debug/

# 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

/.next/
./next-env.d.ts
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Empty file added .husky/pre-commit
Empty file.
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"quoteProps": "consistent"
}
41 changes: 41 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { StorybookConfig } from '@storybook/nextjs';
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
import path from 'path';

const config: StorybookConfig = {
stories: ['../components/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
framework: {
name: '@storybook/nextjs',
options: {},
},
core: {
builder: '@storybook/builder-webpack5',
},
docs: {
autodocs: 'tag',
},
staticDirs: ['../public'],
webpackFinal: async (config, { configType }) => {
config!.resolve!.plugins = [
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, '../tsconfig.json'),
}) as any,
];

return config;
},
};
export default config;
5 changes: 5 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<link
href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.6/flowbite.min.css"
rel="stylesheet"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.6/flowbite.min.js"></script>
16 changes: 16 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Preview } from '@storybook/react';
import '../styles/globals.css';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @tbraun96 @Raduc4 @Djokovic0311
86 changes: 86 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[config]
default_to_workspace = false
skip_core_tasks = true

[tasks.clean]
command = "cargo"
args = ["clean"]

[tasks.clippy]
command = "cargo"
args = ["clippy"]

[tasks.fmt]
command = "cargo"
args = ["fmt", "--all"]

[tasks.git_lfs_fetch]
command = "git"
args = ["lfs", "fetch"]

[tasks.git_lfs]
command = "git"
args = ["lfs", "pull"]
dependencies = ["git_lfs_fetch"]

[tasks.pr]
dependencies = ["fmt", "clippy"]

[tasks.install_gui_deps]
command = "cargo"
args = ["install", "create-tauri-app", "tauri-cli"]

[tasks.install-binstall]
install_crate = { crate_name = "cargo-binstall", binary = "cargo", test_arg = ["binstall", "--help"] }

[tasks.install-nextest]
command = "cargo"
args = ["binstall", "cargo-nextest", "--secure", "-y"]
dependencies = ["install-binstall"]

[tasks.install.mac]
command = "brew"
args = ["install", "llvm@13", "openssl", "cmake"]

[tasks.install.windows]
command = "set"
args = ["OPENSSL_ROOT_DIR=C:/Program Files/OpenSSL-Win64"]
dependencies = ["install_deps"]

[tasks.install]
dependencies = ["install_gui_deps"]

[tasks.install_deps.windows]
command = "choco"
args = ["install", "-y", "llvm", "openssl", "cmake"]

[tasks.publish-install-deps]
install_crate = { crate_name = "cargo-workspaces", binary = "cargo", test_arg = ["workspaces", "--help"] }

[tasks.run]
command = "cargo"
args = ["tauri", "dev"]
dependencies = ["install_gui_deps"]

[tasks.run-web]
command = "yarn"
args = ["dev"]
dependencies = ["install_gui_deps"]

[tasks.publish-patch]
command = "cargo"
condition = { env_set = [ "CARGO_REGISTRY_TOKEN" ] }
args = ["workspaces", "publish", "--token", "${CARGO_REGISTRY_TOKEN}", "patch", "--from-git", "${@}"]
dependencies = ["publish-install-deps"]

[tasks.publish-minor]
command = "cargo"
condition = { env_set = [ "CARGO_REGISTRY_TOKEN" ] }
args = ["workspaces", "publish", "--token", "${CARGO_REGISTRY_TOKEN}", "minor", "--from-git", "${@}"]
dependencies = ["publish-install-deps"]

[tasks.publish-major]
command = "cargo"
condition = { env_set = [ "CARGO_REGISTRY_TOKEN" ] }
args = ["workspaces", "publish", "--token", "${CARGO_REGISTRY_TOKEN}", "major", "--from-git", "${@}"]
dependencies = ["publish-install-deps"]
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Citadel Workspace

Graphical User Interface for interfacing with Citadel Workspace, a highly cryptographically post-quantum secure work environment for individuals, businesses, and government.

### Automatic Install

After installing cargo make, run: `cargo make install`

### Manual Install

Install `cargo install create-tauri-app`

Install `cargo install tauri-cli`

Install Bun JS runtime dependencies `curl -fsSL https://bun.sh/install | bash`

Install JS dependencies `bun install`

### Running

<i>Running the app from vscode's terminal can lead to an error, try running from your system terminal.</i>

Run the desktop app with `cargo tauri dev`

Run the web app with `bun run dev`

Run Storybook server with `bun run sb`
Binary file added bun.lockb
Binary file not shown.
15 changes: 15 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "styles/globals.css",
"baseColor": "zinc",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
12 changes: 12 additions & 0 deletions components/chat/Chat.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Meta, StoryFn } from '@storybook/react';
import Chat from './Chat';

export default {
title: 'Components / MessageInput',
} as Meta;

export const MessageInput: StoryFn = () => (
<div className="">
<Chat />
</div>
);
Loading

0 comments on commit 04501a3

Please sign in to comment.