Code Monkey home page Code Monkey logo

smm-encyclopedia's Introduction

Super Mario Maker Encyclopedia

SMM Encyclopedia CI

https://joookiwi.github.io/smm-encyclopedia

Table of content


A simple project made to retrieve most (if not every) information in all 3 Super Mario Maker games. It contains:

  • Super Mario Maker (WiiU) ~ SMM1
  • Super Mario Maker for Nintendo 3DS (3DS) ~ SMM3DS
  • Super Mario Maker 2 (Switch) ~ SMM2

The information is mostly based on the SMM2 game.

This project is intended to be a simple project to help on research.
It is also there give the details as simple as they can get.
More is to add once this huge project is finished.

The languages supported by the project are the ones available in the games:

The other languages seen in the project can include Hebrew, Polish, Ukrainian & Greek. Although, they are only there for some names.

List of elements to do

  • When giving an url example.com/path, it would be based on the browser language.
    And for example.com/en-US/path, then the language would be set to American English.
  • Font family
    • from the Super Mario Maker games
    • from SMB, SMB3, SMW, NSMBU & SM3DW specifically
  • Colour mode implementation (independent of each and another)
    • Dark mode
    • Colour-blind mode
  • Search engine.
  • Options that would change the URL based on the application loaded.
  • Sub-pages with reactive URL.
  • Secret pages
    • by URL
    • by key combination
    • maybe other ways to create them

Development for the web application

Standard used in the project

In order to have a clean way to navigate to the project, multiple standards have been made.

Imports

They are separated in different sections

  • Import ordering
    1. SCSS files (for React components)
    2. Dependencies import
    3. Type import (not useful to debug)
    4. Real import (if used at compile time → import type)
  • Spacing for the import is aligned for better readability
  • Ordered alphabetically by group

Visibility

