Skip to content

masbro1234/Final-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚽ SoccerStat: Premier League Stats Web App

By Chris Gravagna and Mason Brown


🎯 Big Idea & Project Goals

SoccerStat is a simple, clean web application that lets users search for Premier League teams or players and instantly view their statistics for a specific season.

As lifelong soccer fans, we wanted to create something that felt natural and useful β€” a site where anyone could look up a favorite player or club and quickly see performance stats in a no-frills, beginner-friendly way. Some people have a hard time finding exactly how a team or player did during a specific season, so we tried to be the answer to that.


πŸ‘¨β€πŸ’» User Instructions

  1. Visit the homepage (screenshot below).
  2. Enter either a player name or team name.
  3. Choose the search type from the dropdown (player or team).
  4. Enter a season year (e.g., 2023) β€” recent years work best.
  5. Click Search to view results!

🟑 Note: The app uses the free tier of the API-Football service, which only supports recent seasons (usually 2022–2023). Older years may return no results.


βš™οΈ How It Works (Implementation Overview)

  • Framework: Python with Flask
  • Data Source: API-Football ([https://api-football.com])
  • Team Stats Shown: Wins, Draws, Losses, Goals For, Goals Against + Team Logo
  • Player Stats Shown: Goals, Assists, Team Name + Player Photo

Technical Flow:

  • The Flask backend takes in user form data (query, search_type, and season).
  • Based on the search type, it queries different endpoints from API-Football.
  • The JSON response is parsed and passed into a Jinja2 HTML template.
  • The results page renders stats and logos/photos dynamically based on the response.

πŸ–Ό Visual Results

πŸ”Ž Homepage

The user enters the player or team name, selects the type and season, then clicks search.

Home Page


🏟 Team Results (Manchester City, 2023)

Displays match record and stats, with a clean layout and team logo.

Team Result


πŸ‘€ Player Results (Erling Haaland, 2023)

Shows goals, assists, and club info, plus an official player photo.

Player Result


πŸ“Œ Known Limitations

  • ❗ Season Access Limit: Only recent Premier League seasons (2022, 2023) are available on the free API plan.
  • πŸ“‰ No Stats = No Results: If a player didn’t play that year or isn’t spelled exactly right, the API won’t return data.
  • 🌐 Local Only: Currently hosted at http://127.0.0.1:5000/ β€” for public access we ended up learning a lot about how to properly install ngrok and get a url that anyway can access publicly. The current url that now works is - https://701d-155-48-126-73.ngrok-free.app/

πŸ’­ Final Reflection & Takeaways

This was more than just a coding assignment β€” it was the first time we fully built and styled a simple web app from scratch. Something that was awesome to learn was how to create a public url from a local url using ngrok. Chatgpt definetely helped us form an outline on what to do and ultiamtely solve problems that we encountered.

Most importantly, we walked away with:

  • Confidence using Flask and APIs in real-world settings
  • A better understanding of what specific errors mean like when we tried to run the results a few times we got this error called "jinga" and with the help of chatgpt it allowed us to find the problem, simply i had "results.html" rather than "result.html." This is a key takeaway from this project because it goes to show how such little errors can cause so many problems.
  • A working, shareable project that shows our growth

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published