Skip to content

Commit

Permalink
feat: frontend backend and ui improvements (#358)
Browse files Browse the repository at this point in the history
* feat: rewrite and some other ui changes

* feat: adding general settings

* feat: added general settings

* feat: minor form changes

* feat: added media server and about page, working on scrapers and content with array fields

* feat: added array field

* feat: added scrapers and content settings, almost done with settings ;):

* feat: minor additions to scrapers form

* feat: added all settings rewrite

* feat: minor changes

* chore: formatted frontend files

* feat: improving homepage ui

* feat: improving homepage ui

* feat: added onboarding

* fix: minor fix and improvements to onboarding

* chore: formatted frontend files
  • Loading branch information
AyushSehrawat authored Jun 12, 2024
1 parent 41bc74e commit 8a9e941
Show file tree
Hide file tree
Showing 253 changed files with 6,466 additions and 5,819 deletions.
14 changes: 12 additions & 2 deletions backend/controllers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ async def health(request: Request):
}


@router.get("/user")
@router.get("/rd")
async def get_rd_user():
api_key = settings_manager.settings.downloaders.real_debrid.api_key
headers = {"Authorization": f"Bearer {api_key}"}
response = requests.get(
"https://api.real-debrid.com/rest/1.0/user", headers=headers, timeout=10
)
return response.json()
if response.status_code != 200:
return {"success": False, "message": response.json()}

return {
"success": True,
"data": response.json(),
}


@router.get("/torbox")
async def get_torbox_user():
Expand All @@ -43,6 +50,7 @@ async def get_torbox_user():
)
return response.json()


@router.get("/services")
async def get_services(request: Request):
data = {}
Expand All @@ -55,6 +63,7 @@ async def get_services(request: Request):
data[sub_service.key] = sub_service.initialized
return {"success": True, "data": data}


@router.get("/trakt/oauth/initiate")
async def initiate_trakt_oauth(request: Request):
trakt = request.app.program.services.get(TraktContent)
Expand All @@ -63,6 +72,7 @@ async def initiate_trakt_oauth(request: Request):
auth_url = trakt.perform_oauth_flow()
return {"auth_url": auth_url}


@router.get("/trakt/oauth/callback")
async def trakt_oauth_callback(code: str, request: Request):
trakt = request.app.program.services.get(TraktContent)
Expand Down
13 changes: 0 additions & 13 deletions frontend/.eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions frontend/.eslintrc.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
Expand Down
11 changes: 2 additions & 9 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

## Creating a project

Expand Down
25 changes: 13 additions & 12 deletions frontend/components.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.pcss",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
}
}
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app.css",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
},
"typescript": true
}
33 changes: 33 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
];
119 changes: 60 additions & 59 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
{
"name": "frontend",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "vitest",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-node": "^4.0.1",
"@sveltejs/kit": "^2.5.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/luxon": "^3.3.7",
"@types/nprogress": "^0.2.3",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"autoprefixer": "^10.4.14",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.2.3",
"prettier-plugin-tailwindcss": "^0.5.9",
"svelte": "^4.2.8",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.4.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.1.4",
"vitest": "^1.3.1"
},
"type": "module",
"dependencies": {
"bits-ui": "^0.19.3",
"clsx": "^2.0.0",
"cmdk-sv": "^0.0.12",
"embla-carousel-svelte": "8.0.0-rc20",
"formsnap": "^0.4.2",
"lucide-svelte": "^0.344.0",
"luxon": "^3.4.4",
"mode-watcher": "^0.2.0",
"motion": "^10.17.0",
"nprogress": "^0.2.0",
"svelte-sonner": "^0.3.11",
"sveltekit-superforms": "^1.13.4",
"tailwind-merge": "^2.2.0",
"tailwind-variants": "^0.2.0",
"uuid": "^9.0.1",
"zod": "^3.22.4"
}
}
"name": "frontend",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "vitest",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-node": "^5.0.1",
"@sveltejs/kit": "^2.5.10",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@tailwindcss/typography": "^0.5.13",
"@types/eslint": "^8.56.10",
"@types/luxon": "^3.4.2",
"@types/nprogress": "^0.2.3",
"@types/uuid": "^9.0.8",
"autoprefixer": "^10.4.19",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.39.0",
"globals": "^15.4.0",
"postcss": "^8.4.38",
"prettier": "^3.3.1",
"prettier-plugin-svelte": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.14",
"svelte": "^4.2.18",
"svelte-check": "^3.8.0",
"tailwindcss": "^3.4.4",
"tslib": "^2.6.3",
"typescript": "^5.4.5",
"typescript-eslint": "8.0.0-alpha.28",
"vite": "^5.2.12",
"vitest": "^1.6.0"
},
"type": "module",
"dependencies": {
"bits-ui": "^0.21.10",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.17",
"embla-carousel-svelte": "^8.1.3",
"formsnap": "^1.0.0",
"lucide-svelte": "^0.390.0",
"luxon": "^3.4.4",
"mode-watcher": "^0.3.0",
"motion": "^10.18.0",
"nprogress": "^0.2.0",
"svelte-sonner": "^0.3.24",
"sveltekit-superforms": "^2.14.0",
"tailwind-merge": "^2.3.0",
"tailwind-variants": "^0.2.1",
"uuid": "^9.0.1",
"zod": "^3.23.8"
}
}
Loading

0 comments on commit 8a9e941

Please sign in to comment.