Giter Site home page Giter Site logo

digitalmachinist / mvm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.77 MB

A tool for mapping out and analyzing 2D metroidvania games where progression depends on locks and keys.

License: GNU General Public License v3.0

PHP 59.53% HTML 4.14% Shell 10.50% Vue 4.56% Dockerfile 17.43% Groovy 0.21% Python 0.83% VCL 2.80%

mvm's People

Contributors

digitalmachinist avatar

Stargazers

 avatar

Watchers

 avatar  avatar

mvm's Issues

Backend user role support

This isn't an immediate priority but need to make a decision about either bringing on spatie/permissions or rolling my own.

Basically we just need to support an admin level to perform some guarding of routes that are admin-only.

Maybe something like this:

roles

Field Data Type Null? Indexes?
id bigint No Primary
name string No
created_at datetime No
updated_at datetime No

user_role

Field Data Type Null? Indexes?
user_id bigint No Foreign
role_id bigint No Primary
created_at datetime No
updated_at datetime No

Basic authentication frontend in nuxt

Need this mocked out still, but this will offer views for registering a user, logging in, logging out, and performing email verification. Presumably, some kind of header will be designed to allow register/login/logout options to be present on all pages.

Might need to do some work to deal with communicating Laravel's auth cookie to the client.

Keys management CRUD frontend in nuxt

This hasn't been mocked yet, but should include an index of keys related to the user's current context project, controls to create new keys, edit existing ones, delete existing ones, upload key images, and view keys in detail view.

Ideally we also can at least plan out some additional cool features (we can write backend stories for these later):

  • List of rooms that the key can be collected from
  • List of pathways the key unlocks
  • List of keys required to collect this key given the user's current context starting point & keyset
  • Distance/difficulty to collect the key with the user's current context starting point & keyset

Frontend persistence of user context (current project and current starting room & keyset)

The user's project selection should persist for their entire session unless they intentionally change project. Next time they log in, their current context project will be reset, but isn't stored to the database and is just held locally on the client.

The user's starting room is stored on each project, but the frontend should allow the user to set arbitrary starting room to compute values based on it. This current context starting room should get reset whenever the user's project changes, but isn't stored to the database and is just held locally on the client. There will be a separate backend route that will set the default starting room of a project.

The user's starting keyset will be held entirely by the client because we'll assume that the player will have no keys when a game begins by default. However, the frontend should have controls to allow the user to toggle keys on/off to compute values based on them. The current context keyset should get reset whenever the user's project changes.

Domain models and database migrations

These include the domain model concepts such as:

  • projects
  • keys
  • rooms
  • pathways
  • key_room (pivot)
  • key_pathway (pivot)

Any model states or enums that make sense to create in definite these models should be done now.

projects

Field Data Type Null? Indexes?
id bigint No Primary
user_id bigint No Foreign
start_room_id bigint Yes Foreign
name string No
description text No
colour string, 6 Yes
image_url text Yes
is_public boolean No
created_at datetime No
updated_at datetime No

rooms

Field Data Type Null? Indexes?
id bigint No Primary
project_id bigint No Foreign
name string No
description text No
colour string, 6 Yes
image_url text Yes
difficulty smallint No
x int Yes
y int Yes
width int Yes
height int Yes
created_at datetime No
updated_at datetime No

pathways

Field Data Type Null? Indexes?
id bigint No Primary
room_1_id bigint No Foreign
room_2_id bigint No Foreign
name string No
description text No
colour string, 6 Yes
image_url text Yes
difficulty smallint No
created_at datetime No
updated_at datetime No

keys

Field Data Type Null? Indexes?
id bigint No Primary
project_id bigint No Foreign
name string No
description text No
colour string, 6 Yes
image_url text Yes
created_at datetime No
updated_at datetime No

key_room

Field Data Type Null? Indexes?
key_id bigint No Foreign
room_id bigint No Foreign
x int Yes
y int Yes
created_at datetime No
updated_at datetime No

key_pathway

Field Data Type Null? Indexes?
key_id bigint No Foreign
pathway_id bigint No Foreign
created_at datetime No
updated_at datetime No

Backend basic auth flow

A stub for working on the authentication routes offered by the backend to allow registration/login/logout with email/password.

Pathways management CRUD frontend in nuxt

This hasn't been mocked yet, but should include an index of pathways related to the user's current context project, controls to create new pathways, edit existing ones, delete existing ones, upload pathway images, and view pathways in detail view.

Ideally we also can at least plan out some additional cool features (we can write backend stories for these later):

  • List of pathways that also connect the same 2 rooms (parallel pathways)
  • List of pathways that are connected to each endpoint room
  • List of keys required to traverse this pathway given the user's current context starting point & keyset
  • Distance/difficulty to traverse this pathway given the user's current context starting point & keyset

