diff --git a/.github/unraid.svg b/.github/unraid.svg new file mode 100644 index 000000000..c13a5995c --- /dev/null +++ b/.github/unraid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..2edeafb09 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 084198fb7..c4a5d50a2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,26 +6,6 @@ "source.fixAll": "never", "source.fixAll.eslint": "explicit" }, - "workbench.colorCustomizations": { - "activityBar.activeBackground": "#78797d", - "activityBar.background": "#78797d", - "activityBar.foreground": "#e7e7e7", - "activityBar.inactiveForeground": "#e7e7e799", - "activityBarBadge.background": "#df9fac", - "activityBarBadge.foreground": "#15202b", - "commandCenter.border": "#e7e7e799", - "sash.hoverBorder": "#78797d", - "statusBar.background": "#5f6063", - "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#78797d", - "statusBarItem.remoteBackground": "#5f6063", - "statusBarItem.remoteForeground": "#e7e7e7", - "titleBar.activeBackground": "#5f6063", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveBackground": "#5f606399", - "titleBar.inactiveForeground": "#e7e7e799" - }, - "peacock.color": "#5f6063", "i18n-ally.localesPaths": [ "locales" ], diff --git a/api/.vscode/settings.json b/api/.vscode/settings.json new file mode 100644 index 000000000..c3ef21cb2 --- /dev/null +++ b/api/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "eslint.lintTask.options": "--flag unstable_ts_config", + "eslint.options": { + "flags": ["unstable_ts_config"], + "overrideConfigFile": ".eslintrc.ts" + } +} diff --git a/api/justfile b/api/justfile new file mode 100644 index 000000000..85237b4c5 --- /dev/null +++ b/api/justfile @@ -0,0 +1,9 @@ +set fallback + +default: + @just --list --justfile {{justfile()}} --list-heading $'\nAPI project recipes:\n' + @just list-commands + +setup: + npm install + npm run container:build diff --git a/justfile b/justfile new file mode 100644 index 000000000..33a2b726a --- /dev/null +++ b/justfile @@ -0,0 +1,42 @@ +# The first recipe in a justfile is considered the default recipe, +# which means it runs when `just` is called with no arguments + +default: list-commands + +list-commands: + @just --list --justfile {{justfile()}} --list-heading $'\nMonorepo recipes:\n' + +# Prepares the repo for development +setup: + # ignore personal vscode settings. to contribute a change, use `just stop-ignore $file` + @just ignore .vscode/settings.json api/.vscode/settings.json web/.vscode/settings.json + # ignore api local-state files + @just ignore api/dev/states/myservers.cfg api/dev/Unraid.net/myservers.cfg + + just api/setup + just web/setup + + +# starts ignoring a file already tracked by git. (gitignore will not apply to these files) +[group('git')] +[no-cd] +ignore +files: + #!/usr/bin/env bash + for file in {{ files }}; do + if [ ! -f "$file" ]; then + echo "Warning: $file does not exist" + continue + fi + git update-index --skip-worktree "$file" + done + +# resumes normal tracking of an ignored tracked file. +[group('git')] +[no-cd] +stop-ignoring file: + git update-index --no-skip-worktree {{ file }} + +# lists tracked files where further changes are being ignored. +[group('git')] +list-ignored: + -git ls-files -v | grep '^S' diff --git a/readme.md b/readme.md new file mode 100644 index 000000000..dce8b122f --- /dev/null +++ b/readme.md @@ -0,0 +1,244 @@ + + + + + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![MIT License][license-shield]][license-url] +[![LinkedIn][linkedin-shield]][linkedin-url] + + + + +
+
+ + Logo + + +

Unraid Connect

+ +

+ Monorepo for Unraid Connect and the Unraid API. +
+ Explore the docs » +
+
+ View Demo + · + Report Bug + · + Request Feature +

+
+ + + + +
+ Table of Contents +
    +
  1. + About The Project + +
  2. +
  3. + Getting Started + +
  4. +
  5. Usage
  6. +
  7. Roadmap
  8. +
  9. Contributing
  10. +
  11. License
  12. +
  13. Contact
  14. +
  15. Acknowledgments
  16. +
+
+ + + +## About The Project + + + +### Built With + +* [![Unraid][Unraid]][Unraid-url] +* [![Node.js][Node.js]][Node-url] +* [![Nuxt][Nuxt.js]][Nuxt-url] +* [![PHP][PHP]][PHP-url] + +

(back to top)

+ + + + +## Getting Started + +This section will guide you through the steps necessary to get the monorepo projects running and +communicating with each other. + +### Prerequisites + +Make sure the following software is installed before proceeding. + +- Bash +- Docker (for macOS folks, Orbstack works too) +- [Node.js (v20)][Node-url] +- [Just](https://github.com/casey/just) +- An [Unraid][Unraid-url] server for development + +Next, create an SSH key if you haven't already. +Once you have your key pair, add your public SSH key to your Unraid server: + +1. Log in to your Unraid development server. +2. Use the navigation menu to go to 'Users'. +3. Click on the user you logged in with (e.g. `root`) +4. Paste your SSH public key into 'SSH authorized keys' and click 'Save'. + +### Installation + +1. Clone and enter the repo + ```sh + # Optionally, give the cloned folder a more specific name + gh repo clone unraid/api api-monorepo + cd api-monorepo + ``` +2. Run the monorepo setup command. + ```sh + just setup + ``` + This will run installation scripts, container builds, and some git scripts to reduce noise (i.e. personal editor customizations, etc). +3. Run the API container + ```sh + cd api + npm run container:start + ``` +4. This should bring you inside the API container. There, run the following command to start the server: + ```js + npm run dev + ``` +5. In another terminal, open the project and navigate to the web directory. Then, run the dev server: + ```sh + cd web + npm install # just in case + npm run dev + ``` + +

(back to top)

+ + + +## Usage + +Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources. + +_For more examples, please refer to the [Documentation](https://docs.unraid.net/)_ + +

(back to top)

+ + + + + + + + + + + + + + + + +## Contact + +[@UnraidOfficial](https://twitter.com/UnraidOfficial) - support@unraid.net.com + +Project Link: [https://github.com/unraid/api](https://github.com/unraid/api) + +

(back to top)

+ + + +## Acknowledgments + +* []() +* []() +* []() + +

(back to top)

+ + + + + +[contributors-shield]: https://img.shields.io/github/contributors/unraid/api.svg?style=for-the-badge +[contributors-url]: https://github.com/unraid/api/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/unraid/api.svg?style=for-the-badge +[forks-url]: https://github.com/unraid/api/network/members +[stars-shield]: https://img.shields.io/github/stars/unraid/api.svg?style=for-the-badge +[stars-url]: https://github.com/unraid/api/stargazers +[issues-shield]: https://img.shields.io/github/issues/unraid/api.svg?style=for-the-badge +[issues-url]: https://github.com/unraid/api/issues +[license-shield]: https://img.shields.io/github/license/unraid/api.svg?style=for-the-badge +[license-url]: https://github.com/unraid/api/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 +[linkedin-url]: https://www.linkedin.com/company/unraid +[product-screenshot]: images/screenshot.png +[Nuxt.js]: https://img.shields.io/badge/Nuxt-002E3B?style=for-the-badge&logo=nuxtdotjs&logoColor=#00DC82 +[Node.js]: https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white +[PHP]: https://img.shields.io/badge/php-%23777BB4.svg?style=for-the-badge&logo=php&logoColor=white +[Unraid]: https://img.shields.io/badge/unraid-%23F15A2C.svg?style=for-the-badge&logo=unraid&logoColor=white +[Unraid-url]: https://unraid.net +[Nuxt-url]: https://nuxt.com/ +[Node-url]: https://nodejs.org/ +[PHP-url]: https://php.net/ \ No newline at end of file diff --git a/web/.env.example b/web/.env.example index 0dbe407a6..dc5498498 100644 --- a/web/.env.example +++ b/web/.env.example @@ -4,4 +4,9 @@ VITE_UNRAID_NET=https://unraid.ddev.site VITE_OS_RELEASES="https://releases.unraid.net/os" VITE_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams VITE_ALLOW_CONSOLE_LOGS=true -VITE_TAILWIND_BASE_FONT_SIZE=10 +# Base font size in pixels for Tailwind CSS. Used by the tailwind-rem-to-rem plugin to scale rem values. +# This lets us use rem's in our css instead of pixels while remaining webgui-compatible without additional hacks. +# This should match your root font size. Default: 16 +# For an Unraid Webgui deployment, set this to 10. +VITE_TAILWIND_BASE_FONT_SIZE=16 +VITE_WEBGUI=http://localhost:3001 diff --git a/web/justfile b/web/justfile new file mode 100644 index 000000000..b20ba21ef --- /dev/null +++ b/web/justfile @@ -0,0 +1,9 @@ +set fallback + +default: + @just --list --justfile {{justfile()}} --list-heading $'\nWeb project recipes:\n' + @just list-commands + +setup: + cp .env.example .env + npm install