flask web app (wip)

This commit is contained in:
Dobromir Popov
2024-10-13 00:39:46 +03:00
parent b9410f2986
commit 49384accf6
12 changed files with 234 additions and 36 deletions

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Crypto Portfolio Tracker{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
<link rel="manifest" href="{{ url_for('static', filename='manifest.json') }}">
<meta name="theme-color" content="#4A90E2">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="{{ url_for('index') }}">Home</a></li>
{% if current_user.is_authenticated %}
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
<li><a href="{{ url_for('logout') }}">Logout</a></li>
{% else %}
<li><a href="{{ url_for('login') }}">Login</a></li>
{% endif %}
</ul>
</nav>
</header>
<main>
{% block content %}{% endblock %}
</main>
<footer>
<p>&copy; 2023 Crypto Portfolio Tracker</p>
</footer>
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
</body>
</html>

View File

@ -0,0 +1,23 @@
{% extends "base.html" %}
{% block content %}
<h1>Dashboard</h1>
<p>Welcome, {{ current_user.username }}!</p>
<h2>Your Wallets</h2>
<div id="wallets"></div>
<h2>Recent Transactions</h2>
<div id="transactions"></div>
<h2>Holdings</h2>
<div id="holdings"></div>
<button id="generate-api-key">Generate API Key</button>
<p id="api-key-display"></p>
<script>
// Add JavaScript to fetch and display wallet data, transactions, and holdings
// Also add functionality for generating API key
</script>
{% endblock %}

View File

@ -1,21 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Token Swapper</title>
</head>
<body>
<h1>Token Swapper</h1>
<div>
<button id="connectWallet">Connect Phantom Wallet</button>
</div>
<div>
<input type="text" id="tokenName" placeholder="Enter Token Name">
<input type="number" id="amount" placeholder="Enter Amount">
<button id="swapToken">Swap Token</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/@solana/web3.js"></script>
<script src="app.js"></script>
</body>
</html>
{% extends "base.html" %}
{% block content %}
<h1>Welcome to Crypto Portfolio Tracker</h1>
<p>Track your cryptocurrency investments with ease.</p>
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
<h1>Login</h1>
<form method="POST" action="{{ url_for('login') }}">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<button type="submit">Login</button>
</form>
{% if error %}
<p class="error">{{ error }}</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Token Swapper</title>
</head>
<body>
<h1>Token Swapper</h1>
<div>
<button id="connectWallet">Connect Phantom Wallet</button>
</div>
<div>
<input type="text" id="tokenName" placeholder="Enter Token Name">
<input type="number" id="amount" placeholder="Enter Amount">
<button id="swapToken">Swap Token</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/@solana/web3.js"></script>
<script src="app.js"></script>
</body>
</html>