CRUD routes for projects

User can only perform GET operations on another user's keys, but may perform all operations on their own.

GET /api/projects

Return paginated projects from all users.

Errors

n/a

GET /api/users/{id}/projects

Return paginated projects from the user at the included id.

Errors

HTTP 404 when no user exists at the included id.

GET /app/projects/{id}

Return the key at the included id.

Errors

HTTP 404 when no key exists at the included id.

POST /api/projects

Create a new project related to the current user and return it.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when a key couldn't be created on the project at the included id (maybe the project has been deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
is_public: ['required', 'boolean']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

PATCH /api/projects/{id}

Update the project at the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when a key couldn't be created on the project at the included id (maybe the project has been deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
is_public: ['required', 'boolean']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

DELETE /api/projects/{id}

Delete the key and the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the key couldn't be edited (maybe it was already deleted?).

ProjectResource

Use this resource to output any Project models to callers.

{
    "data": {
        "id": 1,
        "name": 'A short name for the key',
        "description": 'A longer-form description of the key and maybe some flavour text.',
        "colour": '9966ff',
        "is_public": true, 
        "image_url": 'https://google.com/wat.gif',
        "created_at": 1577851982966,
        "updated_at": 1577852002169
    }
}

Diagram view routes

This isn't very clear to me yet, but it's stub for any backend work needed to support the diagram view on the frontend.

Backend multiple email support

Needs the ability to:

  • Add a new email (needs to be confirmed)
  • Remove an existing email
  • Confirm an email
  • Request that a confirmation email be resent
  • Set a confirmed email as the primary contact email

Routes

  • POST /app/emails/{id}/confirm
  • POST /app/emails/{id}/resend

Maybe use a database structure like this:

emails

Field Data Type Null? Indexes?
id bigint No Primary
user_id bigint No Foreign
address string No
is_primary boolean No
is_confirmed boolean No
confirm_token string, 64 Yes
created_at datetime No
updated_at datetime No

Unique index on [address, is_confirmed].

Improve docker-compose build/up time

Right now it's taking something like 18 minutes to build the laradock container when running github actions. Need to design a docker container that significantly improves on this to get it under a minute or so.

Frontend diagram view

This is mostly not planned, so there's lots to think about here. We want to be able to output a Boss Keys-style diagram describing how access to keys unfolds as keys are collected, showing how many options a player has at a given point in the game. The diagram should begin from the user's current context starting room & keyset.

CRUD routes for pathways

User can only perform GET operations on another user's pathways, but may perform all operations on their own.

GET /app/projects/{id}/pathways

Return all pathways from the project at the included id.

Errors

HTTP 404 when no project exists at the included id.

GET /app/pathways/{id}

Return the pathway at the included id.

Errors

HTTP 404 when no pathway exists at the included id.

POST /app/projects/{id}/pathways

Create a new pathway related to the current project and return it.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when a pathway couldn't be created on the project at the included id (maybe the project has been deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
difficulty: ['required', 'integer', 'min:1']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

PATCH /app/pathways/{id}

Update the pathway at the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the pathway couldn't be edited (maybe it was already deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
difficulty: ['required', 'integer', 'min:1']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

DELETE /app/pathways/{id}

Delete the pathway and the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the pathway couldn't be edited (maybe it was already deleted?).

PathwayResource

Use this resource to output any Pathway models to callers.

{
    "data": {
        "id": 1,
        "name": 'A short name for the pathway',
        "description": 'A longer-form description of the pathway and maybe some flavour text.',
        "difficulty": 1,
        "colour": '9966ff',
        "image_url": 'https://google.com/wat.gif',
        "created_at": 1577851982966,
        "updated_at": 1577852002169
    }
}

CRUD routes for rooms

User can only perform GET operations on another user's rooms, but may perform all operations on their own.

GET /app/projects/{id}/rooms

Return all rooms from the project at the included id.

Errors

HTTP 404 when no project exists at the included id.

GET /app/rooms/{id}

Return the room at the included id.

Errors

HTTP 404 when no room exists at the included id.

POST /app/projects/{id}/rooms

Create a new room related to the current project and return it.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when a room couldn't be created on the project at the included id (maybe the project has been deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

PATCH /app/rooms/{id}

Update the room at the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the room couldn't be edited (maybe it was already deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

DELETE /app/rooms/{id}

Delete the room and the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the room couldn't be edited (maybe it was already deleted?).

RoomResource

Use this resource to output any Room models to callers.

