Coder Social home page Coder Social logo

1e4 / topsite Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 1.6 MB

Open source topsite / toplist application written in Laravel

Home Page: https://top-pbbg.com

License: MIT License

PHP 62.15% Vue 0.20% HTML 37.65%
laravel toplist application pbbg php

topsite's Introduction

Hi there ๐Ÿ‘‹

Ian's github stats

topsite's People

Contributors

1e4 avatar calebanthony avatar dependabot[bot] avatar wavehack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

topsite's Issues

Leave page

When exiting from a vote (Going out) there should be a "holding" page that redirects them. This should contain ad slots and info about the game with a redirect in 10 seconds or click here.

Analytics / Admin Section

Currently there is no settings section on the admin panel. This is required for a few things.

  • Google Analytics
  • Open/Close registrations
  • Google ReCaptcha

SEO

SEO and meta tags need to be configurable via the admin panel, currently none exist

Home Page

The homepage should list;

  • The top 100 games overall ordered by votes in
  • Categories on the left hand side

Each game that is listed should present the following information

  • Game Name
  • Link to the game
  • Banner if applicable
  • Amount of votes in and traffic out

Rate listings & comment

Allow rating of listings out of 5 stars, maybe even expand it into sections sort of how JustEat deals with feedback on food.

/5 Gameplay - How the game plays and mechanics, higher star is better
/5 Story - Higher star is better if the game has a story
/5 P2W - How P2W works, higher star = less p2w

Also allow comments along with a rating

Contact

A simple contact form allowing administrators to receive feedback/complaints etc

Premium Option

Allow payments through Stripe & Paypal to give your game a premium listing

Delete Category bug

When deleting a category it fails if there are games in this category.

Possible solution, set category to nullable and have a uncategorized section on the menu, move all games in that category to null then delete the category.

Contact Page

Basic contact page with adminisrative email / contact form. Also implement contact form in the admin side, which when replying to, allows you to send an email to that person.

Incentives

Incentives to vote, basically a callback URL that posts back to the designated URL based on the game with any parameters the user has sent across in the first place

PHPUnit Tests

  • Add way more phpunit tests to test things
  • Setup CodeClimate test coverage

Social media on listings

Allow adding social media to listings such as Facebook and Twitter, also allow the user to verify that they own the account

Administration Panel

The admin panel should be simple and easy to navigate

Probably just use SBAdmin (https://startbootstrap.com/themes/sb-admin-2/)

HomePage

  • Widgets
  • Total Games
  • Total Users
  • Votes In
  • Votes Out
  • Graph of games added over time (30 days)
  • Any games needing a review

Categories

  • Create Categories
  • Update Categories
  • Delete Categories
  • Read Categories

Manage games

  • Edit Games
  • Easily Approve Games
  • View game info
  • Votes in/out
  • Screenshots

Manage users

  • View User Profile
  • Edit User
  • Create User
  • View users and games associatedwith them
  • Ban user, consequently also bans all games
  • Promote to administrator
  • Userlevels should be simple, either admin or not

Discord Integration

Allow Discord webhooks for when a new listing is posted/approved, when a new comment/rating is given.

Refactor duplicated code to service architecture

This is more for the strategy to refactor some duplicated code out into their own classes. This will make the codebase more testable, easier to reason about, and a lot cleaner.

There are several pieces around the codebase where code is copy-pasted, sometimes identically and sometimes with very minor differences.

For example, building out the category array:

$categories = [];
$categories["none__"] = "-- Select Category --";
$categories = array_merge($categories, Category::all()->pluck('name', 'slug')->toArray());

My suggestion is to refactor this out into a service class architecture. I'd also be happy to tackle this if it's the direction the team wants to go.

What this would look like is:

  1. Creating an app/Services folder to house our services.
  2. Build out classes that are focused on a specific feature, perhaps a CategoryService.php.
  3. In the controller methods where the abstracted code was used, use Laravel's service container to inject the service class:
public function edit(Game $game, CategoryService $categoryService): View
{
    $categories = $categoryService->buildArray();
    ....
}

Then we write a unit test for the CategoryService methods, making sure the outputs are what we expect.

Daily votes

There is a bug in which it won't let you vote each day, but rather once a month. This is a pretty critical oversight.

Categories error

When adding categories, if they are not sequential id's the select box will fail

Category Seeder

The category seeder is currently directly in DatabaseSeeder and should be separated out into CategorySeeder

Can't upload an avatar

Every time I try to "Select new photo" on the user settings page, it just throws a 404 in the console(1) and sets my avatar to "not found"(2).

[1]:
404 error

[2]:
not found

Fix tests

Tests are currently broken and need fixing.

  • The app still works

News integration

If selected the game can give an RSS feed to post into the stream on the listings page.

Edit Game

Once you have added a game, you may add extra details to it that are optional.

Screenshots

  • Up to 5 screenshots can be posted

Incentive URL
This will post back to the specific URL including whatever arguments were sent to the vote script so that games can verify the user voted

Integration Tests

Setup dusk for integration tests and start work on a test suite for it

Add Game

After logging in and being verified you should be able to add games, as some owners run multiple games, it makes sense to have 1 account that allows multiple games under it.

When adding a game the following fields are required

  • Game ID - which should be a UUID
  • URL
  • Name
  • Description
  • Category
  • Banner URL(468pxx60px)

Naming conventions

Some controllers and naming is odd, such as ListingController. Should rename and generalise to listings, or to games.

Listing page

There needs to be a listing page

  • display game name
  • description
  • display URL
  • votes in (Currently uses test data)
  • votes out (Currently uses test data)
  • line graph of votes over time

Voting in and out

2 things need doing for this

  • A page that users come into to vote
  • Count outgoing hits and have a cron calculate every 5 minutes the total outgoings

Registration

Registration requires the following fields;

  • Email
  • Password

An email should be sent to activate the account, once activated they can login and add their game, this is different to other top sites where they require a bunch of info in advance, we want the process to be easy

User Control Panel

Edit Account
Here you can alter your password and email.

An email should be sent if the info is changed to let the account owner know.

Snippit for voting

When going onto manage your games, there should be a snippit you can place on your own site to vote with

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.