Skip to content

krasimir-paunov/TheBigThree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

159 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CI

๐ŸŽฎ The Big Three

What are the three games that define you as a gamer?

๐Ÿ“‹ For Evaluators: Admin credentials, database setup, and RAWG API demo key are provided in the Setup & Running Locally section below.

The Big Three is a community-driven ASP.NET Core web application where gamers curate and share their ultimate three-game collections โ€” the games that shaped them, defined them, or simply brought them the most joy. Discover what others have chosen, give stars to collections you love, and leave your mark on the community.

ASP.NET Core EF Core SQL Server Bootstrap NUnit


๐Ÿ“ธ Screenshots

Community Hub Collection Details
Hub Details
Player Profile Game Info Modal
Profile Modal
Stats Page Admin Panel
Stats Admin

๐ŸŽฌ Demo Video

Watch the Demo

A full walkthrough of The Big Three โ€” features, RAWG API integration, Admin panel, and more.


โœจ Features

๐Ÿ  Community Hub

  • Browse all curated collections in a beautiful card-based layout
  • Search by collection title or curator name
  • Filter by game genre
  • Sort by newest or most starred
  • Pagination for easy browsing

๐Ÿ“š Collections

  • Every registered user can create exactly one "Big Three" collection โ€” their three defining games
  • Each game slot includes a title, cover image, genre, and personal description
  • Full edit and delete functionality for your own collection
  • Star/unstar collections from other curators

๐ŸŽฎ RAWG API Integration

  • Autocomplete โ€” start typing a game title in the Add/Edit form and get live suggestions from the RAWG database, complete with cover thumbnails, release year, and rating
  • Game Details Modal โ€” click any game cover on a collection page to open a cinematic modal showing Metacritic score, release date, developer, platforms, genres, and a full screenshot gallery
  • Screenshot Lightbox โ€” click any screenshot to view it full size with prev/next navigation
  • Graceful degradation โ€” the app works fully without an API key; RAWG features are silently hidden

๐Ÿ‘ค User Profiles

  • Public profile pages for every user โ€” viewable by anyone
  • Private dashboard showing your own collection, starred collections, rank, and stats
  • Custom avatar via URL
  • Collector Rank system based on stars earned

๐Ÿ† Rank System

Stars Earned Rank
100+ ๐Ÿฅ‡ Legendary Collector
30+ ๐ŸŒŸ Superstar Collector
10+ ๐Ÿ”ฅ Popular Collector
5+ โฌ†๏ธ Rising Star
1+ ๐ŸŒฑ Novice Collector
0 ๐Ÿ‘‹ Newcomer

๐Ÿ“Š Stats & Leaderboard

  • Community-wide statistics: total collections, members, stars, comments
  • Top 3 collections podium
  • Most popular genres bar chart
  • Top 10 collectors and commenters leaderboard

๐Ÿ’ฌ Comments

  • Leave comments on any collection
  • Delete your own comments
  • Admins can moderate all comments

๐Ÿ›ก๏ธ Admin Panel

  • Full user management: view, search, delete users
  • Promote users to Administrator or demote them back to User
  • Collection management: view and delete any collection
  • Admin dashboard with community overview

๐Ÿ—๏ธ Architecture

The project follows a clean N-Tier architecture split across 7 projects:

TheBigThree/                        โ† ASP.NET Core Web (MVC)
โ”œโ”€โ”€ TheBigThree.Data/               โ† DbContext, Migrations, Repository
โ”œโ”€โ”€ TheBigThree.Data.Models/        โ† Entity classes
โ”œโ”€โ”€ TheBigThree.GCommon/            โ† Shared helpers (RankHelper)
โ”œโ”€โ”€ TheBigThree.Services/           โ† Service implementations
โ”œโ”€โ”€ TheBigThree.Services.Core/      โ† Service interfaces, IRepository<T>
โ”œโ”€โ”€ TheBigThree.Web.ViewModels/     โ† ViewModels for all views
โ””โ”€โ”€ TheBigThree.Tests/              โ† NUnit unit tests

