-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
265 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,86 @@ | ||
<!-- This uses the MarkdownTOC's Sublime Text plugin to autogenerate the TOC --> | ||
<!-- MarkdownTOC autolink="true" depth="4" --> | ||
|
||
- [Contribute as a developer][contribute-as-a-developer] | ||
- [Testing environment][testing-environment] | ||
- [Setup][setup] | ||
- [Run the test suite][run-the-test-suite] | ||
- [Backend][backend] | ||
- [Things to consider when adding new code][things-to-consider-when-adding-new-code] | ||
- [Add a new table to the database schema][add-a-new-table-to-the-database-schema] | ||
- [Manipulating data during a migration][manipulating-data-during-a-migration] | ||
- [Email testing][email-testing] | ||
- [Email reminders][email-reminders] | ||
- [Statistics][statistics] | ||
- [Database][database] | ||
- [Connecting to mySQL][connecting-to-mysql] | ||
- [Front-end][front-end] | ||
- [Mix][mix] | ||
- [Watching and compiling assets][watching-and-compiling-assets] | ||
- [CSS][css] | ||
- [JS and Vue][js-and-vue] | ||
<!-- MarkdownTOC autolink="true" depth="4" bracket="round" list_bullets="*" --> | ||
|
||
* [Contribute as a developer](#contribute-as-a-developer) | ||
* [Considerations](#considerations) | ||
* [Install Monica locally](#install-monica-locally) | ||
* [Homestead \(macOS, Linux, Windows\)](#homestead-macos-linux-windows) | ||
* [Valet \(macOS\)](#valet-macos) | ||
* [Instructions](#instructions) | ||
* [Testing environment](#testing-environment) | ||
* [Setup](#setup) | ||
* [Run the test suite](#run-the-test-suite) | ||
* [Backend](#backend) | ||
* [Things to consider when adding new code](#things-to-consider-when-adding-new-code) | ||
* [Add a new table to the database schema](#add-a-new-table-to-the-database-schema) | ||
* [Manipulating data during a migration](#manipulating-data-during-a-migration) | ||
* [Email testing](#email-testing) | ||
* [Email reminders](#email-reminders) | ||
* [Statistics](#statistics) | ||
* [Database](#database) | ||
* [Connecting to mySQL](#connecting-to-mysql) | ||
* [Front-end](#front-end) | ||
* [Mix](#mix) | ||
* [Watching and compiling assets](#watching-and-compiling-assets) | ||
* [CSS](#css) | ||
* [JS and Vue](#js-and-vue) | ||
|
||
<!-- /MarkdownTOC --> | ||
|
||
# Contribute as a developer | ||
|
||
Are you interested in giving a hand? We can't be more excited about it. Thanks in advance! Here are some guidelines that could help you to get started quickly. | ||
|
||
The best way to contribute to Monica is to use [Homestead](https://laravel.com/docs/5.3/homestead) as a development environment, which is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. The big advantage is that it runs on any Windows, Mac, or Linux system. | ||
## Considerations | ||
|
||
* Monica is written with a great framework, [Laravel](https://github.com/laravel/laravel). We care deeply about keeping Monica very simple on purpose. The simpler the code is, the simpler it will be to maintain it and debug it when needed. That means we don't want to make it a one page application, or add any kind of complexities whatsoever. | ||
* That means we won't accept pull requests that add too much complexity, or written in a way we don't understand. Again, the number 1 priority should be to simplify the maintenance on the long run. | ||
* When adding a feature, do not introduce a new software in the existing stack. For instance, at the moment, the current version does not require Redis to be used. If we do create a feature that (for some reasons) depends on Redis, we will need all existing instances to install Redis on top of all the other things people have to setup to install Monica (there are thousands of them). We can't afford to do that. | ||
* It's better to move forward fast by shipping good features, than waiting for months and ship a perfect feature. | ||
* Our product philosophy is simple. Things do not have to be perfect. They just need to be shipped. As long as it works and aligns with the vision, you should ship as soon as possible. Even if it's ugly, or very small, that does not matter. | ||
|
||
## Install Monica locally | ||
|
||
### Homestead (macOS, Linux, Windows) | ||
|
||
The best way to contribute to Monica is to use [Homestead](https://laravel.com/docs/homestead) as a development environment, which is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. The big advantage is that it runs on any Windows, Mac, or Linux system. | ||
|
||
This is what is used to develop Monica and what will provide a common base for everyone who wants to contribute to the project. Once Homestead is installed, you can pull the repository and start setting up Monica. | ||
|
||
Note: the official Monica installation uses mySQL as the database system. While Laravel technically supports PostgreSQL and SQLite, we can't guarantee that it will work fine with Monica as we've never tested it. Feel free to read [Laravel's documentation](https://laravel.com/docs/5.5/database#configuration) on that topic if you feel adventurous. | ||
|
||
Steps to install Monica: | ||
### Valet (macOS) | ||
|
||
We've installed the development version with [Valet](https://laravel.com/docs/valet), which is a Laravel development environment for Mac minimalists. It works really well and is extremely fast, much faster than Homestead. | ||
|
||
### Instructions | ||
|
||
**Prerequisites**: | ||
* Git | ||
* [Node](https://nodejs.org/en/) | ||
* PHP 7.0+ | ||
* [Composer](https://getcomposer.org/) | ||
|
||
**Steps to install Monica** | ||
|
||
Once the above softwares are installed (or if you've finished the installation of Homestead/Valet): | ||
|
||
1. `composer install` in the folder the repository has been cloned. | ||
1. `cp .env.example .env` | ||
1. `cp .env.example .env` to create your own version of all the environment variables needed for the project to work. | ||
1. Update `.env` to your specific needs. | ||
1. Run `php artisan key:generate` to generate an application key. This will set `APP_KEY` with the right value automatically. | ||
1. `npm install`. | ||
1. `npm install` to install all the front-end dependencies and tools needed to compile assets. | ||
1. Create a database called `monica` in your mySQL instance. | ||
1. `php artisan key:generate` to generate a random APP_KEY | ||
1. `php artisan setup:test` setup the database. | ||
1. `php artisan setup:test` to setup the database. | ||
1. By default this command will also populate the database with fake data. | ||
1. Use the `-- skipSeed` option to skip the process of adding fake data in your dev environment. | ||
1. `php artisan storage:link` to access the avatars. | ||
1. `php artisan passport:install` to create the access tokens required for the API. | ||
1. `php artisan storage:link` to symlink the avatars of the contacts. | ||
1. Optional: `php artisan passport:install` to create the access tokens required for the API. | ||
|
||
If you haven't skipped the seeding of fake data, we will create two accounts by default: | ||
If you haven't skipped the seeding of fake data, two accounts are created by default: | ||
|
||
* First account is `[email protected]` with the password `admin`. This account contains a lot of fake data that will let you play with the product. * Second account is `[email protected]` with the password `blank`. This account does not contain any data and shall be used to check all the blank states. | ||
* First account is `[email protected]` with the password `admin`. This account contains a lot of fake data that will let you play with the product. | ||
* Second account is `[email protected]` with the password `blank`. This account does not contain any data and shall be used to check all the blank states. | ||
|
||
## Testing environment | ||
|
||
|
@@ -67,7 +98,7 @@ To setup the test environment: | |
|
||
To run the test suite: | ||
|
||
* `phpunit` or `./vendor/bin/phpunit` | ||
* `phpunit` or `./vendor/bin/phpunit` in the root of the folder containing Monica's code from GitHub. | ||
|
||
## Backend | ||
|
||
|
@@ -87,9 +118,10 @@ Emails are an important part of Monica. Emails are still the most significant me | |
|
||
For development purposes, you have two choices to test emails: | ||
|
||
1. You can use [Mailtrap](https://mailtrap.io/). This is an amazing service that provides a free plan that is plenty enough to test all the emails that are sent. 1. If you use Homestead to code on your local machine, you can use [mailhog](https://github.com/mailhog/MailHog) that is built-in. To use it, you first need to start mailhog (`sudo service mailhog restart`). Then, head up to http://localhost:8025 in your browser to load Mailhog's UI. | ||
1. You can use [Mailtrap](https://mailtrap.io/). This is an amazing service that provides a free plan that is plenty enough to test all the emails that are sent. | ||
1. If you use Homestead to code on your local machine, you can use [mailhog](https://github.com/mailhog/MailHog) that is built-in. To use it, you first need to start mailhog (`sudo service mailhog restart`) inside your Vagrant. Then, head up to [http://localhost:8025](http://localhost:8025) in your local browser to load Mailhog's UI. | ||
|
||
If you want to use mailhog, you need the following settings in your `.env` file: | ||
Note: if you want to use mailhog, you need the following settings in your `.env` file: | ||
|
||
``` | ||
MAIL_DRIVER=smtp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.