Since some visibilities are present in other languages (like Kotlin, Java, PHP or C#), the project utilizes some standard on the visibilities.

It utilizes the Typescript system for the pre-established visibilities. Then, for those that are not in the system, it uses somme pattern for it.

Syntax in project in Typescript in Javascript Example
public [name] public public public
 public anExample
public anExample()
[name] package public public
anExample
anExample()
_[name] protected protected public
protected _anExample
protected _anExample()
__[name]
#[name]
private private __ -> public
# -> private
#anExample
#anExample()
private __anExample
private __anExample()

Folder structure

Folder structures the files. Most of them are self-explanatory.

Path Meaning Things to do
src/app Application
src/core The core elements of the project
src/lang The languages
src/routes The routes of the project
src/util The utilities They should me moved into separate projects
src/bootstrap External dependencies to Bootstrap
src/navigation The application navigation (& footer)
src/resources The application resources (mostly CSV files) Move this directory outside of the src folder
src/resources/compiled The compiled (json files) from the CSV (this should always be empty)
public/[any-folder] The images (& sounds) of the project

File naming

The names of the files are important since some of them are for Typescript and others give meaning to them.

Syntax Type of file Javascript Typescript
[singular-name].ts
[singular-name].container.ts
[singular-name].builder.ts
[singular-name].component.ts
A file declaration
A file description
A Builder class
A React component
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
[plural-name].types.ts
[plural-name].ts
An enumeration declaration file
An enumeration file
No
Yes
Yes
Yes
[lower-case-name].ts Not a class, but some files or functions Yes or No
(not both)
Yes

Variable / methods / class naming

The variables, methods & classes use a different format, but they all share at some point the standard.
They don't follow directly the standard, but have a general format followed.

Syntax Description Applicable for Example
[upper-case-name] An upper case name (using _ as a word separator) Constant,
Enum instance
AN_EXAMPLE
[lower-case-name] A lower case name (using camel case) Variable
anExample
[capital-case] A capital case name (using Pascal case) Class,
Interface,
Type,
Dynamic import method for class
AnExample
[name][_[nameX]*] Multiple different names following each others Variable,
Method
anExample_withSomething_secret
#[name] (always) private Variable,
Method
#anExample
#anExample()
$[name] something that starts with a number
(Not a PHP variable)
Variable,
Method
$1Example
$1Example()
_[name] (always) protected Method
_anExample()
__[name] private (with private field) Getter & setter methods
get __anExample() {
this.#anExample
}
set __anExample(value) {
this.#anExample = value
}
_[name](…) protected with possibility of arguments
(only called once by getter)
Create methods
protected _anExample() {
return somethingToBeCalledOnce
}
protected _anotherExample(a, b, …,) {
return somethingToBeCalledOnceWith(a, b, …,)
}
, Ending with a leading , Creation (Array / Object),
Call (method / constructor),
Generic type
[a, b, c,]
{a: 1, b: 2, c: 3,}
anExample(a, b, c,)
new AnExample(a, b, c,)

class AnExample<T,>{ ... }
anExample<T,>(t: T,)
| (always) Before a join Type
type AnExample = | TypeA | TypeB
'
not "
For a string variable, ' is used instead of "

(This will be changed to be recognizable by other languages)
String → ",
Character → '
type AnExampleString = 'something'
type AnExampleCharacter = 'A'
no ; (never) Ending with a ; Variable,
Class,
, Interface
Type
const anExample = 420 / 69

class AnExample {
fieldA
fieldB
}

interface AnExample {
fieldA
fieldB
}

type AnExample = `Jank ${| 'city' | 'game'}`
000_000 no 000000 To be less ambiguous in the reading of really long numbers Number
const anExampleNumber = 123_456
const anotherExampleNumber = 1_042_069
null
no undefined
To be like Kotlin, Java, C#, PHP & others, the use of null is the only one for the nullable variables Type
type AnExample = | AType | null

Files using a CSV source

In the core (src/core/...), the files have some formatting that each have their responsibility. The only ones that are used outside are:

  • Interface
  • Enum (sometimes even in the src/util/DynamicImporter.ts)
  • The loader types (Loader.types)

The rest should not be used outside the same package (folder).

Format Type Description Dependencies
[name].template.ts Template The template associated to the CSV file Type
[name].loader.ts Loader The file loader (main core) Builder
Template
Type
loader.types.ts Type Types only applicable to the file loaders
[name].builder.ts Builder The class that create the class with builder pattern methods Template
Class
Enum (some times)
[name].creator.ts Creator A class that create the class with a singular create method,
or a stateless method createContent()
Template
Class
Enum (some times)
[name].provider.ts Provider The provider class that will get or create the specific instance
(will never create duplicate instance)
Interface
Class
[name].ts Interface The class description that is used elsewhere Type
Empty[name].ts Singleton The empty class instance Interface
[name].container.ts Class The class instance Interface
[plural-name].ts Enum Every elements as an enum instance Loader (dynamic)

The types used in the interface:
Type Use case
boolean Most of the time
number Most of the time
string translation key
acronym
name fields
comment
object Properties
enumeration Properties use other scr/core elements

Dependencies

Every dependency are described bellow with the direct dependency and the indirect (via the DynamicImporter utility class)

Name Direct dependency Indirect dependency
Entity Clear condition,
Limit,
Entity category,
Theme,
Time,
Game,
Game style,
Mystery Mushroom,
Entity behaviour,
Editor voice,
Instrument,
Version
Entity group,
Night effect
Character name Editor voice
Clear condition (SMM2) Clear condition category Entity
Clear condition category (SMM2) Clear condition
Limit Entity
Entity projectile Entity
Entity object Entity
Entity category Entity
Entity group Entity
Theme Time,
Game
Time
Game reference Game,
Game style
Game Game reference
Game style Game reference,
Night effect
Entity behaviour Entity
Sound effect Sound effect category Entity,
Entity group,
Game
Sound effect category Sound effect
Course tag (SMM2)
Predefined message (SMM2)
Sample courses (SMM1) Themes,
Game style
Medals (SMM1) Entity,
Character name
Super Mario Challenges levels (SMM3DW)
Job (SMM2) Entity
Official notification (SMM2) Entity,
Mii costume
Ninji speedrun (SMM2)
Mystery Mushroom (SMM1)
Mii costume (SMM2) Mii costume category Entity
Mii costume category (SMM2) Mii costume
Editor voice Entity,
Character name
Instrument Entity
Version Game style

Routes

Every route in the project has a reason to exist. It can either be to have a default value or to be accessible by the URL directly.

So far, the paths are separated by multiple parts:

  1. The optional language (en-AM, en-EU, fr-CA, fr-EU, de, es-AM, es-EU, it, nl, pt-AM, pt-EU, ru, ja, zh-tw, zh-cn or ko)
  2. The game (game- + 1, 3ds and/or 2) with its default game-2
  3. The display option (list, card or table)
  4. The ending paths:
Path (in the URL) Small description
home
about A small description about this application and its purpose
source Those who helped and the tools used to make this application
every/
[power-up|ride|hat](+[power-up|ride|hat]{0,2}?)
/priority
A visualisation of the priority about the power-ups, rides and hats
every/character-name The character name told in the editor
every/game-reference Every game referenced in any games
every/game-style The game style used in the games
every/entity The entities only used in the games
every/entity-category The category made to group the entity (from the Super Mario Maker 2 game)
every/entity-group A group of entity associated by relation, color or other kind of attributes
[every|play|editor]
/limit
The limit applicable and usable in the games
[every|course|world]
/theme
The theme (in a level or a world)
every/sound-effect The sound effect placeable on any surface or entity
every/sound-effect-category The category (from the Super Mario Maker 2 game) of the sound effect
every/mii-costume The costume applicable to a Mii online only in Super Mario Maker 2
every/mii-costume-category The type of Mii costume that can be used only in Super Mario Maker 2
every-mystery-mushroom The Mystery Mushrooms usable only in Super Mario Maker
every/predefined-message The predefined message used online
every/sample-course The sample courses (in Super Mario Maker only)
[every|official|unofficial|maker-central]
course-tag
The course tags used online or by the community
every/instrument The instrument applicable to anything that can make a sound out of a Music Block
every-editor-voice The voices applicable to anything placed in the editor

NPM commands

Prerequisites

Before running the application, make sure that npm is installed.

Then, from there,

  • run npm install to install the node_modules package

Run the project locally (desktop and mobile)

To run the project, the command npm run start is the only thing to do.

  • Start the execution of the tools;
  • Start the development mode;
  • Reload on edits (and save);
  • In the console (and command prompt), display any lint errors.

The project could also be run with npm run fast-start to omit:

  • CSV → Json (resources/csvsrc/resources/compiled)
  • Copy images for CSS (public/*src/resources/images)
  • Copy the locales from resources/locale to the src/lang/locale
  • (Other things in the future)

By default, it will open it in the default browser automatically. If it has not worked, then open localhost:3000/smm-encyclopedia to display the application.

If it needs to be tested on other devices than the local machine, there will be another address. An example could be 192.168.4.20:3000/smm-encyclopedia.

Running tests

The tests are not part of the validations on the server. They are only done locally.

It has:

  • Testing the CSV files npm run test-file
  • Testing the entity types (upcoming tests)

Running testing tool

The command to execute the test command tool is npm run test.

Then, from that, it will start an interactive watch mode. For more details, see how to run the tests.

Deploying the changes to the server

Since the project uses the workflow (in .github/workflows/workflow.yml), it will automatically push the changes once there is a commit in the main branch.

It automatically calls the command npm run deploy (implicitly calling npm run predeploy).

With the deployment, it will automatically call npm run build and will:

  • Minify of the files;
  • Contain files formatted in static/js/[420.jank69].chunk.js and static/css/[420.jank69].chunk.css.

See the application's deployment to know in details how the React build is done.

The code will be pushed in the branch github-pages branch by the workflow.

smm-encyclopedia's People

Contributors

joookiwi avatar

Stargazers

 avatar

Watchers

 avatar

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.