Layers

Layer Project Responsibility
Presentation TheBigThree Controllers, Views, Areas, wwwroot
Application TheBigThree.Services Business logic, service implementations
Contracts TheBigThree.Services.Core Interfaces, Repository abstraction
Data TheBigThree.Data EF Core DbContext, migrations, generic repository
Domain TheBigThree.Data.Models Entity classes (Collection, Game, Genre, Like, Comment, ApplicationUser)
Shared TheBigThree.GCommon Cross-cutting helpers (RankHelper)
ViewModels TheBigThree.Web.ViewModels Data transfer objects for views

Generic Repository Pattern

All data access goes through IRepository<T>:

public interface IRepository<T>
{
    Task<T?> GetByIdAsync(int id);
    Task<IEnumerable<T>> GetAllAsync();
    Task AddAsync(T entity);
    Task UpdateAsync(T entity);
    Task DeleteAsync(int id);
    Task SaveChangesAsync();
    IQueryable<T> All();
}

๐Ÿ—„๏ธ Entity Models

ApplicationUser  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โ”‚ Id, UserName, Email, AvatarUrl, CreatedOn            โ”‚
    โ”‚                                                       โ”‚
    โ”œโ”€โ”€< Collection >โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
    โ”‚       Id, Title, TotalStars, CreatedOn, UserId        โ”‚
    โ”‚             โ”‚                                         โ”‚
    โ”‚             โ”œโ”€โ”€< Game >โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
    โ”‚             โ”‚       Id, Title, ImageUrl,              โ”‚
    โ”‚             โ”‚       Description, GenreId              โ”‚
    โ”‚             โ”‚             โ”‚                           โ”‚
    โ”‚             โ”‚             โ””โ”€โ”€< Genre >                โ”‚
    โ”‚             โ”‚                   Id, Name              โ”‚
    โ”‚             โ”‚                                         โ”‚
    โ”‚             โ””โ”€โ”€< Comment >โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚
    โ”‚                     Id, Content, CreatedOn,           โ”‚
    โ”‚                     UserId, CollectionId              โ”‚
    โ”‚                                                       โ”‚
    โ””โ”€โ”€< Like >โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”˜
            UserId (PK), CollectionId (PK)
            [Many-to-Many junction table]

๐Ÿ”ง Services

Service Responsibilities
CollectionService CRUD for collections, search, filter, pagination, star system
CommentService Add and delete comments with authorization checks
LikeService Star/unstar collections, fetch starred collections
ProfileService User profile data, own collection preview, public profiles
StatsService Community statistics, top collections, leaderboard data
AdminService User and collection management, promote/demote roles
RawgService RAWG API integration โ€” game search and detail fetching

โœ… Validation

Server-Side

  • All form inputs validated with Data Annotations
  • [Required], [StringLength], [RegularExpression] on ViewModels
  • Custom business logic validation in services (e.g., one collection per user)
  • Authorization checks in service layer (not just controller)
  • AntiForgeryToken on all POST forms

Client-Side

  • jQuery Unobtrusive Validation on all forms
  • Inline error messages per field

Database Level

  • Required fields enforced at schema level
  • Foreign key constraints
  • Composite primary key on Likes (UserId + CollectionId)

๐ŸŒฑ Seeded Data

The application seeds the following on first run:

  • 2 roles: User, Administrator
  • 7 users including 1 admin (CommanderShepard)
  • 19 genres (Action, RPG, Horror, Strategy, etc.)
  • 7 collections with 3 games each, complete with cover images

Admin credentials for testing:

Username: CommanderShepard
Email:    shepard@normandy.com
Password: Spectre123!

๐Ÿ” Security

Threat Mitigation
SQL Injection EF Core parameterized queries โ€” no raw SQL
XSS Razor auto-encodes all output; HTML tags escaped
CSRF [AutoValidateAntiforgeryToken] globally applied
Unauthorized access [Authorize] on all controllers; service-layer ownership checks
Account lockout 3 failed attempts triggers 5-minute lockout
Secure cookies HttpOnly, SecurePolicy.Always, SameSite.Strict
Parameter tampering Ownership verified server-side before any mutation

๐ŸŽฎ RAWG API Setup

The Big Three integrates with the RAWG Video Games Database API to power:

  • Game autocomplete when adding/editing a collection
  • Game details modal with Metacritic scores, platforms, developers, and screenshots

Getting Your API Key

  1. Create a free account at rawg.io
  2. Go to rawg.io/apidocs and register your app
  3. Copy your API key

Configuring the Key (User Secrets โ€” Recommended)

The API key is stored using ASP.NET User Secrets and is never committed to the repository.

From the project root (where TheBigThree.csproj lives):

dotnet user-secrets set "RawgApi:ApiKey" "YOUR_API_KEY_HERE" --project TheBigThree.csproj

Note: Without an API key, the application works fully โ€” RAWG features (autocomplete and game details modal) are silently disabled. No errors will occur.


๐Ÿš€ Setup & Running Locally

Prerequisites

Steps

  1. Clone the repository
git clone https://github.com/krasimir-paunov/TheBigThree.git
cd TheBigThree
  1. Open in Visual Studio

    • Open TheBigThree.sln
  2. Configure the database connection string

    Open appsettings.json and update the connection string to match your local SQL Server instance:

    {
      "ConnectionStrings": {
        "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=TheBigThreeDb;Trusted_Connection=True;MultipleActiveResultSets=true"
      }
    }

    Note: If you are using a named SQL Server instance instead of LocalDB, replace (localdb)\\mssqllocaldb with your server name, for example Server=.\\SQLEXPRESS or Server=YOUR_PC_NAME\\SQLEXPRESS.

  3. Apply migrations and seed the database

    • In Package Manager Console, set Default Project to TheBigThree.Data
    • Run:
Update-Database
  1. (Optional) Configure RAWG API

    A demo key has been provided for evaluation purposes:

   dotnet user-secrets set "RawgApi:ApiKey" "1114097eb59340f19cf02a957f4bd3e8" --project TheBigThree.csproj

Run this command in the Developer PowerShell terminal inside Visual Studio (View โ†’ Terminal), from the solution root folder.

Important: After setting the key, fully restart the application (Stop + F5) for the changes to take effect.

This demo key was created specifically for academic project evaluation. For your own key, register a free account at rawg.io.

  1. Run the application

    • Press F5 or Ctrl+F5 in Visual Studio
    • Navigate to https://localhost:{port}
  2. Login with the seeded admin account

Username: CommanderShepard
Password: Spectre123!

๐Ÿงช Unit Tests

The project includes 97 unit tests across 10 test classes, using NUnit, Moq, and MockQueryable.Moq, with 73.8% service layer coverage.

TheBigThree.Tests/
โ”œโ”€โ”€ Services/
โ”‚   โ”œโ”€โ”€ CollectionServiceTests.cs    (19 tests)
โ”‚   โ”œโ”€โ”€ CommentServiceTests.cs       (10 tests)
โ”‚   โ”œโ”€โ”€ LikeServiceTests.cs          (11 tests)
โ”‚   โ”œโ”€โ”€ ProfileServiceTests.cs       (10 tests)
โ”‚   โ”œโ”€โ”€ AdminServiceTests.cs         (11 tests)
โ”‚   โ””โ”€โ”€ StatsServiceTests.cs         (7 tests)
โ””โ”€โ”€ Controllers/
    โ”œโ”€โ”€ HomeControllerTests.cs       (5 tests)
    โ”œโ”€โ”€ StatsControllerTests.cs      (3 tests)
    โ”œโ”€โ”€ LeaderboardControllerTests.cs (3 tests)
    โ””โ”€โ”€ CollectionControllerTests.cs (18 tests)

Running Tests

In Visual Studio: Test โ†’ Run All Tests

Or via CLI:

dotnet test

Coverage Areas

Services (73.8% line coverage)

  • Collection CRUD and business rules (one per user)
  • Comment add/delete with authorization and admin bypass
  • Like/unlike with duplicate prevention and star decrement
  • Profile and public profile data loading
  • Admin promote/demote/delete operations
  • Community stats and leaderboard ordering

Controllers

  • Action return types (ViewResult, RedirectToActionResult)
  • Correct view model passing
  • Redirect targets on not-found and error scenarios
  • Service delegation verification
  • Authenticated user context mocking
  • Exception handling branches (Star/RemoveStar)

๐ŸŒ Deployment

The application is designed to be deployable to Microsoft Azure (App Service + Azure SQL). Deployment instructions will be added if a public hosting URL becomes available.


๐Ÿ“ Project Structure

TheBigThree/
โ”œโ”€โ”€ Areas/
โ”‚   โ”œโ”€โ”€ Admin/                  โ† Admin area (Dashboard, Users, Collections)
โ”‚   โ””โ”€โ”€ Identity/               โ† Scaffolded Identity pages (Login, Register, Manage)
โ”œโ”€โ”€ Controllers/                โ† Main app controllers
โ”œโ”€โ”€ Views/                      โ† Razor views per controller
โ”œโ”€โ”€ wwwroot/
โ”‚   โ”œโ”€โ”€ css/                    โ† Per-page CSS files + site.css
โ”‚   โ”œโ”€โ”€ js/                     โ† site.js, hub.js, rawg.js, public-profile.js
โ”‚   โ””โ”€โ”€ images/
โ”‚       โ”œโ”€โ”€ seed/               โ† Seeded game cover images
โ”‚       โ””โ”€โ”€ backgrounds/        โ† Page background textures
โ”œโ”€โ”€ TheBigThree.Data/
โ”‚   โ”œโ”€โ”€ TheBigThreeDbContext.cs
โ”‚   โ”œโ”€โ”€ Migrations/
โ”‚   โ””โ”€โ”€ Repository.cs
โ”œโ”€โ”€ TheBigThree.Data.Models/
โ”‚   โ”œโ”€โ”€ ApplicationUser.cs
โ”‚   โ”œโ”€โ”€ Collection.cs
โ”‚   โ”œโ”€โ”€ Game.cs
โ”‚   โ”œโ”€โ”€ Genre.cs
โ”‚   โ”œโ”€โ”€ Like.cs
โ”‚   โ””โ”€โ”€ Comment.cs
โ”œโ”€โ”€ TheBigThree.Services/       โ† Service implementations
โ”œโ”€โ”€ TheBigThree.Services.Core/  โ† Interfaces + IRepository<T>
โ”œโ”€โ”€ TheBigThree.Web.ViewModels/ โ† ViewModels
โ”œโ”€โ”€ TheBigThree.GCommon/        โ† RankHelper
โ””โ”€โ”€ TheBigThree.Tests/          โ† NUnit tests

๐Ÿ› ๏ธ Tech Stack

Technology Version Purpose
ASP.NET Core MVC 8.0 Web framework
Entity Framework Core 8.0 ORM / data access
ASP.NET Identity 8.0 Authentication & authorization
SQL Server LocalDB Latest Database
Bootstrap 5.3 UI framework
Bootstrap Icons 1.11 Icon library
NUnit 3.x Unit testing
Moq 4.x Mocking
MockQueryable.Moq 7.0 IQueryable mocking
RAWG API v1 Game database

About

Community gaming app where users curate and share their ultimate top 3 games of all time. Built with ASP.NET Core, EF Core, and RAWG API.

Topics

Resources

Stars

Watchers

Forks

Contributors