Giter Site home page Giter Site logo

euanwm / openweightlifting Goto Github PK

View Code? Open in Web Editor NEW
31.0 4.0 21.0 33.09 MB

Repository that is deployed for the OpenWeightlifting site

Home Page: https://www.openweightlifting.org

License: BSD 3-Clause "New" or "Revised" License

Python 26.62% JavaScript 1.25% CSS 0.03% Dockerfile 0.30% Go 44.18% TypeScript 27.13% Makefile 0.49%
sports-analytics statistics weightlifting gin-gonic golang nextjs react docker heroku python

openweightlifting's Introduction

Hi, I'm Euan and this is some of my projects

Here lies my portfolio of unfinished projects (aren't they all?). I spend a significant chunk of my spare time working on contributions towards opensource across various languages. I have zero flair for frontend development so most of my work is aimed at backend/devops. Typically, I write in Python and Golang with the occasional toe-dip into TypeScript.

When i'm feeling like a masochist, i'll try and write something in Rust or Zig.

Contribution Statistics

openweightlifting's People

Contributors

5hr1ganesh avatar adeyomola avatar danwhitford avatar dependabot[bot] avatar euanwm avatar jodwd avatar joeysantia avatar louisbrunner avatar mountclear avatar rsbrowne avatar sjdoescoding avatar sstangl avatar veerhan-glitch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openweightlifting's Issues

Docker Build Fails - Backend

Describe the bug
Backend build fails due to collate.go file.

To Reproduce
Steps to reproduce the behavior:
Launch docker-compose.yml

Expected behavior
#10 5.696 dbtools/collate.go:4:2: package backend/database_root is not in GOROOT (/usr/local/go/src/backend/database_root) executor failed running [/bin/sh -c go build -o backend serverMain.go]: exit code: 1 ERROR: Service 'backend' failed to build : Build failed docker-compose process finished with exit code 1

Screenshot
Screenshot 2022-11-02 at 21 46 28

README Update - Frontend

Is your feature request related to a problem? Please describe.
Current README in the frontend folder is quite basic and could be developed further.

Describe the solution you'd like
A more descriptive breakdown of the frontend section of the repository.

Python Tools Refactor

Current folder and package structure requires a refactor.

  1. Remove unused code
  2. Restructure code structure / layout
  3. Add tests

Proposed Structure
The database_handler package has large amounts of code that are unused and can be removed entirely. The main elements required are those that are related to the check_db.py and backend_cli.py scripts.

web_scrapers.py & norway.py
These can be broken down into individual modules / files so that as we add more scrapers, it is easier to manage.

Lifter Search Feature

Is your feature request related to a problem? Please describe.
Currently, there is no way to lookup a lifter by name. Instead you have to scroll through rankings and play around with filters until you find them.

Describe the solution you'd like
A dynamic search box which updates with results following an input of 3 or more characters. There is a search function endpoint already available through the below URL.

https://api.openweightlifting.org/search?name=Euan

When a name is selected from the dynamic search box, users should be redirected to the lifter history page.

https://www.openweightlifting.org/lifter?name=Euan%20Meston

Add Instagram Logo / Link

Is your feature request related to a problem? Please describe.
We've been posting regularly on our Instagram page and there's no 2-way link between the Instagram and main page.

Describe the solution you'd like
Add an Instagram logo to the main toolbar with hyperlink to opening instagram.

Update frontend nextJS to 13.4.7

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

TS and api refactor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Benchmarking - Gin vs Echo

Is your feature request related to a problem? Please describe.
Current backend deployment occasionally exceeds memory quota on restart, an easy solution may be to switch from Gin-Gonic to Echo frameworks.

Describe the solution you'd like
Benchmarking to gauge the difference between frameworks on startup, during normal API requests, and during no-operation / waiting.

Describe alternatives you've considered
An alternative would be to refactor the build database function to improve memory utilisation.

Additional context
Screenshot from Heroku.
image

TS and api refactor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Filter by Sinclair

Add in sinclair column along with the option to switch to a sinclair descending view.

Will require backend and frontend changes.

Add in IWF data

An API library that was created by @jwc20 is close to what we're looking for in order to collate information from competitions hosted and organised by IWF.

Once the forked API is in a suitable working state then we'll pull it into this repo.

Current fork: https://github.com/euanwm/iwf-api

SWR

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

README Update - Backend

Is your feature request related to a problem? Please describe.
Backend folder containing the Golang built API server does not have a README file.

Describe the solution you'd like
An initial README file that explains roughly what API server currently does.

Describe alternatives you've considered
N/A

Additional context
Improvement suggestions can also be raised during this time.

Add Discord Chat Link

Is your feature request related to a problem? Please describe.
Low engagement from contributors.

Describe the solution you'd like
A Discord logo / hyperlink added next to the GitHub logo on the main page.

Describe alternatives you've considered
N/A

Additional context
Link URL: https://discord.gg/kqnBqdktgr

Docker Deployment

Is your feature request related to a problem? Please describe.
Current Docker images are outdated and no longer work.

Describe the solution you'd like
Create a single docker image for deployment as this will allow minimal changes should we move from Heroku in the future

Describe alternatives you've considered
N/A

Additional context
N/A

Code Roast - All Things Golang

That's right, if you are an EXPERIENCED developer I want you to go through the backend folder (excluding database_root) and tear it to pieces.

All roasts must be constructive and suggestive towards a different way of structuring / writing the code. For example, if a method breaches the DRY methodology then write a todo comment within the method itself.

Backend - Local Testing

Is your feature request related to a problem? Please describe.
When testing locally, there is persisten CORS errors and as a result makes testing difficult.

Describe the solution you'd like
When running the serverMain.go file, create a parameter flag to allow for local testing.

Describe alternatives you've considered
N/A

Additional context
N/A

Memory Usage on Deployment - Backend

Describe the bug
Currently, on deployment we exceed the memory allocation for the platform (512mb) because i'm a cheap cunt and i'd rather keep paying £7 vs. £25.

To Reproduce
Simply run the serverMain.go file and take a look at the memory usage.

Expected behavior
Memory limit to remain under 512mb

Screenshots
Screenshot 2022-10-15 at 22 50 01

Additional context
Previously the memory usage was far worse and it was due to the conversion between csv file -> struct slice. May be easier to convert csv files to structs one by one rather than by a massive batch.

Python Tools Refactor

Is your feature request related to a problem? Please describe.
While it isn't a problem, the current python tools used to update the database_root folder are very hacky / messy.

Describe the solution you'd like
Pick a file, refactor it, make it pretty.

Describe alternatives you've considered
N/A

Additional context
N/A

Improve DevOps

Currently, there's no overview on linting, pre-merge checks, or anything else that improves the codebase in general.

Update FE CI

Of the back off adding tests, we should be running test tests as well as some code quality checks on the FE project in the CI

Filter by Federation

Is your feature request related to a problem? Please describe.
IWF recorded lifts currently dominate the leaderboard and doesn't show national level lifters.

Describe the solution you'd like
A filter option for certain federations / countries.

Describe alternatives you've considered
N/A

Additional context
N/A

Add FE tests

There are no tests, there should be tests, let's do some tests

Local React Server - HTTPS Mode

Is your feature request related to a problem? Please describe.
When local testing, the react server does not start in secure mode which impacts on HotJar and API testing.

Describe the solution you'd like
When "npm run dev" is called within the frontend directory, the localhost server is booted into secure mode and available through https://localhost:3000

Describe alternatives you've considered
N/A

Additional context
N/A

Improve landing page

OK, so React isn't as simple as I hoped it would be.

Landing page needs to show the top 100 men by total (default API call), along with continual loading, and the option to switch genders.

CORS Error

CORS error is raised when attempting to switch between genders on the landing page. It was handled when the API server was running Flask but simply forgot to action the todo within /backend/backend_main.py

This was expected and will be resolved soon.

Horizontal Filter Bar

Is your feature request related to a problem? Please describe.
Filters appear vertically stacked and it results in a poor site layout

Describe the solution you'd like
Current, and future filters to be horizontally aligned.

Describe alternatives you've considered
N/A

Additional context
N/A

Code Roast - All Things React

That's right, if you are an EXPERIENCED developer I want you to go through the frontend folder and tear it to pieces.

All roasts must be constructive and suggestive towards a different way of structuring / writing the code. For example, if a method breaches the DRY methodology then write a todo comment within the method itself.

Create OWL Logo

Currently, the default React logo is the placeholder for the website and i'm terrible at anything relating to UI work.

Design a logo, implement it in the frontend, raise PR. ????

Ignore line character

Is your feature request related to a problem? Please describe.
When building the database on deployment, results with inputting errors are also parsed. These have to be either manually removed or updated. Both of which affect the integrity of the data.

Describe the solution you'd like
When loading individual CSV files to memory, any line starting with a special character is ignored.

Describe alternatives you've considered
N/A

Additional context
All the relevant code is contained with the collate.go file.

Drop down menu hard to read in dark mode

Describe the bug
The drop down menus in dark mode have a white background and light grey font making it hard to read.
To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.openweightlifting.org/
  2. Tilt the theme rocker switch to dark mode (moon symbol)
  3. Expand Federation drop down menu
  4. Try reading names

Expected behavior
The background of the drop down menu should follow the theme's background color

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu 22
  • Browser Chrome
  • Version 104.0.5112.79 (Official Build) (64-bit)

Benchmarking - Bun vs. Node

Would be interesting to trial Bun as a drop-in replacement on the frontend side of things to see if it improves response / loading times for the frontend.

Excessive Rendering / Poor Performance

Describe the bug
Overall, site performance is poor and seems to stem from repeated re-rendering of the page. Insert a console.log() call into the Home component and it appears to be called 4 times. A few other components were checked and it does seem like the site is rendered repeatedly around 3-4 times per component.

To Reproduce
Steps to reproduce the behavior:

  1. Insert a console.log() call in the Home function/component
  2. Load the page
  3. Check browser console in developer tools

Expected behavior
Page should load blazingly fast...pls.

Screenshots
Screenshot 2023-04-10 at 21 58 50

Add Storybook to support the new components to ease current dev

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Create Atoms, Molecules, and Organisms components

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Leaderboard - Lifter Select

Is your feature request related to a problem? Please describe.
Selecting a lifter also does hee-haw.

Describe the solution you'd like
When a lifter is selected, either the row expands or a popup appears. This will show the full lift information.

Describe alternatives you've considered
N/A

Additional context
N/A

README Update - Main

Is your feature request related to a problem? Please describe.
Main overall README is outdated and requires updating.

Describe the solution you'd like
An updated readme, preferably in conjunction with updated Docker images to allow local testing to be simplified.

Describe alternatives you've considered
N/A

Additional context
See #71 for Docker image context

Remove BritChamp Cutoff Filter

Is your feature request related to a problem? Please describe.
The BritChamp Cutoff filter is now redundant and can be deprecated from the codebase.

Describe the solution you'd like
Remove the BritChamp cutoff filter from the frontend and backend codebase.

Migrate to FastAPI (short-term)

Flask is a bit cumbersome at the moment and a significant amount of research shows it's a bit overkill as we're only using it as an API server.

FastAPI is more suited to what we're looking for until a larger migration to Go (Gin-Gonic).

Upgrade NextUI to V2

Is your feature request related to a problem? Please describe.
NextUI has went through a major breaking change which is the main UI framework for the site.

Describe the solution you'd like
A major refactor is needed which should give opportunity to drop a lot of the old dependencies and messy code.

Backend - Lifter Name Suggest

Is your feature request related to a problem? Please describe.
There is not backend feature for giving lifter name suggestions.

Describe the solution you'd like
An endpoint that returns a JSON list of names based upon the current GET query.

Describe alternatives you've considered
N/A

Additional context
This will be part of the lifter lookup function in future.

Convert FE to Typescript project

Working in JS without Types is a pain these days. For a better dev experience and making everything less prone to errors I suggest we convert this to a Typescript project

Implement analytics

Add in a basic visitor count/tracking feature so we can begin to get an idea on traffic as the site matures.

Make FE styling approach consistent

Currently the front end is using MUI, NextUI, styles objects in the JSX, and CSS components. This needs to be made more consistent to stop confusion and duplicated effort

Increased Pagination

Currently, the site only caters for 10 pages of data which is 500 results. Frontend needs added functionality to load further results.

Site flashes white when loading

Describe the bug
Site loaded with white colour scheme and then quickly changes to dark, this looks a bit rubbish

To Reproduce
Steps to reproduce the behavior:

  1. Reload the page

Expected behavior
Site should load with the preferred theme settings from user's OS

Additional context
I suspect this is to do with the theming context that's being applied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.