Giter VIP home page Giter VIP logo

topsite's Introduction

Topsite Application

Build Status MaintainabilityTest CoverageDiscord

There are many different topsite applications out there, but none that are open source that have a range of features, we aim to address this, so whether it's a PBBG topsite, Minecraft topsite or any other topsite we aim to be to go solution

Getting Started

First step is the clone the repo

git clone [email protected]:pbbg/topsite.git

Copying and editing the .env is next, user accounts require verification so SMTP is also needed, we recommend MailGun.

cp .env.example .env

Edit the DB_* details, MAIL_* settings

Next run the following

composer install
php artisan key:generate
php artisan migrate:fresh --seed
yarn
yarn prod (or yarn watch for development)

--seed on migrate is optional if you want to have sample data

Prerequisites

What things you need to install the software and how to install them

PHP 7.3
MySQL/MariaDB
Yarn or NPM

Running the tests

We use PHPUnit for tests

./vendor/bin/phpunit

Built With

  • Laravel - The web framework used
  • SB Admin 2 - Front end template for the administration panel

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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

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.

Category Seeder

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

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

SEO

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

Integration Tests

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

Contact

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

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.

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

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

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

PHPUnit Tests

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

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.

Categories error

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

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.

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.

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

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

Premium Option

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

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

Discord Integration

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

Snippit for voting

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

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

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

Naming conventions

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

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

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)

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.

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

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.

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.