{
    "data": {
        "id": 1,
        "name": 'A short name for the room',
        "description": 'A longer-form description of the room and maybe some flavour text.',
        "colour": '9966ff',
        "image_url": 'https://google.com/wat.gif',
        "created_at": 1577851982966,
        "updated_at": 1577852002169
    }
}

CRUD routes for keys

User can only perform GET operations on another user's keys, but may perform all operations on their own.

GET /app/projects/{id}/keys

Return all keys from the project at the included id.

Errors

HTTP 404 when no project exists at the included id.

GET /app/keys/{id}

Return the key at the included id.

Errors

HTTP 404 when no key exists at the included id.

POST /app/projects/{id}/keys

Create a new key related to the current project and return it.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when a key couldn't be created on the project at the included id (maybe the project has been deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

PATCH /app/keys/{id}

Update the key at the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the key couldn't be edited (maybe it was already deleted?).
HTTP 422 when validation fails.

POST

name: ['required', 'string', 'max:255']
description: ['required', 'string']
colour: ['required', 'string', 'nullable', 'regex:/[0-9a-f]{6}/i']
image: ['image', 'dimensions:max_width=1024,max_height=1024']

DELETE /app/keys/{id}

Delete the key and the included id and report success.

Errors

HTTP 404 when no project exists at the included id.
HTTP 409 when the key couldn't be edited (maybe it was already deleted?).

KeyResource

Use this resource to output any Key models to callers.

{
    "data": {
        "id": 1,
        "name": 'A short name for the key',
        "description": 'A longer-form description of the key and maybe some flavour text.',
        "colour": '9966ff',
        "image_url": 'https://google.com/wat.gif',
        "created_at": 1577851982966,
        "updated_at": 1577852002169
    }
}

Track user IP and login datetime

Track user logins and the IP addresses they came from so we have a record of each one.

Maybe use a database structure like this:

logins

Field Data Type Null? Indexes?
id bigint No Primary
user_id bigint No Foreign
ip_address string, 39 Yes Index
created_at datetime No Index
updated_at datetime No

Email management frontend in nuxt

This isn't mocked yet, but it would be nice to have an interface to manage email accounts by adding/removing/confirming/resending confirmations and setting an email as the primary contact email.

Projects management CRUD frontend in nuxt

This still needs to be mocked, but will include an index of the user's projects, controls to create new projects, edit old projects, delete projects, upload project images, and view projects in detail view.

Once a project is opened, it will become the user's current project context until they change to a different project. Probably also need something in the header to show current project and switch projects.

Map view routes

This isn't very clear to me yet, but it's stub for any backend work needed to support the map view on the frontend.

Profile management in nuxt

This isn't mocked yet, but it would be nice to have some controls to allow the user to edit account details and upload a profile image.

Basic authentication routes

Need some simple routes to handle logging in (with email and password only) and logging out.

  • /api/login
  • /api/logout
  • /api/register
  • /api/confirm
  • /api/confirm/resend

Rooms management CRUD frontend in nuxt

This hasn't been mocked yet, but should include an index of rooms related to the user's current context project, controls to create new rooms, edit existing ones, delete existing ones, upload room images, and view rooms in detail view.

Ideally we also can at least plan out some additional cool features (we can write backend stories for these later):

  • List of keys that can be collected in this room
  • List of pathways that are connected to this room including the room that each one leads to
  • List of keys required to access this room given the user's current context starting point & keyset
  • Distance/difficulty to access this room given the user's current context starting point & keyset

Frontend map view

There's a lot of planning to be done for this. So think this though before anything...

There are some cool features worth thinking about, even if they don't get implemented:

  • Dragging and dropping rooms on the map
  • Resize rooms using their edges and corners like PS
  • Resize rooms using their edges and corners while maintaining center like PS
  • Hover over a key collect point or requirement to highlight all collection points and requirements for that key
  • (Right) Click a key to toggle it on/off in the user's current context keyset
  • (Right) Click a key to room to set it as the user's current context starting room
  • Save button to save all pathways/rooms/key_room/key_pathway in one big request
  • Highlight pathways with invalid endpoint rooms so they can be fixed
  • Should computation of difficulty/distance/required keys belong to the backend or the frontend?

Backend social auth support

I've already added Socialite to the project to support this.

Need routes to link new social accounts and ideally a plan to merge accounts that belong to the same user.

Maybe use a database structure like this:

credentials

Field Data Type Null? Indexes?
id bigint No Primary
user_id bigint No Foreign
authority string, 32 No
username string No
password string Yes
created_at datetime No
updated_at datetime No

Unique index on [authority, username].

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.