forked from lj4028aim/TCSS506_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
37 lines (21 loc) · 4.03 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Welcome to WeatherTunes, a web app to suggested music based your current weather. Reading this text file can help developer to gain a better understanding of the structure for the project.
# python files
app.py is served as a Flask application that displays the weather forecast for a given location and provides a music playlist.
forms.py file defines FlaskForm classes for user login, search, and registration with corresponding fields and validators.
models.py file defines a User model with email and password attributes, as well as methods for setting and checking passwords using password hashing. It also includes a user loader function for Flask-Login integration.
openWeather.py file provides functions to retrieve weather forecast and current weather data for a given city, state, and country using the OpenWeatherMap API.
music.py uses the Spotipy library to retrieve playlist data from Spotify. It initializes the Spotify client using the client ID and client secret, and then fetches the playlist data for a given playlist ID.
citylist_db.py script creates a SQLite database and inserts data from a gzipped JSON file retrieved from OpenWeatherMap, containing information about cities such as their ID, name, state, country, longitude, and latitude.
citilist.db is the database generated by running citylist_db.py.
login.db is used to store user's information namely id, email, and hased password.
# html files
base.html file is an HTML template that serves as the foundation for other web pages in a project, providing a consistent layout and styling across the application. It includes a navigation bar with links, a main content area, and a footer with social media links, utilizing Bootstrap CSS and custom styles.
home.html file is an HTML template that extends the base.html template and displays the current weather, a 5-day weather forecast, a featured daily song, and a recommended playlist based on the weather conditions. It uses Bootstrap classes for styling and dynamic data rendering using template variables.
landing.html file is an HTML template that displays a landing page for the Weather Music App, featuring a background image, a navbar with the app name, a headline, a brief description, and options to login or register. It also includes the project credits in the footer section. The styling is done using Bootstrap classes and custom CSS.
login.html file is an HTML template that provides a login page for the Weather Music App, featuring a form with fields for email and password, a sign-in button, and a logo. The styling is done using Bootstrap classes and custom CSS, and it includes the necessary meta tags and dependencies.
register.html file is an HTML template that provides a registration form for the Weather Music App, featuring fields for email and password, as well as buttons to submit the form and reset the input fields. The template utilizes Bootstrap CSS for styling and includes the necessary dependencies.
playlist.html file is an HTML template that displays a playlist of songs for the Weather Music App. It includes a table with columns for image, song, artists, album, popularity, duration, and release date. The template utilizes Bootstrap CSS for styling and includes a button to navigate back to the main WeatherTunes page. The song data is dynamically populated using a loop and the Jinja templating engine.
# .gitignore file
.gitignore file specifies which files and directories should be ignored by Git, such as operating system-generated files, editor-specific files, build artifacts, virtual environment directories, package dependencies, log files, sensitive or environment-specific files, user-specific files, and various file types related to specific programming languages and technologies like Python, Docker, JavaScript, and CSS.
# algorithm to retrieve music dynamically
The way how this algorithm works is based on current weather temperature and getting the product until the result is equal or less than 50 then use the result as an index to retrieve the song from the list. The algorithm works for both two and three digits number.