Emmanuel Frimpong Asante
commited on
Commit
·
06ff008
1
Parent(s):
2b99d1c
update space base
Browse files- app.py +4 -3
- static/index.html +0 -10
- static/script.js +0 -0
- static/style.css +0 -0
- templates/auth-base.html +29 -0
- templates/auth/login.html +1 -1
- templates/auth/register.html +1 -1
- templates/base.html +43 -3
- templates/landing.html +86 -0
app.py
CHANGED
@@ -4,13 +4,14 @@ from fastapi import FastAPI, Request
|
|
4 |
from fastapi.templating import Jinja2Templates
|
5 |
from fastapi.responses import HTMLResponse
|
6 |
from routes.authentication import auth_router
|
|
|
7 |
|
8 |
app = FastAPI()
|
9 |
templates = Jinja2Templates(directory="templates")
|
10 |
-
|
11 |
app.include_router(auth_router, prefix="/auth", tags=["Authentication"])
|
12 |
|
13 |
|
14 |
@app.get("/", response_class=HTMLResponse)
|
15 |
-
async def
|
16 |
-
return templates.TemplateResponse("
|
|
|
4 |
from fastapi.templating import Jinja2Templates
|
5 |
from fastapi.responses import HTMLResponse
|
6 |
from routes.authentication import auth_router
|
7 |
+
from fastapi.staticfiles import StaticFiles
|
8 |
|
9 |
app = FastAPI()
|
10 |
templates = Jinja2Templates(directory="templates")
|
11 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
12 |
app.include_router(auth_router, prefix="/auth", tags=["Authentication"])
|
13 |
|
14 |
|
15 |
@app.get("/", response_class=HTMLResponse)
|
16 |
+
async def landing_page(request: Request):
|
17 |
+
return templates.TemplateResponse("landing.html", {"request": request})
|
static/index.html
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<title>Title</title>
|
6 |
-
</head>
|
7 |
-
<body>
|
8 |
-
|
9 |
-
</body>
|
10 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static/script.js
DELETED
File without changes
|
static/style.css
DELETED
File without changes
|
templates/auth-base.html
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html lang="en">
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7 |
+
<title>{{ title | default("Poultry Management System") }}</title>
|
8 |
+
|
9 |
+
<!-- Google Font: Source Sans Pro -->
|
10 |
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
11 |
+
<!-- icheck bootstrap -->
|
12 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/icheck-bootstrap/3.0.1/icheck-bootstrap.min.css" integrity="sha512-8vq2g5nHE062j3xor4XxPeZiPjmRDh6wlufQlfC6pdQ/9urJkU07NM0tEREeymP++NczacJ/Q59ul+/K2eYvcg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
13 |
+
|
14 |
+
<!-- AdminLTE CSS -->
|
15 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
16 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
17 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
18 |
+
</head>
|
19 |
+
<body class="hold-transition login-page">
|
20 |
+
{% block content %}{% endblock %}
|
21 |
+
|
22 |
+
<!-- Bootstrap 5 -->
|
23 |
+
|
24 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
25 |
+
<!-- Scripts -->
|
26 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
27 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
|
28 |
+
</body>
|
29 |
+
</html>
|
templates/auth/login.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
{% extends "base.html" %}
|
2 |
|
3 |
{% block content %}
|
4 |
<div class="login-box">
|
|
|
1 |
+
{% extends "auth-base.html" %}
|
2 |
|
3 |
{% block content %}
|
4 |
<div class="login-box">
|
templates/auth/register.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
{% extends "base.html" %}
|
2 |
|
3 |
{% block content %}
|
4 |
<div class="register-box">
|
|
|
1 |
+
{% extends "auth-base.html" %}
|
2 |
|
3 |
{% block content %}
|
4 |
<div class="register-box">
|
templates/base.html
CHANGED
@@ -4,11 +4,20 @@
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>{{ title | default("Poultry Management System") }}</title>
|
7 |
-
|
|
|
|
|
8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
</head>
|
10 |
<body class="hold-transition sidebar-mini layout-fixed">
|
11 |
<div class="wrapper">
|
|
|
12 |
<!-- Navbar -->
|
13 |
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
|
14 |
<ul class="navbar-nav ml-auto">
|
@@ -17,50 +26,79 @@
|
|
17 |
</li>
|
18 |
</ul>
|
19 |
</nav>
|
|
|
20 |
<!-- Sidebar -->
|
21 |
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
|
|
22 |
<a href="/" class="brand-link">
|
23 |
<span class="brand-text font-weight-light">Poultry Management</span>
|
24 |
</a>
|
|
|
|
|
25 |
<div class="sidebar">
|
26 |
<nav class="mt-2">
|
27 |
-
<ul class="nav nav-pills nav-sidebar flex-column" role="menu">
|
|
|
28 |
<li class="nav-item">
|
29 |
<a href="/" class="nav-link">
|
30 |
<i class="nav-icon fas fa-home"></i>
|
31 |
<p>Home</p>
|
32 |
</a>
|
33 |
</li>
|
|
|
34 |
<li class="nav-item">
|
35 |
<a href="/inventory" class="nav-link">
|
36 |
<i class="nav-icon fas fa-boxes"></i>
|
37 |
<p>Inventory</p>
|
38 |
</a>
|
39 |
</li>
|
|
|
40 |
<li class="nav-item">
|
41 |
<a href="/health" class="nav-link">
|
42 |
<i class="nav-icon fas fa-heartbeat"></i>
|
43 |
<p>Health</p>
|
44 |
</a>
|
45 |
</li>
|
|
|
46 |
<li class="nav-item">
|
47 |
<a href="/todo" class="nav-link">
|
48 |
<i class="nav-icon fas fa-tasks"></i>
|
49 |
<p>To-Do List</p>
|
50 |
</a>
|
51 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
</ul>
|
53 |
</nav>
|
54 |
</div>
|
55 |
</aside>
|
|
|
56 |
<!-- Content Wrapper -->
|
57 |
<div class="content-wrapper">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
<section class="content">
|
59 |
<div class="container-fluid">
|
60 |
{% block content %}{% endblock %}
|
61 |
</div>
|
62 |
</section>
|
63 |
</div>
|
|
|
64 |
<!-- Footer -->
|
65 |
<footer class="main-footer">
|
66 |
<div class="float-right d-none d-sm-inline">
|
@@ -69,7 +107,9 @@
|
|
69 |
<strong>© 2024</strong> All rights reserved.
|
70 |
</footer>
|
71 |
</div>
|
|
|
|
|
72 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
73 |
-
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.
|
74 |
</body>
|
75 |
</html>
|
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>{{ title | default("Poultry Management System") }}</title>
|
7 |
+
<!-- AdminLTE CSS -->
|
8 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
9 |
+
<!-- Font Awesome Icons -->
|
10 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
11 |
+
<style>
|
12 |
+
.navbar-brand {
|
13 |
+
font-weight: bold;
|
14 |
+
color: #fff !important;
|
15 |
+
}
|
16 |
+
</style>
|
17 |
</head>
|
18 |
<body class="hold-transition sidebar-mini layout-fixed">
|
19 |
<div class="wrapper">
|
20 |
+
|
21 |
<!-- Navbar -->
|
22 |
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
|
23 |
<ul class="navbar-nav ml-auto">
|
|
|
26 |
</li>
|
27 |
</ul>
|
28 |
</nav>
|
29 |
+
|
30 |
<!-- Sidebar -->
|
31 |
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
32 |
+
<!-- Brand Logo -->
|
33 |
<a href="/" class="brand-link">
|
34 |
<span class="brand-text font-weight-light">Poultry Management</span>
|
35 |
</a>
|
36 |
+
|
37 |
+
<!-- Sidebar Menu -->
|
38 |
<div class="sidebar">
|
39 |
<nav class="mt-2">
|
40 |
+
<ul class="nav nav-pills nav-sidebar flex-column" role="menu" data-accordion="false">
|
41 |
+
<!-- Home -->
|
42 |
<li class="nav-item">
|
43 |
<a href="/" class="nav-link">
|
44 |
<i class="nav-icon fas fa-home"></i>
|
45 |
<p>Home</p>
|
46 |
</a>
|
47 |
</li>
|
48 |
+
<!-- Inventory Management -->
|
49 |
<li class="nav-item">
|
50 |
<a href="/inventory" class="nav-link">
|
51 |
<i class="nav-icon fas fa-boxes"></i>
|
52 |
<p>Inventory</p>
|
53 |
</a>
|
54 |
</li>
|
55 |
+
<!-- Health Monitoring -->
|
56 |
<li class="nav-item">
|
57 |
<a href="/health" class="nav-link">
|
58 |
<i class="nav-icon fas fa-heartbeat"></i>
|
59 |
<p>Health</p>
|
60 |
</a>
|
61 |
</li>
|
62 |
+
<!-- To-Do List -->
|
63 |
<li class="nav-item">
|
64 |
<a href="/todo" class="nav-link">
|
65 |
<i class="nav-icon fas fa-tasks"></i>
|
66 |
<p>To-Do List</p>
|
67 |
</a>
|
68 |
</li>
|
69 |
+
<!-- Notifications -->
|
70 |
+
<li class="nav-item">
|
71 |
+
<a href="/notifications" class="nav-link">
|
72 |
+
<i class="nav-icon fas fa-bell"></i>
|
73 |
+
<p>Notifications</p>
|
74 |
+
</a>
|
75 |
+
</li>
|
76 |
</ul>
|
77 |
</nav>
|
78 |
</div>
|
79 |
</aside>
|
80 |
+
|
81 |
<!-- Content Wrapper -->
|
82 |
<div class="content-wrapper">
|
83 |
+
<!-- Content Header -->
|
84 |
+
<div class="content-header">
|
85 |
+
<div class="container-fluid">
|
86 |
+
<div class="row mb-2">
|
87 |
+
<div class="col-sm-6">
|
88 |
+
<h1 class="m-0">{{ title | default("Dashboard") }}</h1>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
|
94 |
+
<!-- Main Content -->
|
95 |
<section class="content">
|
96 |
<div class="container-fluid">
|
97 |
{% block content %}{% endblock %}
|
98 |
</div>
|
99 |
</section>
|
100 |
</div>
|
101 |
+
|
102 |
<!-- Footer -->
|
103 |
<footer class="main-footer">
|
104 |
<div class="float-right d-none d-sm-inline">
|
|
|
107 |
<strong>© 2024</strong> All rights reserved.
|
108 |
</footer>
|
109 |
</div>
|
110 |
+
|
111 |
+
<!-- Scripts -->
|
112 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
113 |
+
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/js/adminlte.min.js"></script>
|
114 |
</body>
|
115 |
</html>
|
templates/landing.html
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Poultry Management System</title>
|
7 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css">
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.hero-section {
|
11 |
+
background-image: url('/images/landing-bg.jpg');
|
12 |
+
background-size: cover;
|
13 |
+
background-position: center;
|
14 |
+
color: #fff;
|
15 |
+
text-align: center;
|
16 |
+
padding: 100px 20px;
|
17 |
+
}
|
18 |
+
.hero-title {
|
19 |
+
font-size: 3rem;
|
20 |
+
font-weight: bold;
|
21 |
+
}
|
22 |
+
.hero-description {
|
23 |
+
font-size: 1.25rem;
|
24 |
+
margin-top: 20px;
|
25 |
+
}
|
26 |
+
.features-section {
|
27 |
+
padding: 50px 20px;
|
28 |
+
}
|
29 |
+
.feature-box {
|
30 |
+
text-align: center;
|
31 |
+
padding: 20px;
|
32 |
+
}
|
33 |
+
</style>
|
34 |
+
</head>
|
35 |
+
<body>
|
36 |
+
|
37 |
+
<div class="wrapper">
|
38 |
+
|
39 |
+
<!-- Hero Section -->
|
40 |
+
<div class="hero-section">
|
41 |
+
<h1 class="hero-title">Welcome to the Poultry Management System</h1>
|
42 |
+
<p class="hero-description">Efficiently manage your poultry farm with advanced health monitoring, inventory management, and task automation.</p>
|
43 |
+
<a href="/auth/login" class="btn btn-primary btn-lg mt-3">Login</a>
|
44 |
+
<a href="/auth/register" class="btn btn-outline-light btn-lg mt-3">Register</a>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<!-- Features Section -->
|
48 |
+
<div class="features-section">
|
49 |
+
<div class="container">
|
50 |
+
<h2 class="text-center mb-5">Key Features</h2>
|
51 |
+
<div class="row">
|
52 |
+
<div class="col-md-4">
|
53 |
+
<div class="feature-box">
|
54 |
+
<i class="fas fa-heartbeat fa-3x mb-3 text-primary"></i>
|
55 |
+
<h4>Health Monitoring</h4>
|
56 |
+
<p>Track poultry health and receive actionable insights to manage disease outbreaks effectively.</p>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
<div class="col-md-4">
|
60 |
+
<div class="feature-box">
|
61 |
+
<i class="fas fa-boxes fa-3x mb-3 text-success"></i>
|
62 |
+
<h4>Inventory Management</h4>
|
63 |
+
<p>Manage feed, medicine, and supply inventory levels with ease, ensuring your farm is always stocked.</p>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
<div class="col-md-4">
|
67 |
+
<div class="feature-box">
|
68 |
+
<i class="fas fa-tasks fa-3x mb-3 text-warning"></i>
|
69 |
+
<h4>Task Automation</h4>
|
70 |
+
<p>Automate daily tasks and manage to-do lists for efficient farm operations.</p>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<!-- Footer -->
|
78 |
+
<footer class="text-center py-4">
|
79 |
+
<p>© 2024 Poultry Management System. All rights reserved.</p>
|
80 |
+
</footer>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
84 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/adminlte.min.js"></script>
|
85 |
+
</body>
|
86 |
+
</html>
|