Commit 5735b5be authored by Olivia Madrid's avatar Olivia Madrid

(feat): document structure of engine, front, and processes

parent c4506a45
No related merge requests found
Pipeline #78144823 canceled with stages
......@@ -8,7 +8,7 @@ These docs were created with [Docusaurus](https://docusaurus.io/).
1. Make sure all the dependencies for the website are installed:
In oss-website\website
In docs\website
```sh
# Install dependencies
......@@ -161,6 +161,10 @@ For more information about the navigation bar, click [here](https://docusaurus.i
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
## Markdown
Docusaurus uses [GitHub flavored markdown](https://guides.github.com/features/mastering-markdown/).
# Full Documentation
Full documentation can be found on the [website](https://docusaurus.io/).
Full documentation can be found on the [docusaurus website](https://docusaurus.io/).
......@@ -3,15 +3,17 @@ id: contributing
title: Contributing
---
You can contribute to Minds with [Gitlab](https://gitlab.com/minds). Please follow the instructions below.
You can contribute to Minds with [Gitlab](https://gitlab.com/minds). Please follow the instructions below. You may wish to familiarize yourself with the terminology and guidelines in [Git/GitLab](guides/git.md) before you get started.
> TODO add DCO/license section
## Creating an issue
### Feature or Bug?
### Feature or bug?
As a rule of thumb, log as a feature request if it does not already exist in the system and log as a bug if something has gone wrong in the system.
### Logging a Bug
### Logging a bug
For all bugs, it is important that you use the bug template when creating an issue and fill it out with as much information as possible. Try not to leave anything missing, especially platform details, and steps to reproduce - else we may have trouble replicating the issue on our end.
......@@ -19,29 +21,34 @@ For all bugs, it is important that you use the bug template when creating an iss
For feature requests, until we have a template in place, you should simply try your best to be as descriptive as possible. If its a visual feature, we welcome mock-ups and even rough sketches in notebooks if they help illustrate your idea.
### Bug Life Cycle
### Bug lifecycle
Bugs generally start off in the bug triage system. The bug triage system allows us to identify and properly document incoming bugs. This means that when they are escalated from (T - Triage) to (T - Bug) label, they should contain the information necessary for a developer to complete the task.
### Labelling
If you have the required permissions, you can label a bug or feature yourself. If this is not possible, please tag a member of staff and we will tag it for you as quickly as possible. If your entry has fallen between the cracks, please post in Help and Support and we will take care of it as soon as we possibly can.
## Priorities
<!-- TODO: check if this link format works? -->
See [Labelling](guides/git.md/#labelling) to learn why and how to label your activities.
| Label | |
| ----- | ----- |
| **`Priority::0 - Urgent`** | These issues will be assigned to the currently running sprint and resolved as soon possible. |
| **`Priority::1 - High`** | To be assigned to the closest appropriate sprint or epic. |
| **`Priority::2 - Normal`** | To be allocated an epic where possible |
| **`Priority::3 - Nice to have`** | a low priority task or issue, potentially good for the community to tackle. |
| **`Priority::4 - Trivial`** | Generally for bugs or minor changes. |
If you have the required permissions, you can apply labels to a bug or feature yourself. If this is not possible, please tag a [member of staff](https://gitlab.com/groups/minds/-/group_members) in a comment on the issue page and we will tag it for you as quickly as possible.
## Progress
If your entry has fallen between the cracks, please post in the [Help & Support](https://www.minds.com/groups/profile/100000000000000681/feed) group and we will take care of it as soon as we possibly can.
| Label | |
| ----- | ----- |
| **`Status::InProgress`** | |
| **`Status::Review`** | awaiting peer review before being made live. |
| **`Status::Follow Up`** | additional information or conversations are needed before progress can be made. |
> TODO: here's how to request permissions to apply labels yourself
## Submitting your Merge Request (MR)
> TODO: acknowledge that you agree to the DCO
> TODO: what permissions does your GitLab account need, and how to get them
- Make sure you follow the activity naming and labelling guidelines in [Git/GitLab](guides/git.md)
## Earn token rewards for contributing
Developers who find bugs or contribute code or documentation may qualify for Minds token rewards. All developer contributions will first be reviewed by the Minds staff to determine if they qualify for a reward.
## Bounties?
> TODO: Bounty label isn't used anywhere... it this ever used?
## More ways to contribute
### i18n/translations
......@@ -39,7 +39,7 @@ Minds is split into multiple repositories:
1. Run `sh init.sh` in order to install the front and engine repositories
2. Run `docker-compose up -d nginx`
3. Run `docker-compose up installer` (one time only.. initial username: minds / password: Pa$$w0rd)
4. Run `docker-compose up front-build`
4. Run `docker-compose up front-build`
5. Navigate to `http://localhost:8080`
## Troubleshooting
......@@ -58,8 +58,8 @@ With dockerized enviroments, it's sometimes best to start from scratch. If you w
```
#Remove your settings file
rm engine/settings.php
rm engine/settings.php
#Stop your stack
docker-compose down
......
......@@ -14,27 +14,28 @@ The backend is split into two main areas, **Core** and **Controllers**.
**Controllers** support both *CLI* and *REST* api's. These are publically exposed as are the public interfaces for the **Core** modules/managers.
>TODO Other areas include:
>TODO Other areas include:
* Common, TODO
* Traits, TODO
```
engine
└───[Core](#core)
│ │
└───Core
│ │
└───[Controllers](#controllers)
│ └───[Cli](#cli)
└───Controllers
│ └───Cli
│ │ └───
│ └───[api](#api)
│ └───api
│ │ └───v1
│ │ └───v2
└───Common
└───Traits
└───Traits
```
# Core
## Abstraction design
......@@ -47,8 +48,7 @@ Modules reside under the `Core` folder and must be registered in `Core\Minds.php
> TODO explain: we're going to use video chat as an example, define video chat [#creating-a-module]
> TODO add diagram here
![Module diagram](/assets/engine-module-diagram.png "Diagram of an example VideoChat module")
![Module diagram](assets/engine-module-diagram.png "Diagram of an example VideoChat module")
### Module building blocks
......@@ -56,12 +56,12 @@ Modules reside under the `Core` folder and must be registered in `Core\Minds.php
#### Essential building blocks:
__**The Model**__ (e.g. `VideoChat.php`)
* the characteristics that define a single unit of whatever content your module is going to handle (e.g. a single video chat)
* you'll want to `use Minds\Traits\MagicAttributes` so you can automatically use get/set/is methods on each of your model's properties
* you'll want to `use Minds\Traits\MagicAttributes` so you can automatically use get/set/is methods on each of your model's properties
* if you'll be using an api endpoint to interact with the front end, include a `public function export() {...}` here so it can be picked up by your controller's `Factory::exportable()` function, (which transforms arrays into an exportable format)
* might include methods for calculating fields based on the repository response
>TO DO: example calculated field
__**The Manager**__ (`Manager.php`)
* interfaces with the repository
* hydrate the entities returned in the response here (if needed)
......@@ -74,7 +74,7 @@ __**The Repository**__ (`Repository.php`)
__**The Provider**__ (`Provider.php`)
* defines a function that registers your Manager to make it available for dependency
* defines a function that registers your Manager to make it available for dependency
injection
......@@ -82,20 +82,20 @@ __**The Module**__ (`Module.php`)
* creates an instance of your Provider and calls its `register()` function. Register your module in `Core\Minds.php`.
#### Optional building blocks:
#### Optional building blocks:
__**Delegates**__
* small, stateless functions that are executed by Managers when something happens that has repurcussions elsewhere in the engine. e.g.:
- `NotificationsDelegate.php`
- `NotificationsDelegate.php`
- `EventsDelegate.php`
#### Test first:
Managers, Repositories and Delegates should have 100% [spec test](#spec-tests) coverage.
Managers, Repositories and Delegates should have 100% [spec test](#spec-tests) coverage.
### Creating a module
For this example, we will create a module called VideoChat that makes use of Dependency Injection Providers.
For this example, we will create a module called VideoChat that makes use of Dependency Injection Providers.
#### Core/VideoChat/Module.php
```php
......@@ -139,7 +139,7 @@ namespace Minds\Core\VideoChat;
class Manager
{
}
```
......@@ -224,14 +224,14 @@ class NotificationDelegate
### Entities
### Runners
To start all runners:
To start all runners:
* `docker-compose up runners`
Runners are resource intensive, so you may wish to run just one, depending on what you're working on. For example:
* `docker-compose exec php-fpm php /var/www/Minds/engine/cli.php QueueRunner run --runner=NotificationDispatcher`.
* `docker-compose exec php-fpm php /var/www/Minds/engine/cli.php QueueRunner run --runner=NotificationDispatcher`
## Spec tests
Minds uses [phpspec](https://www.phpspec.net/en/stable/) and encourages test-first development.
Minds uses [phpspec](https://www.phpspec.net/en/stable/) and encourages test-first development.
Specs are highly abstracted alter-egos of your Manager, Repository and Delegate files that allow you to focus on the bare-bones concepts of what those files will eventually do when they reach their final form (so you can plan effectively before tackling practical technicalities and specifics).
......@@ -246,9 +246,9 @@ bin/phpspec run
To run a specific spec file (or folder), add its name:
```console
```console
bin/phpspec run Spec/Core/VideoChats/Repository.php
```
```
To run a specific test inside of that spec file, add its starting line number:
......@@ -260,7 +260,7 @@ To run a specific test inside of that spec file, add its starting line number:
Runing this command will give you deep output of the testes
```console
bin\phpspec run -vvv
bin\phpspec run -vvv
```
## Writing new tests
......@@ -298,7 +298,7 @@ class ManagerSpec extends ObjectBehavior {
let(Entity $entity) {
//Store a reference to the mock for reuse.
$this->entity = $entity
$this->entity = $entity
}
}
```
......@@ -314,7 +314,7 @@ use Minds\Entities\Entity;
class ManagerSpec extends ObjectBehavior {
public function it_should_run_test(Entity $entity) {
}
}
```
......@@ -335,7 +335,7 @@ willReturn simulates the response of a mocked method
### Getting to the underlying object
Sometimes, php will choke on the reflection of these mocked objects (especially when constructing other objects).
Sometimes, php will choke on the reflection of these mocked objects (especially when constructing other objects).
```php
//This will instantiate an object and still be mockable.
......@@ -347,10 +347,10 @@ Sometimes, php will choke on the reflection of these mocked objects (especially
# Controllers
> TODO
## Cli
## Cli
> TODO
## api
> TODO
* `pages[0]` refers to the parameters that are sometimes added to the end of an api call
* `pages[0]` refers to the parameters that are sometimes added to the end of an api call
......@@ -5,16 +5,17 @@ title: Frontend
> This guide assumes that you have already installed your stack as described [here](getting-started/installation.md)
Minds uses [Angular 8](https://angular.io) for the frontend. Work is currently underway to introduce server side rendering with Angular Universal.
Minds uses [Angular 8](https://angular.io) for the frontend. Work is currently underway to introduce server side rendering with Angular Universal.
The source code can be found [here](https://gitlab.com/minds/front).
The source code can be found [here](https://gitlab.com/minds/front).
## Building
### Development
From the front repository,
`npm run build-dev`
Keep this running while you are editing so your changes will automatically be reflected when you refresh your browser. Note that this doesn't work for stylesheets - when working with .scss files, you'll need to run `gulp build.sass` in minds/front before you can see those changes.
Keep this running while you are editing so your changes will automatically be reflected when you refresh your browser. Note that this doesn't work for stylesheets - when working with .scss files, you'll need to run `gulp build.sass` in minds/front before you can see those changes.
### Production
......
---
id: git
title: Git / Gitlab
title: Git / GitLab
---
> **NOTE:** This guide is mainly intended for the Minds development team. Please see our [contributions guide](contributing/contributing.md) for open source contributors.
## Branches vs Forks
## Useful links
> TODO rename this subheader?
- [Minds Group](https://gitlab.com/groups/minds)
- [What's happening in the current sprint](https://gitlab.com/groups/minds/-/boards)
- [Issues list](https://gitlab.com/groups/minds/-/issues)
- [Milestones (sprints)](https://gitlab.com/groups/minds/-/milestones)
- [Epics](https://gitlab.com/groups/minds/-/epics)
- [Roadmap](https://gitlab.com/groups/minds/-/roadmap)
- [Merge requests](https://gitlab.com/groups/minds/-/merge_requests)
- [Minds Repository]
- [Engine](https://github.com/Minds/engine) - Backend code & APIs
- [Front](https://github.com/Minds/front) - Client side Angular2 web app
- [Sockets](https://github.com/Minds/sockets) - WebSocket server for real-time communication
- [Mobile](https://github.com/Minds/mobile-native) - React Native mobile apps
## Issues
Open an issue before creating a branch or merge request. Tag it with relevant labels such as priority level, squad, related product(s), and status. If the issue is part of an epic, associate the two by going to the epic page and adding the issue to the list.
Issues should have one of the following prefixes:
- (feat):
- (bug):
- (chore):
- (refactor):
- (code review):
> TODO what's up with code review?
> TODO ask can we git rid of the bug/fix naming convention exception and just choose one?
## Branches vs. forks
**Branches** are preferred over forks, as they integrate with the **Review/Sandbox** environments.
Branch names should be no more that **20 characters** long and include one of the following prefixes:
Branch names should be no more that **20 characters** long and include one of the following prefixes AND the related issue number (or epic number, if its an epic):
- **fix/** *(also include the issue number)*
- **chore/** *(also include the issue number)*
- **fix/** (use this prefix for bug issues)
- **chore/**
- **feat/**
- **refactor/**
- **epic/** *(also include the epic number)*
- **epic/**
For example:
- feat/mind-meld-chats-1749
## Merge requests
Include the current sprint name at the beginning of your merge request (MR) title.
- e.g. [Sprint/RockyRaccoon](feat): Mind meld chats
> If your MR requires changes and isn't ready to be merged yet, add a 'WIP: ' at the beginning of its title.
In the description of your MR, ensure that you clearly explain its purpose and reference the original issue #.
- e.g. Allows users to chat telepathically. Users must select a checkbox in channel settings in order to opt-in. Users must be logged in and subscribed to one another in order to be eligible. Not enabled for group chats. Closes issue #1749.
## Labelling
Be sure to tag your issue/epic/MR with as many labels as is relevant. Labels help the community by providing additional, filterable information about what's currently being worked on (and by who), what are the priorities, what's going on within each developer squad, track activity related to a particular product, etc. See the [full list of labels](https://gitlab.com/groups/minds/-/labels) for more examples.
### Creating a label
> TODO is this something that any dev can/should do?
### Type
> TODO is this even used? and if not, why don't we do this instead of all of the '(feat):" stuff in titles?
### Priorities
| Label | |
| ----- | ----- |
| **`Priority::0 - Urgent`** | These issues will be assigned to the currently running sprint and resolved as soon possible. |
| **`Priority::1 - High`** | To be assigned to the closest appropriate sprint or epic. |
| **`Priority::2 - Normal`** | To be allocated an epic where possible |
| **`Priority::3 - Nice to have`** | a low priority task or issue, potentially good for the community to tackle. |
| **`Priority::4 - Trivial`** | Generally for bugs or minor changes. |
### Status
| Label | |
| ----- | ----- |
| **`Status::InProgress`** | |
| **`Status::Review`** | awaiting peer review before being made live. |
| **`Status::Follow Up`** | additional information or conversations are needed before progress can be made. |
### Product
> TODO tasks related to certain areas of subject matter e.g. Groups, Wallet, Blogs, Boost... etc. Usually aligned with modules.
### Platform
> TODO Browser, Mobile, etc...
## Merge Requests
### Triage
> TDOO
Ensure that you clearly explain the purpose of the merge request, and reference the original issue.
\ No newline at end of file
### MR: ...
> TODO
\ No newline at end of file
---
id: glossary
title: Glossary / Examples
---
> **NOTE**: this glossary covers terms that are used in the codebase. For definitions of user-facing functions and features of the site, check out
- [Terms](https://www.minds.com/p/terms)
- [Helpdesk]()
- TODO Something else?
## Content types
__Activity__
> TODO consider structure for this page... in addition to def'ns maybe it should also have copyable example api calls/responses?
__Entity__
......@@ -16,6 +16,9 @@
"Contributing": [
"contributing/contributing",
"contributing/license"
],
"Reference": [
"reference/glossary"
]
}
}
......@@ -21,13 +21,13 @@ const users = [
];
const siteConfig = {
title: 'Minds OSS', // Title for your website.
title: 'Minds Docs', // Title for your website.
tagline: 'The Minds Stack',
url: 'https://docs.minds.io', // Your website URL
baseUrl: '/', // Base URL for your project */
// Used for publishing and more
projectName: 'Minds OSS',
projectName: 'Minds Docs',
organizationName: 'Minds',
// For no header links in the top nav bar -> headerLinks: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment