├── CNAME ├── Spyglass ├── wwwroot │ ├── css │ │ ├── bootstrap │ │ │ └── bootstrap.min.css │ │ └── open-iconic │ │ │ ├── font │ │ │ ├── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ │ └── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── FONT-LICENSE │ ├── appsettings.json │ ├── favicon.ico │ ├── fonts │ │ ├── Dosis.ttf │ │ └── DidactGothic.ttf │ ├── images │ │ ├── icon.png │ │ ├── yeet_goat.png │ │ ├── potatophant.png │ │ ├── front_page_bg.png │ │ └── website_wordmark.png │ ├── setBodyHeight.html │ ├── 404.html │ └── index.html ├── Pages │ ├── WhosJoe.razor │ ├── Docs.razor │ ├── EarlyAccess.razor │ ├── Install.razor │ ├── Loading.razor │ ├── Logout.razor │ ├── Index.razor │ ├── Account.razor │ ├── Error404.razor │ ├── TermsOfUse.razor │ ├── React.razor │ ├── ViewComment.razor │ ├── Settings.razor │ ├── Login.razor │ ├── ViewStudio.razor │ ├── Browse.razor │ ├── ViewProject.razor │ └── ViewProfile.razor ├── Models │ ├── BrowseQuery.cs │ ├── UserIPAddress.cs │ ├── Reaction.cs │ ├── OcularUser.cs │ ├── AuthenticationResponse.cs │ ├── ScratchCommentAuthor.cs │ ├── Settings.cs │ ├── UserReaction.cs │ ├── ScratchComment.cs │ ├── ScratchUser.cs │ ├── User.cs │ └── Comment.cs ├── package.json ├── Services │ ├── AppSettings.cs │ ├── ReactionService.cs │ ├── SettingsService.cs │ └── AuthenticationService.cs ├── gulpfile.js ├── App.razor ├── _Imports.razor ├── Shared │ ├── CommentButton.razor │ ├── Button.razor │ ├── NavbarButton.razor │ ├── PageTitle.razor │ ├── FrontPageButton.razor │ ├── ReactMenu.razor │ ├── MainLayout.razor.css │ ├── Footer.razor │ ├── Heading.razor │ ├── MainLayout.razor │ ├── Navbar.razor │ ├── ReactionButton.razor │ └── Comment.razor ├── Spyglass.csproj ├── Styles │ └── app.css ├── tailwind.config.js ├── Properties │ └── launchSettings.json └── Program.cs ├── .gitattributes ├── Magnifier ├── .config │ └── dotnet-tools.json ├── Models │ ├── ApiComments.cs │ ├── ScratchProject.cs │ ├── Settings.cs │ ├── UserIPAddress.cs │ ├── MongoDBSettings.cs │ ├── Reaction.cs │ ├── JwtAuthSettings.cs │ ├── ScratchCommentAuthor.cs │ ├── AuthCode.cs │ ├── UserReaction.cs │ ├── ScratchComment.cs │ ├── ScratchRequestResponse.cs │ ├── User.cs │ └── Comment.cs ├── appsettings.Development.json ├── Dockerfile ├── Controllers │ ├── UpController.cs │ ├── ReactionsController.cs │ └── AuthController.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Services │ ├── UserService.cs │ ├── ReactionService.cs │ ├── AuthCodeService.cs │ ├── JwtAuthService.cs │ └── CommentService.cs ├── Magnifier.csproj ├── Startup.cs └── Magnifier.xml ├── Spyglass.Server ├── appsettings.Development.json ├── appsettings.json ├── Pages │ ├── _Host.cshtml.cs │ └── _Host.cshtml ├── Spyglass.Server.csproj ├── Dockerfile ├── Program.cs ├── Properties │ └── launchSettings.json └── Startup.cs ├── .firebaserc ├── firebase.json ├── .github ├── ISSUE_TEMPLATE │ ├── feature-request.md │ └── bug-report.md ├── pull-request-template.md └── workflows │ └── main.yml ├── .dockerignore ├── LICENSE ├── Magnifier.sln ├── README.md └── .gitignore /CNAME: -------------------------------------------------------------------------------- 1 | magnifier.potatophant.net -------------------------------------------------------------------------------- /Spyglass/wwwroot/css/bootstrap/bootstrap.min.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Spyglass/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiRoot": "https://magnifier-api.potatophant.net/api" 3 | } -------------------------------------------------------------------------------- /Spyglass/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Spyglass/wwwroot/fonts/Dosis.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/fonts/Dosis.ttf -------------------------------------------------------------------------------- /Spyglass/wwwroot/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/images/icon.png -------------------------------------------------------------------------------- /Spyglass/wwwroot/images/yeet_goat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/images/yeet_goat.png -------------------------------------------------------------------------------- /Spyglass/wwwroot/fonts/DidactGothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/fonts/DidactGothic.ttf -------------------------------------------------------------------------------- /Spyglass/wwwroot/images/potatophant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/images/potatophant.png -------------------------------------------------------------------------------- /Spyglass/wwwroot/images/front_page_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/images/front_page_bg.png -------------------------------------------------------------------------------- /Spyglass/wwwroot/images/website_wordmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/images/website_wordmark.png -------------------------------------------------------------------------------- /Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davwat/Magnifier/HEAD/Spyglass/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /Spyglass/Pages/WhosJoe.razor: -------------------------------------------------------------------------------- 1 | @page "/whosjoe" 2 | 3 | 4 | 5 |
6 | joe mamma 7 |
8 | 9 | @code { 10 | 11 | } -------------------------------------------------------------------------------- /Spyglass/Models/BrowseQuery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | public class BrowseQuery 7 | { 8 | public string id { get; set; } 9 | } -------------------------------------------------------------------------------- /Magnifier/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "5.0.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Spyglass.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Spyglass/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "autoprefixer": "^9.7.4", 4 | "gulp": "^4.0.2", 5 | "gulp-postcss": "^8.0.0", 6 | "precss": "^4.0.0", 7 | "tailwindcss": "^1.9.6" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "potatophant-7703c" 4 | }, 5 | "targets": { 6 | "potatophant-7703c": { 7 | "hosting": { 8 | "magnifier": [ 9 | "magnifier" 10 | ] 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Spyglass/wwwroot/setBodyHeight.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /Magnifier/Models/ApiComments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public class ApiComments 9 | { 10 | public List comments; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Spyglass/Services/AppSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Spyglass.Services 7 | { 8 | public class AppSettings 9 | { 10 | public string ApiRoot { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Spyglass/Pages/Docs.razor: -------------------------------------------------------------------------------- 1 | @page "/docs" 2 | 3 | 4 | 5 | 10 | 11 |
12 | gud docs coming soon 13 |
14 | 15 | @code { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Magnifier/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "JwtAuthSettings": { 3 | "PrivateKey": "cf1bb3b6-97ac-4812-aaa9-6392ce5f1cce", 4 | "Issuer": "https://localhost:5000", 5 | "Audience": "https://localhost:5000", 6 | "LifetimeDays": 90 7 | }, 8 | "MongoDBSettings": { 9 | "ConnectionString": "mongodb://localhost:27017/" 10 | } 11 | } -------------------------------------------------------------------------------- /Spyglass.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppSettings": { 3 | "ApiRoot": "https://magnifier-api.potatophant.net/api" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft": "Warning", 9 | "Microsoft.Hosting.Lifetime": "Information" 10 | } 11 | }, 12 | "AllowedHosts": "*" 13 | } 14 | -------------------------------------------------------------------------------- /Spyglass/Models/UserIPAddress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Threading.Tasks; 6 | 7 | namespace Magnifier.Models 8 | { 9 | public class UserIPAddress 10 | { 11 | public string ipAddress { get; set; } 12 | 13 | public DateTime time { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spyglass/Pages/EarlyAccess.razor: -------------------------------------------------------------------------------- 1 | @page "/earlyaccessgivemefreevbuxplsilovefortniteisagenuinelyentertaininggamethatisntjustaboutshootingsmallchildren" 2 | @inject NavigationManager NavigationManager 3 | 4 | @code { 5 | protected override void OnInitialized() 6 | { 7 | NavigationManager.NavigateTo("https://www.youtube.com/watch?v=xvFZjo5PgG0"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "target": "magnifier", 4 | "public": "Spyglass/bin/Release/net5.0/publish/wwwroot", 5 | "ignore": [ 6 | "firebase.json", 7 | "**/.*", 8 | "**/node_modules/**" 9 | ], 10 | "rewrites": [ 11 | { 12 | "source": "**", 13 | "destination": "/index.html" 14 | } 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest features for Magnifier and Spyglass! 4 | title: "Feature Request: " 5 | labels: "enhancement" 6 | --- 7 | 8 | **Feature** 9 | 10 | 11 | 12 | **Additional context** 13 | 14 | 15 | -------------------------------------------------------------------------------- /Spyglass/gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | 3 | gulp.task('css', () => { 4 | const postcss = require('gulp-postcss'); 5 | 6 | return gulp.src('./Styles/app.css') 7 | .pipe(postcss([ 8 | require('precss'), 9 | require('tailwindcss'), 10 | require('autoprefixer') 11 | ])) 12 | .pipe(gulp.dest('./wwwroot/css/')); 13 | }); -------------------------------------------------------------------------------- /Spyglass/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Spyglass.Server/Pages/_Host.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace Spyglass.Server.Pages 9 | { 10 | public class _HostModel : PageModel 11 | { 12 | public void OnGet() 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/pull-request-template.md: -------------------------------------------------------------------------------- 1 | **Resolves** 2 | 3 | 4 | 5 | Resolves # 6 | 7 | **Changes** 8 | 9 | 10 | 11 | **Reason for changes** 12 | 13 | 14 | 15 | **Tests** 16 | 17 | 18 | -------------------------------------------------------------------------------- /Magnifier/Models/ScratchProject.cs: -------------------------------------------------------------------------------- 1 | // This class exists solely to deserialize JSON from the Scratch API. Go away. 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Magnifier.Models 9 | { 10 | public class ScratchProject 11 | { 12 | public int id; 13 | 14 | public ScratchCommentAuthor author; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spyglass/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using Spyglass 10 | @using Spyglass.Shared -------------------------------------------------------------------------------- /Spyglass/Pages/Install.razor: -------------------------------------------------------------------------------- 1 | @page "/install" 2 | 3 | 4 | 5 |
6 | 10 | :( 11 |
12 | 13 | @code { 14 | 15 | } -------------------------------------------------------------------------------- /Spyglass/Pages/Loading.razor: -------------------------------------------------------------------------------- 1 | @page "/loading" 2 | @inject HttpClient Http 3 | @inject NavigationManager NavigationManager 4 | 5 | 6 | 7 |
8 |
9 | 10 | Loading... 11 |
12 |
13 | 14 | @code { 15 | 16 | } -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Magnifier/Models/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public enum EmbedPlayer 9 | { 10 | Scratch, 11 | TurboWarp 12 | } 13 | 14 | public record Settings 15 | { 16 | public Settings(EmbedPlayer embedPlayer) 17 | { 18 | this.embedPlayer = embedPlayer; 19 | } 20 | 21 | public EmbedPlayer embedPlayer { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spyglass/Models/Reaction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public record Reaction 9 | { 10 | public Reaction(string name, string emoji) 11 | { 12 | this.name = name; 13 | this.emoji = emoji; 14 | } 15 | 16 | public string id { get; set; } 17 | 18 | public string name { get; set; } 19 | 20 | public string emoji { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /Magnifier/Models/UserIPAddress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Threading.Tasks; 6 | 7 | namespace Magnifier.Models 8 | { 9 | public class UserIPAddress 10 | { 11 | public UserIPAddress(string _ipAddress) 12 | { 13 | ipAddress = _ipAddress; 14 | 15 | time = DateTime.Now; 16 | } 17 | 18 | public string ipAddress { get; set; } 19 | 20 | public DateTime time { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Magnifier/Models/MongoDBSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public class MongoDBSettings : IMongoDBSettings 9 | { 10 | public string ConnectionString { get; set; } 11 | public string DatabaseName { get; set; } 12 | } 13 | 14 | public interface IMongoDBSettings 15 | { 16 | string ConnectionString { get; set; } 17 | string DatabaseName { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spyglass/Models/OcularUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.Json.Serialization; 5 | using System.Threading.Tasks; 6 | 7 | namespace Spyglass.Models 8 | { 9 | public class OcularUser 10 | { 11 | [JsonPropertyName("name")] 12 | public string Name { get; set; } 13 | 14 | [JsonPropertyName("status")] 15 | public string Status { get; set; } 16 | 17 | [JsonPropertyName("color")] 18 | public string Color { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spyglass/Pages/Logout.razor: -------------------------------------------------------------------------------- 1 | @page "/logout" 2 | @using Services 3 | @inject AuthenticationService AuthenticationService 4 | @inject HttpClient Http 5 | @inject IJSRuntime JSRuntime 6 | @inject NavigationManager NavigationManager 7 | 8 | 9 | 10 | Logging out... 11 | 12 | @code { 13 | protected override void OnInitialized() 14 | { 15 | AuthenticationService.Initialize(); 16 | 17 | AuthenticationService.Logout(); 18 | 19 | NavigationManager.NavigateTo("/", true); 20 | } 21 | } -------------------------------------------------------------------------------- /Spyglass/Models/AuthenticationResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Threading.Tasks; 6 | 7 | namespace Spyglass.Models 8 | { 9 | public class AuthenticationResponse 10 | { 11 | public AuthenticationResponse(HttpResponseMessage _response, string _token) 12 | { 13 | response = _response; 14 | token = _token; 15 | } 16 | 17 | public HttpResponseMessage response { get; set; } 18 | 19 | public string token { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spyglass/Models/ScratchCommentAuthor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public class ScratchCommentAuthor 9 | { 10 | public ScratchCommentAuthor(string username, string image) 11 | { 12 | this.username = username; 13 | this.image = image; 14 | } 15 | 16 | public string _id { get; set; } 17 | 18 | public string username { get; set; } 19 | 20 | public string image { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spyglass/Models/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Spyglass.Models 7 | { 8 | public enum EmbedPlayer 9 | { 10 | Scratch, 11 | TurboWarp 12 | } 13 | 14 | public record Settings 15 | { 16 | public Settings() 17 | { 18 | embedPlayer = EmbedPlayer.Scratch; 19 | } 20 | 21 | public Settings(EmbedPlayer embedPlayer) 22 | { 23 | this.embedPlayer = embedPlayer; 24 | } 25 | 26 | public EmbedPlayer embedPlayer { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /Spyglass/Shared/CommentButton.razor: -------------------------------------------------------------------------------- 1 | @if (bigger) 2 | { 3 | 4 | } 5 | else 6 | { 7 | 8 | } 9 | 10 | @code { 11 | [Parameter] 12 | public RenderFragment ChildContent { get; set; } 13 | 14 | [Parameter] 15 | public EventCallback onClick { get; set; } 16 | 17 | [Parameter] 18 | public bool bigger { get; set; } 19 | } 20 | -------------------------------------------------------------------------------- /Magnifier/Models/Reaction.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | using MongoDB.Bson.Serialization.Attributes; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Magnifier.Models 9 | { 10 | public record Reaction 11 | { 12 | public Reaction(string _name, string _emoji) 13 | { 14 | name = _name; 15 | emoji = _emoji; 16 | } 17 | 18 | [BsonId] 19 | [BsonRepresentation(BsonType.ObjectId)] 20 | public string id { get; set; } 21 | 22 | public string name { get; set; } 23 | 24 | public string emoji { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /Spyglass.Server/Spyglass.Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | e99843f6-cc50-45b3-b7b4-d4446b0aee3c 6 | Linux 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Magnifier/Models/JwtAuthSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public class JwtAuthSettings : IJwtAuthSettings 9 | { 10 | public string PrivateKey { get; set; } 11 | public string Issuer { get; set; } 12 | public string Audience { get; set; } 13 | public double LifetimeDays { get; set; } 14 | } 15 | 16 | public interface IJwtAuthSettings 17 | { 18 | string PrivateKey { get; set; } 19 | string Issuer { get; set; } 20 | string Audience { get; set; } 21 | double LifetimeDays { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spyglass/Models/UserReaction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public record UserReaction 9 | { 10 | public UserReaction(string id, string user, string reaction, DateTime timeReacted) 11 | { 12 | this.id = id; 13 | this.user = user; 14 | this.reaction = reaction; 15 | this.timeReacted = timeReacted; 16 | } 17 | 18 | public string id { get; set; } 19 | 20 | public string user { get; set; } 21 | 22 | public string reaction { get; set; } 23 | 24 | public DateTime timeReacted { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /Magnifier/Models/ScratchCommentAuthor.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | using MongoDB.Bson.Serialization.Attributes; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Magnifier.Models 9 | { 10 | public class ScratchCommentAuthor 11 | { 12 | public ScratchCommentAuthor(string _username, string _image) 13 | { 14 | username = _username; 15 | image = _image; 16 | } 17 | 18 | [BsonId] 19 | [BsonRepresentation(BsonType.ObjectId)] 20 | public string _id { get; set; } 21 | 22 | public string username { get; set; } 23 | 24 | public string image { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Spyglass/Shared/Button.razor: -------------------------------------------------------------------------------- 1 | @if (primary) 2 | { 3 | 4 | } 5 | else 6 | { 7 | 8 | } 9 | 10 | @code { 11 | [Parameter] 12 | public RenderFragment ChildContent { get; set; } 13 | 14 | [Parameter] 15 | public EventCallback onClick { get; set; } 16 | 17 | [Parameter] 18 | public bool primary { get; set; } 19 | } -------------------------------------------------------------------------------- /Magnifier/Models/AuthCode.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | using MongoDB.Bson.Serialization.Attributes; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Magnifier.Models 9 | { 10 | public record AuthCode 11 | { 12 | public AuthCode(string _code, bool _hasBeenUsed = false) 13 | { 14 | code = _code; 15 | hasBeenUsed = _hasBeenUsed; 16 | } 17 | 18 | [BsonId] 19 | [BsonRepresentation(BsonType.ObjectId)] 20 | [BsonIgnoreIfDefault] 21 | public string id { get; set; } 22 | 23 | public string code { get; set; } 24 | 25 | public bool hasBeenUsed { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Magnifier/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | EXPOSE 443 7 | 8 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 9 | WORKDIR /src 10 | COPY ["Magnifier/Magnifier.csproj", "Magnifier/"] 11 | RUN dotnet restore "Magnifier/Magnifier.csproj" 12 | COPY . . 13 | WORKDIR "/src/Magnifier" 14 | RUN dotnet build "Magnifier.csproj" -c Release -o /app/build 15 | 16 | FROM build AS publish 17 | RUN dotnet publish "Magnifier.csproj" -c Release -o /app/publish 18 | 19 | FROM base AS final 20 | WORKDIR /app 21 | COPY --from=publish /app/publish . 22 | ENTRYPOINT ["dotnet", "Magnifier.dll"] -------------------------------------------------------------------------------- /Magnifier/Controllers/UpController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Magnifier.Controllers 9 | { 10 | [Route("api/[controller]")] 11 | [ApiController] 12 | public class UpController : ControllerBase 13 | { 14 | /// 15 | /// something stupid 16 | /// 17 | /// 18 | [ApiExplorerSettings(IgnoreApi = true)] 19 | [HttpGet("up")] 20 | [ProducesResponseType(StatusCodes.Status204NoContent)] 21 | public ActionResult GetUp() 22 | { 23 | return NoContent(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report about a bug to help us improve magnifier! 4 | title: "Bug: " 5 | labels: "bug" 6 | --- 7 | 8 | **Describe the bug** 9 | 10 | 11 | 12 | **To Reproduce** 13 | 14 | 15 | 16 | **Expected behavior** 17 | 18 | 19 | 20 | **Browser Information** 21 | 22 | 23 | 24 | **Additional context** 25 | 26 | 27 | -------------------------------------------------------------------------------- /Magnifier/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace Magnifier 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Spyglass.Server/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | EXPOSE 443 7 | 8 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 9 | WORKDIR /src 10 | COPY ["Spyglass.Server/Spyglass.Server.csproj", "Spyglass.Server/"] 11 | RUN dotnet restore "Spyglass.Server/Spyglass.Server.csproj" 12 | COPY . . 13 | WORKDIR "/src/Spyglass.Server" 14 | RUN dotnet build "Spyglass.Server.csproj" -c Release -o /app/build 15 | 16 | FROM build AS publish 17 | RUN dotnet publish "Spyglass.Server.csproj" -c Release -o /app/publish 18 | 19 | FROM base AS final 20 | WORKDIR /app 21 | COPY --from=publish /app/publish . 22 | ENTRYPOINT ["dotnet", "Spyglass.Server.dll"] -------------------------------------------------------------------------------- /Spyglass.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace Spyglass.Server 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Magnifier/Models/UserReaction.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | using MongoDB.Bson.Serialization.Attributes; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Magnifier.Models 9 | { 10 | public record UserReaction 11 | { 12 | public UserReaction(string _user, string _reaction) 13 | { 14 | user = _user; 15 | reaction = _reaction; 16 | timeReacted = DateTime.Now; 17 | } 18 | 19 | [BsonId] 20 | [BsonRepresentation(BsonType.ObjectId)] 21 | [BsonIgnoreIfDefault] 22 | public string id { get; set; } 23 | 24 | public string user { get; set; } 25 | 26 | public string reaction { get; set; } 27 | 28 | public DateTime timeReacted { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /Spyglass/Models/ScratchComment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Magnifier.Models 7 | { 8 | public class ScratchComment 9 | { 10 | public ScratchComment(int id, string content, ScratchCommentAuthor author, DateTime? datetime_created) 11 | { 12 | this.id = id; 13 | this.content = content; 14 | this.datetime_created = datetime_created; 15 | this.author = author; 16 | } 17 | 18 | public string _id { get; set; } 19 | 20 | public int id { get; set; } 21 | 22 | public string content { get; set; } 23 | 24 | public DateTime? datetime_created { get; set; } 25 | 26 | public ScratchCommentAuthor author { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Spyglass/Shared/NavbarButton.razor: -------------------------------------------------------------------------------- 1 |
2 | @if (primary) 3 | { 4 | 5 | @ChildContent 6 | 7 | } 8 | else 9 | { 10 | 11 | @ChildContent 12 | 13 | } 14 |
15 | 16 | @code { 17 | [Parameter] 18 | public RenderFragment ChildContent { get; set; } 19 | 20 | [Parameter] 21 | public string href { get; set; } 22 | 23 | [Parameter] 24 | public bool primary { get; set; } 25 | } 26 | -------------------------------------------------------------------------------- /Spyglass/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | 4 | 5 |
6 |
7 |
8 | Magnifier 9 | Browse 10 | Enable in SA 11 | Read the docs 12 |
13 |
14 |
15 | 16 |