digitalmachinist / mvm Goto Github PK
View Code? Open in Web Editor NEWA tool for mapping out and analyzing 2D metroidvania games where progression depends on locks and keys.
License: GNU General Public License v3.0
A tool for mapping out and analyzing 2D metroidvania games where progression depends on locks and keys.
License: GNU General Public License v3.0
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 |
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.
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):
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.
These include the domain model concepts such as:
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 |
A stub for working on the authentication routes offered by the backend to allow registration/login/logout with email/password.
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):
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.
n/a
GET /api/users/{id}/projects
Return paginated projects from the user at the included id.
HTTP 404
when no user exists at the included id.
GET /app/projects/{id}
Return the key at the included id.
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.
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.
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.
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.
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.
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
}
}
These are markers that a key can be obtained from a room.
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.
Needs the ability to:
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].
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.
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.
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.
HTTP 404
when no project exists at the included id.
GET /app/pathways/{id}
Return the pathway at the included id.
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.
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.
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.
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.
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.
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
}
}
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.
HTTP 404
when no project exists at the included id.
GET /app/rooms/{id}
Return the room at the included id.
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.
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.
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.
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.
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.
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
}
}
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.
HTTP 404
when no project exists at the included id.
GET /app/keys/{id}
Return the key at the included id.
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.
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.
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.
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.
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.
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 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 |
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.
Need to resolve issues preventing tests from being run correctly.
See https://github.com/netojose/laravel-api-explorer.
Mostly just a handy way of documenting routes without having to manually maintain documentation for them.
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.
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.
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.
Need some simple routes to handle logging in (with email and password only) and logging out.
These are markers that a pathway requires this key to traverse it.
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):
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:
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].
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.