Skip to content

Commit

Permalink
� migrate to vite and fixed thread of yt-core
Browse files Browse the repository at this point in the history
  • Loading branch information
biswajit-k committed Jul 8, 2023
1 parent d5e3405 commit 7c85e02
Show file tree
Hide file tree
Showing 35 changed files with 2,699 additions and 36,242 deletions.
17 changes: 15 additions & 2 deletions application.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import threading
from models.token import Token
from models.history import History
from models.subscription import Subscription
from models.user import User
from routes import router
from settings import application, db
from youtube.yt_watchman import YtWatchman
from youtube.yt_watchman import yt_watchman

# DB
with application.app_context():
db.create_all()

# YT_WATCHMAN_CORE
# YtWatchman().start()

# TODO: improve logic - remove while 1
def watchman_runner():
print('yt-watchman thread started')
import time
while 1:
print("running thread")
# requires app context as thread can't read current application
yt_watchman(application.app_context())
time.sleep(20)

YtWatchman = threading.Thread(daemon=True, target=watchman_runner)
# YtWatchman.start()

# ROUTES
application.register_blueprint(router)
Expand Down
20 changes: 20 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-env node */

module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
47 changes: 18 additions & 29 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
# /build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
client_secret
done

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# backend
.ebextensions
/__pycache__
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
.env
.flaskenv
yt
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
10 changes: 10 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tabWidth": 4,
"useTabs": true,
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "always"
}
70 changes: 0 additions & 70 deletions frontend/README.md

This file was deleted.

14 changes: 14 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo-icon.jpg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>YT Watchman</title>
</head>
<body>
<div id="root"></div>
<div id="modal-box"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
Loading

0 comments on commit 7c85e02

Please sign in to comment.