Skip to content

Commit

Permalink
improved doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanfrancois-glm committed Nov 27, 2017
1 parent 75f8b84 commit c7514ca
Show file tree
Hide file tree
Showing 23 changed files with 1,551 additions and 236 deletions.
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,17 @@ project:
license your work under the same license as that used by the project.
Thanks to https://github.com/necolas for this contributing guidelines.
Thanks to https://github.com/necolas for this contributing guidelines.
## Versioning
Cocorico follows the Semantic Versioning 2 as far as possible:
> Given a version number MAJOR.MINOR.PATCH, increment the:
>
> MAJOR version when you make incompatible API changes,
>
> MINOR version when you add functionality in a backwards-compatible manner, and
>
> PATCH version when you make backwards-compatible bug fixes.
247 changes: 12 additions & 235 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,234 +1,18 @@
# Cocorico

[![Build Status](https://secure.travis-ci.org/Cocolabs-SAS/cocorico.svg)](http://travis-ci.org/Cocolabs-SAS/cocorico)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Latest Stable Version](https://poser.pugx.org/cocorico/cocorico/v/stable.svg)](https://packagist.org/packages/cocorico/cocorico)

Cocorico is an open source platform to create collaborative consumption marketplaces.
You can find more information about this project on [http://www.cocolabs.io](http://www.cocolabs.io).
Cocorico is an open source platform to create collaborative consumption marketplaces - [http://www.cocolabs.io](http://www.cocolabs.io)

This document contains information on how to download, install, and start using Cocorico:
![preview](doc/img/preview1.png)

- [Installation](#installation)
- [Versioning](#versioning)
- [Changes](#changes)
- [Contribute](#contribute)
- [Roadmap](#roadmap)
- [Technical documentation](#technical-documentation)
- [License](#license)
## Installation

# Installation
Please [read this documentation](doc/installation.md)

For Docker see [Docker installation](https://github.com/Cocolabs-SAS/cocorico-docker)

For Windows see [Windows installation](src/Cocorico/CoreBundle/Resources/doc/installation-windows.md)

For Linux see below

## Requirements

### Apache 2 (or Nginx)

Activate following modules

- mod_headers
- mod_rewrite
- mod_ssl

Create your virtual host: [dev virtual host sample](src/Cocorico/CoreBundle/Resources/doc/virtual-hosts.rst)


### MongoDB

#### Install MongoDB

See https://docs.mongodb.com/manual/administration/install-on-linux/

#### Install PHP MongoDB Driver

See http://docs.mongodb.org/ecosystem/drivers/php/

**Note:** *For PHP 7 install mongodb extension and not mongo extension*

#### Start MongoDB

See http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/


### PHP

Install PHP >= 5.6 (tested on PHP 7.1, 5.6)

Activate following extensions:

- curl (>= 7.36)
- intl
- fileinfo
- openssl
- soap
- exif
- mongodb
- imagick
- pdo_sqlite
- pdo_mysql
- opcache

Add the following lines to php.ini:

curl.cainfo = "pathto/cacert.pem"
memory_limit = 256M
upload_max_filesize = 12M (as cocorico.user_img_max_upload_size)
post_max_size = 240M

Set the same php timezone to php and php-cli php.ini file:

date.timezone = UTC
### MySQL

Create your database and your database user

CREATE DATABASE IF NOT EXISTS {DB} DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, REFERENCES ON {DB}.* TO {DBUSER}@localhost IDENTIFIED BY '{DBUSERPWD}'


## Application installation

### Get project sources
Fork Cocorico Git Repository then get sources:

#### From PhpStorm:

- Close all projects
- Menu > VCS > Checkout from VC > Git
- Git Repo: New forked repository address
- Parent Dir: Choose parent of Symfony folder
- Dir name: Symfony
- Menu > File > Open: Symfony folder
- Change Project name
- Activate Symfony2 framework
- Configure automatically namespace root from Event log Dialog box for example

#### From command line:

Go to to your parent "Document Root" directory and clone repository:

cd /var/www/cocorico.dev/
git clone https://github.com/[gituser]/cocorico.git Symfony
### Create services accounts

See [Services account creation ](src/Cocorico/CoreBundle/Resources/doc/services-creation.rst)


### Install composer

If you don't have Composer yet, run the following command in the root folder of your Symfony project:

cd Symfony
curl -s http://getcomposer.org/installer | php

### Install Cocorico dependencies

php composer.phar install

Or to speed up:

php composer.phar install --prefer-dist -vvv

Or in case of error with tarball (slower):

php composer.phar install --prefer-source -vvv

This command will ask you the values of some of your application parameters.
You will find more informations on them in the following chapter.

### Set your application parameters

See `app/config/parameters.yml.dist`

### Configure project

Copy and paste web/.htaccess.dist and rename it to web/.htaccess. (It's configured by default for dev environment).

### Initialize the SQL and NoSQL database

#### SQL database initialisation:

chmod 744 bin/init-db
./bin/init-db php --env=dev
#### MongoDB initialisation:

chmod 744 bin/init-mongodb
./bin/init-mongodb php --env=dev

## Check your System Configuration

Before starting coding, make sure that your local system is properly configured for Cocorico.

Execute the `check.php` script to make sure that your local system is properly configured for Cocorico:

php app/check.php

The script returns a status code of `0` if all mandatory requirements are met, `1` otherwise.

Access the `config.php` script from a browser:

http://cocorico.dev/config.php

If you get any warnings or recommendations, fix them before moving on.

Check security dependencies:

bin/security-checker security:check composer.lock


## Dump assets

php app/console assets:install --symlink web --env=dev
php app/console assetic:dump --env=dev

## Add crons

See [Technical documentation](src/Cocorico/CoreBundle/Resources/doc/index.rst)

## Browsing the Demo Application

Congratulations! You're now ready to use Cocorico.
http://cocorico.dev/

Admin access is here :

http://cocorico.dev/admin/dashboard
super-admin@cocorico.rocks
super-admin

Don't forget to Change your super-admin password.

Enjoy!


# Versioning

Cocorico follows the Semantic Versioning 2 as far as possible:

> Given a version number MAJOR.MINOR.PATCH, increment the:
>
> MAJOR version when you make incompatible API changes,
>
> MINOR version when you add functionality in a backwards-compatible manner, and
>
> PATCH version when you make backwards-compatible bug fixes.

# Changes

[CHANGELOG.md](CHANGELOG.md) list the relevant changes done for each release.

# Contribute
## Contribute

Anyone and everyone is welcome to contribute. Please take a moment to
review the [guidelines for contributing](CONTRIBUTING.md).
Expand All @@ -237,19 +21,12 @@ review the [guidelines for contributing](CONTRIBUTING.md).
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)

# Roadmap

[ROADMAP](ROADMAP.md) list the planned features.
The [ROADMAP](ROADMAP.md) list the planned features.

# Technical documentation
## Changelog

* [General](src/Cocorico/CoreBundle/Resources/doc/index.rst)
* [Parameters](src/Cocorico/CoreBundle/Resources/doc/parameters.rst)
* [Virtual Host](src/Cocorico/CoreBundle/Resources/doc/virtual-hosts.rst)
* [Tests](src/Cocorico/CoreBundle/Resources/doc/tests.rst)
* [Deployment](src/Cocorico/CoreBundle/Resources/doc/deployment.rst)

# License
[CHANGELOG.md](CHANGELOG.md) list the relevant changes done for each release.

Cocorico is released under the [MIT license](LICENSE).
## License

Cocorico is released under the [MIT license](LICENSE).
12 changes: 12 additions & 0 deletions doc/breadcrumbs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Breadcrumbs
===========

You need to add your breadcrumbs in `src/Cocorico/CoreBundle/Resources/content/breadcrumbs.yml`

Format:

route_name:
- text: 'home' # text is translatable it will be extracted to breadcrumbs.en.xliff
route: 'route_name' #JMS I18n translatable
- text: 'list'
path: '#' # it will be non route and non translatable path which will be used directly
69 changes: 69 additions & 0 deletions doc/crons.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Crons
=====

Add this commands to your cron tab and don't forget to set the same PHP timezone "UTC"
in the php.ini file of php and php-cli.

Required
--------

1. Currencies update:

`17 0 * * * php <path-to-your-app>app/console cocorico:currency:update --env=dev`

2. Bookings expiration:

`0 */1 * * * php <path-to-your-app>app/console cocorico:bookings:expire --env=dev`

3. Bookings validation:

`0 */1 * * * php <path-to-your-app>app/console cocorico:bookings:validate --env=dev`

4. Bookings bank wires checking:

`0 */1 * * * php <path-to-your-app>app/console cocorico:bookings:checkBankWires --env=dev`

5. Bookings expiring alert:

`*/15 * * * * php <path-to-your-app>app/console cocorico:bookings:alertExpiring --env=dev`

6. Bookings imminent alert:

`*/15 * * * * php <path-to-your-app>app/console cocorico:bookings:alertImminent --env=dev`

7. Listings calendar update alert:

`0 0 27 * * php <path-to-your-app>app/console cocorico:listings:alertUpdateCalendars --env=dev`


Optionals
---------

1. Listings platform notation computing (Optional. ListingSearchBundle must be enabled):

`30 2 * * * php <path-to-your-app>app/console cocorico_listing_search:computeNotation --env=dev`

2. Accept or refuse bookings from SMS (Optional. SMSBundle must be enabled)

`* * * * * php <path-to-your-app>app/console cocorico_sms:bookings:acceptOrRefuseFromSMS --env=dev`

3. Check phone user from SMS (Optional. SMSBundle must be enabled)

`* * * * * php <path-to-your-app>app/console cocorico_sms:users:checkPhoneFromSMS --env=dev`

4. Alert user if new listings are found (Optional. ListingAlertBundle must be enabled)

`0 3 * * * php <path-to-your-app>app/console cocorico_listing_alert:alertNewListingsFound --env=dev`

5. Generate Sitemap (Optional. ListingSeoBundle must be enabled)

`0 4 * * * php <path-to-your-app>app/console cocorico_seo:sitemap:generate --env=dev`

6. Generate Bookings deposit refund (Optional. ListingDepositBundle must be enabled)

`*/15 * * * * php <path-to-your-app>app/console cocorico_listing_deposit:bookings:generateDepositRefund --env=dev`

7. Check Booking Deposit refund payments (Optional. ListingDepositBundle must be enabled)

`*/15 * * * * php <path-to-your-app> app/console cocorico_listing_deposit:bookings:checkDepositsRefund --env=dev`

Loading

0 comments on commit c7514ca

Please sign in to comment.