AyushAI14 commited on
Commit
6ba48a8
·
verified ·
1 Parent(s): 003afeb

now ready

Browse files
Files changed (4) hide show
  1. app.py +31 -0
  2. dockerfile +6 -2
  3. static/home.css +170 -0
  4. templates/home.html +83 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask,render_template,request
2
+ import pickle
3
+
4
+ app = Flask(__name__, template_folder='templates', static_folder='static', static_url_path='/')
5
+
6
+ with open('model/homedf.pkl', 'rb') as file:
7
+ homedf = pickle.load(file)
8
+ with open('model/Maindf.pkl', 'rb') as file:
9
+ Maindf = pickle.load(file)
10
+
11
+ @app.route('/')
12
+ def home():
13
+ return render_template("home.html",
14
+ title = list(homedf["title"].values),
15
+ image = list(homedf["thumbnail"].values),
16
+ short_description = list(homedf["short_description"].values),
17
+ game_url = list(homedf["game_url"].values),
18
+ genre = list(homedf["genre"].values),
19
+ platform = list(homedf["platform"].values),
20
+ publisher = list(homedf["publisher"].values),
21
+ developer = list(homedf["developer"].values),
22
+ release_date = list(homedf["release_date"].values),
23
+ freetogame_profile_url = list(homedf["freetogame_profile_url"].values),
24
+ )
25
+
26
+ @app.route('/genre')
27
+ def genre():
28
+ pass
29
+
30
+ if __name__ == "__main__":
31
+ app.run(host='0.0.0.0', debug=True)
dockerfile CHANGED
@@ -6,8 +6,12 @@ WORKDIR /Game-recommender
6
 
7
  # Copy necessary files into the container
8
  COPY requirements.txt requirements.txt
 
9
  COPY model model
10
- COPY Webapp Webapp
 
 
 
11
 
12
  # Install dependencies
13
  RUN pip install --no-cache-dir -r requirements.txt
@@ -16,4 +20,4 @@ RUN pip install --no-cache-dir -r requirements.txt
16
  EXPOSE 5000
17
 
18
  # Set the default command to run the Flask app
19
- CMD ["python", "Webapp/app.py"]
 
6
 
7
  # Copy necessary files into the container
8
  COPY requirements.txt requirements.txt
9
+ COPY app.py app.py
10
  COPY model model
11
+ COPY Dataset Dataset
12
+ COPY templates templates
13
+ COPY static static
14
+ COPY Utility Utility
15
 
16
  # Install dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
 
20
  EXPOSE 5000
21
 
22
  # Set the default command to run the Flask app
