Skip to content

Commit 4e9bf3e

Browse files
committed
feat: add more features
1 parent 02f57c5 commit 4e9bf3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+3857
-13
lines changed

backend/Pipfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
fastapi = "*"
8+
uvicorn = "*"
9+
psycopg2-binary = "*"
10+
sqlmodel = "*"
11+
asyncpg = "*"
12+
sqlalchemy = "*"
13+
uuid = "*"
14+
greenlet = "*"
15+
python-dotenv = "*"
16+
alembic = "*"
17+
18+
[dev-packages]
19+
20+
[requires]
21+
python_version = "3.13"
22+
23+
[scripts]
24+
dev = "fastapi dev main.py"

backend/Pipfile.lock

Lines changed: 589 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/db.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
import os
2-
1+
import asyncio
32
from sqlmodel import SQLModel
4-
53
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
64
from sqlalchemy.orm import sessionmaker
75

8-
9-
DATABASE_URL = "postgresql+asyncpg://postgres:postgres@localhost:5432/"
6+
# Укажите правильный URL базы данных
7+
DATABASE_URL = "postgresql+asyncpg://postgres:postgres@localhost:5432/valory"
108
engine = create_async_engine(DATABASE_URL, echo=True, future=True)
119

10+
# Импорт моделей
11+
from models import Overlay # Импортируйте только Overlay или все модели, если их больше
1212

1313
async def init_db():
1414
async with engine.begin() as conn:
15-
# await conn.run_sync(SQLModel.metadata.drop_all)
15+
# await conn.run_sync(SQLModel.metadata.drop_all) # если нужно, раскомментируйте для удаления таблиц перед созданием
1616
await conn.run_sync(SQLModel.metadata.create_all)
1717

18-
1918
async def get_session() -> AsyncSession:
2019
async_session = sessionmaker(
21-
engine, class_= AsyncSession, expire_on_commit=False,
20+
engine, class_=AsyncSession, expire_on_commit=False,
2221
)
2322
async with async_session() as session:
2423
yield session
24+
25+
if __name__ == "__main__":
26+
asyncio.run(init_db())