23
+ CMD ["python", "app.py"]
static/home.css ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ scroll-behavior: smooth;
3
+ }
4
+
5
+ body {
6
+ background-color: rgb(36, 41, 46);
7
+ margin: 0;
8
+ }
9
+
10
+ a:link {
11
+ color: white;
12
+ /* Unvisited link */
13
+ }
14
+
15
+ a:visited {
16
+ color: white;
17
+ /* Visited link */
18
+ }
19
+
20
+ a:hover {
21
+ color: white;
22
+ /* On mouse hover */
23
+ }
24
+
25
+ a:active {
26
+ color: white;
27
+ /* Active (clicked) link */
28
+ }
29
+
30
+ div.container1 {
31
+ padding: 20px 23px 0px 23px;
32
+ }
33
+
34
+ header.navBar {
35
+ display: flex;
36
+ justify-content: space-between;
37
+ }
38
+
39
+ a.logo {
40
+ font-size: 2.2em;
41
+ display: flex;
42
+ gap: 8px;
43
+ text-decoration: none;
44
+ align-items: center;
45
+ }
46
+
47
+ span.greyColor {
48
+ color: gray;
49
+ }
50
+
51
+ a span.logoName {
52
+ font-family: "Bonheur Royale", serif;
53
+ font-weight: 900;
54
+ font-size: 2.5rem;
55
+ font-style: normal;
56
+ color: #ffd000;
57
+ }
58
+
59
+ ul.menu {
60
+ display: flex;
61
+ gap: 20px;
62
+ list-style-type: none;
63
+ font-family: "Jaro", sans-serif;
64
+ font-optical-sizing: auto;
65
+ font-weight: 400;
66
+ font-style: normal;
67
+
68
+ }
69
+ .hed{
70
+ font-family: "Jaro", sans-serif;
71
+ font-optical-sizing: auto;
72
+ font-weight: 400;
73
+ font-style: normal;
74
+ margin: 70px 70px;
75
+ text-align: center;
76
+ font-size: 3rem;
77
+ }
78
+
79
+ ul.menu li a:hover {
80
+ color: #20ff00;
81
+ transform: translateY(-3px);
82
+ transition: all .3s ease 0s;
83
+
84
+ }
85
+
86
+ .decoration {
87
+ text-decoration: none;
88
+ }
89
+
90
+ div.container2 h3{
91
+ font-family: "Jaro", sans-serif;
92
+ font-optical-sizing: auto;
93
+ font-weight: 400;
94
+ }
95
+ div.container2 {
96
+ display: flex;
97
+ flex-direction: row;
98
+ margin: 70px 70px;
99
+ justify-content: center;
100
+ font-style: normal;
101
+ flex-wrap: wrap;
102
+ }
103
+
104
+ div.card {
105
+ width: 15vw;
106
+ margin: 5px 5px 5px 5px;
107
+ padding: 30px 30px 30px 30px;
108
+ border: 1px solid gray;
109
+ border-radius: 12px;
110
+ box-sizing: border-box;
111
+ height: 50vh;
112
+ }
113
+
114
+ div.card img {
115
+ width: 232px;
116
+ border-radius: 12px;
117
+ /* margin-left: 25px; */
118
+ height: 140px;
119
+ }
120
+
121
+ .long-text {
122
+ overflow-wrap: break-word; /* Wrap long words */
123
+ white-space: normal;
124
+ }
125
+ .dot{
126
+ overflow: hidden;
127
+ white-space: nowrap;
128
+ text-overflow: ellipsis;
129
+ }
130
+
131
+
132
+ .containerContactMe7{
133
+ display: flex;
134
+ /* justify-content:baseline ; */
135
+ margin: 60px 60px 60px 250px;
136
+
137
+
138
+ }
139
+ .name{
140
+ display: flex;
141
+ align-items: center;
142
+ }
143
+
144
+
145
+ i{
146
+ margin: 12px;
147
+ font-size: 40px;
148
+ }
149
+ .AboutMain{
150
+ font-family: "Jaro", sans-serif;
151
+ font-optical-sizing: auto;
152
+ font-weight: 400;
153
+ font-style: normal;
154
+ }
155
+ .rel{
156
+ font-size: .9rem;
157
+ }
158
+
159
+ div.btn{
160
+ display: flex;
161
+ gap: 20px;
162
+ margin-top: 30px;
163
+ }
164
+ .pad{
165
+ padding: 2px 12px 4px 12px;
166
+ border: none;
167
+ border-radius: 5px;
168
+ background-color: #4f0;
169
+
170
+ }
templates/home.html ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Bonheur+Royale&display=swap" rel="stylesheet">
10
+
11
+ <link href="https://fonts.googleapis.com/css2?family=Lacquer&display=swap" rel="stylesheet">
12
+
13
+ <link rel="preconnect" href="https://fonts.googleapis.com">
14
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
15
+ <link href="https://fonts.googleapis.com/css2?family=Jaro:opsz@6..72&display=swap" rel="stylesheet">
16
+ <link rel="stylesheet" href="{{ url_for('static', filename='MainStyle.css') }}">
17
+ <link rel="stylesheet" href="{{ url_for('static', filename='home.css') }}">
18
+ <title>Game_Recommender</title>
19
+ </head>
20
+
21
+ <body>
22
+ <div class="container1">
23
+ <header class="navBar">
24
+ <a href="/" class="logo">
25
+ <span class="greyColor">
26
+
27
+ <span class="logoName">Game_Recommender</span>
28
+
29
+
30
+ </a>
31
+ <ul class="menu">
32
+ <li><a href="{{ url_for('home') }}" class="decoration">Home</a></li>
33
+ <li><a href="" class="decoration">Blank</a></li>
34
+ <li><a href="#Contact" class="decoration">Contact me</a></li>
35
+ </ul>
36
+ </header>
37
+ </div>
38
+ <h1 class="hed">Some Top Free Games </h1>
39
+ <hr style="width: 70%;">
40
+ <div class="container2">
41
+
42
+ {% for i in range(title|length) %}
43
+ <div class="card">
44
+ <img src="{{ image[i] }}" alt="">
45
+ <h3 class="long-text" >{{ title[i] }}</h3>
46
+ <p class="dot , rel">Developer : {{ developer[i] }}</p>
47
+ <p class="long-text , rel">Genre : {{ genre[i] }}</p>
48
+ <p class="long-text ,rel">Platform : {{ platform[i] }}</p>
49
+ <p class="long-text , rel">Release date : {{ release_date[i] }}</p>
50
+ <div class="btn">
51
+ <button class="pad"><a href="{{ game_url[i] }}" target="_blank" style="text-decoration: none; color: rgb(91, 31, 148);">Game</a></button>
52
+ <button class="pad"><a href="{{ freetogame_profile_url[i] }}" target="_blank" style="text-decoration: none; color: rgb(91, 31, 148)">Profile</a></button>
53
+ </div>
54
+ </div>
55
+ {% endfor %}
56
+
57
+
58
+
59
+ </div>
60
+ <div class="containerContactMe7">
61
+ <div class="greetDivision">
62
+ <div class="left">
63
+ <div class="name">
64
+ <h1 style="font-size: 3rem;" id="Contact">Contact Me</h1>
65
+ <img alt="☎️" draggable="false" src="https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/260e.png" style="height: 4em; width: 4em; margin: 0px 0.05em 0px 3.1em; vertical-align: -0.1em;">
66
+ </div>
67
+ <h3 class="AboutMain">Discuss a project or just want to say hi? My Inbox is open for all.</h3>
68
+ <h1 style="font-size: 2rem;">Ayushaiml14@gmail.com</h1>
69
+ <div class="ContactsContainer1">
70
+ <a href="https://github.com/AyushAI14" target="_blank"><i
71
+ class="fa-brands fa-square-github"></i></a>
72
+ <a href="https://www.linkedin.com/in/ayush-vishwakarma-a2450a28b/" target="_blank"><i
73
+ class="fa-brands fa-linkedin"></i></a>
74
+ <a href="mailto:ayushaiml14@gmail.com" target="_blank"><i class="fa-solid fa-envelope"></i></a>
75
+ </div>
76
+ </div>
77
+
78
+ </div>
79
+ <script src="https://kit.fontawesome.com/73c3b1fe1f.js" crossorigin="anonymous"></script>
80
+
81
+ </body>
82
+
83
+ </html>