backend/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
app.add_middleware(
1515
CORSMiddleware,
16-
allow_origins=["http://localhost:5173"],
16+
allow_origins=["http://localhost:5173"], # Убедитесь, что "/" в конце удалено
1717
allow_credentials=True,
1818
allow_methods=["*"],
1919
allow_headers=["*"],
@@ -31,7 +31,7 @@ async def root():
3131
async def get_overlays(session: AsyncSession = Depends(get_session)):
3232
result = await session.execute(select(Overlay))
3333
overlays = result.scalars().all()
34-
return [Overlay(nickname=overlay.nickname, tag=overlay.tag, uuid=overlay.uuid) for overlay in overlays]
34+
return [Overlay(riotId=overlay.riotId, hdevApiKey=overlay.hdevApiKey, uuid=overlay.uuid) for overlay in overlays]
3535

3636
@app.get("/overlay/{overlay_id}", response_model=OverlaySchema)
3737
async def get_overlay(overlay_id: str, session: AsyncSession = Depends(get_session)):
@@ -43,7 +43,7 @@ async def get_overlay(overlay_id: str, session: AsyncSession = Depends(get_sessi
4343

4444
@app.post("/overlay")
4545
async def add_overlay(overlay: OverlayCreate, session: AsyncSession = Depends(get_session)):
46-
overlay = Overlay(nickname=overlay.nickname, tag=overlay.tag)
46+
overlay = Overlay(riotId=overlay.riotId, hdevApiKey=overlay.hdevApiKey)
4747
session.add(overlay)
4848
await session.commit()
4949
await session.refresh(overlay)

backend/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
class OverlayBase(SQLModel):
6-
nickname: str
7-
tag: str
6+
riotId: str
7+
hdevApiKey: str
88
# hdevKey: str
99
# textColor: str
1010
# primaryColor: str

frontend/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Misha Gusev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

frontend/Pipfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
[dev-packages]
9+
10+
[requires]
11+
python_version = "3.13"

frontend/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<a href="https://overlay.haxgun.ru/">
2+
<img align="right" width="100" height="120" src="public/logo.svg">
3+
</a>
4+
5+
6+
# Valory
7+
8+
[![CI/CD](https://github.com/haxgun/valory/actions/workflows/master.yml/badge.svg)](https://github.com/haxgun/valory/actions/workflows/master.yml)
9+
[![GitHub License](https://img.shields.io/github/license/haxgun/valory)](https://github.com/haxgun/valory/blob/main/LICENSE)
10+
[![Website](https://img.shields.io/website?url=https://overlay.haxgun.ru)](https://overlay.haxgun.ru/)
11+
[![Stars](https://img.shields.io/github/stars/haxgun/valory)](https://github.com/haxgun/valory/stargazers)
12+
13+
Valory provides a beautiful rank overlay for your stream.
14+
15+
Project was inspired by the work of [davizeragod](https://davizeragod.github.io/) and [tracker.gg/overlays](https://tracker.gg/overlays).
16+
Initially, the project was a fork of [davizeragod](https://davizeragod.github.io/), but then it began to exist as a separate project.
17+
18+
## ✨ Features
19+
20+
- Instant information update! 📊
21+
- Beautiful, modern design! 💅🏻
22+
- Lots of customization options! 🎨
23+
- Absolutely free! 💸
24+
- Setup once and everything will always work! 🥰
25+
26+
## ❤️ Credits
27+
28+
- [davizeragod/davizeragod.github.io](https://github.com/davizeragod/davizeragod.github.io)
29+
- [Henrik-3/unofficial-valorant-api](https://github.com/Henrik-3/unofficial-valorant-api)
30+
31+
## 📄 License
32+
33+
[Valory](https://github.com/haxgun/valory) is completely free and has an [the MIT license](https://github.com/haxgun/valory/blob/main/LICENSE).
34+
35+
If you want, you can put a star on Github. ⭐🫶🏻

frontend/index.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>VALORANT Overlay - VALORY</title>
8+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
9+
<meta
10+
name="viewport"
11+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
12+
/>
13+
<meta
14+
name="keywords"
15+
content="valory, valory tracker, valory obs, valory obs tracker, valory overlay, obs tracker, obs overlay, valory valorant, valorant, valorant obs, valorant tracker, valorant overlay, valory obs overlay, valory valorant overlay, valory valorant obs, valorant tracker"
16+
/>
17+
<meta name="author" content="MAGICX, [email protected]" />
18+
<meta name="twitter:site" content="@haxguno" />
19+
<meta name="twitter:card" content="summary_large_image" />
20+
<meta name="twitter:image" content="img/meta.webp" />
21+
<meta
22+
name="twitter:description"
23+
content="Elevate your Valorant streaming experience by using the Valory. Keep your viewers engaged and informed, and showcase your progress in the game while making your stream more captivating and memorable!"
24+
/>
25+
<meta name="twitter:title" content="Stream Overlays - Valory" />
26+
<meta property="og:type" content="website" />
27+
<meta property="og:image" content="img/meta.webp" />
28+
<meta
29+
property="og:description"
30+
content="Elevate your Valorant streaming experience by using the Valory. Keep your viewers engaged and informed, and showcase your progress in the game while making your stream more captivating and memorable!"
31+
/>
32+
<meta property="og:title" content="Stream Overlays - Valory" />
33+
<meta
34+
name="description"
35+
content="Elevate your Valorant streaming experience by using the Valory. Keep your viewers engaged and informed, and showcase your progress in the game while making your stream more captivating and memorable!"
36+
/>
37+
</head>
38+
<body>
39+
<noscript>
40+
Enable JavaScript to enjoy all the features of this app.
41+
</noscript>
42+
<div id="app"></div>
43+
<script type="module" src="./src/main.js"></script>
44+
</body>
45+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export const overlayHTML = `
2+
<div class="overlay__body">
3+
<div id="elements" :style="!transparentGradientCheck ? 'background-image: ' + 'linear-gradient(rgba(255, 0, 0, 0), rgba(0, 0, 0, 0.57))' : ''">
4+
<div id="rankBlock" :style="!transparentCheck ? 'background-color: ' + backgroundColor + '40' : ''">
5+
<img alt="rank" src="#" id="imgRank" height="80" width="80" />
6+
</div>
7+
<div id="playerInfo">
8+
<h2 style="text-transform: uppercase;" :style="{ color: textColor }" id="mainText">
9+
Rating
10+
</h2>
11+
<h1 style="text-transform: uppercase;" :style="{ color: primaryColor }" id="playerRank"></h1>
12+
<div id="wlstat" :style="wlStat ? 'display: none' : ''" >
13+
<h2 id="WLvalue" :style="{ color: textColor }">Win: <span id="winValue" :style="{ color: primaryColor }"></span> Lose: <span id="loseValue" :style="{ color: primaryColor }"></span> <span id="wlProccent" :style="{ color: primaryColor }"></span></h2>
14+
</div>
15+
<div id="progressrank" :style="progressRank ? 'display: none' : '--progressrank-after-color:' + progressRankColor + ';' + '--progressrank-color:' + progressRankBackgroundColor + '45';"></div>
16+
<div id="lastmatchpts" class="lastmatchpts" :style="lastMarchPts ? 'display: none' : 'color:' + textColor">
17+
<span>Last Match:</span>
18+
<span id="lastmatchptsvalue" :style="{ color: primaryColor }"></span>
19+
<img src="#" id="imgPTS" height="16" width="16"/>
20+
</div>
21+
</div>
22+
</div>
23+
</div>
24+
`

0 commit comments

Comments
 (0)