Verified Commit 7ed2e717 authored by Alan Poulain's avatar Alan Poulain
Browse files

Doc fixes

parent 69be3c1f
Coding Coventions
===============
Coding Conventions
==================
Naming Convention
-----------------
Php
- Folder : UperCamelCase
- Classes : UpperCamelCase
PHP
- Folder: UperCamelCase
- Classes: UpperCamelCase
Html (twig templates), Javascript/TypeScrpits and CSS
- folder : dashed-case
- files-names : dashed-case
HTML (twig templates), JavaScript/TypeScript and CSS
- Folder: dashed-case
- Filenames: dashed-case
Javascript
- Classes : UpperCamelCase
- functionName : lowerCamelCase
- variables : lowerCamelCase
JavaScript
- Classes: UpperCamelCase
- functionName: lowerCamelCase
- variables: lowerCamelCase
Html/CSS
- classes-and-ids : dashed-case
HTML/CSS
- Classes-and-ids: dashed-case
Curly Bracket
-------------
Line return after functionName and parameters
Line return after functionName and parameters:
```
myFunction(myParameter)
{
......@@ -31,18 +32,18 @@ myFunction(myParameter)
}
```
Or inline function delcaration `function() { return foo; }`
Or inline function declaration `function() { return foo; }`
Code Indentation
----------
----------------
Always use 3 spaces for indentation of code blocks
Spaces Around Operators
----------------------
-----------------------
Always put spaces around operators ( = + - * / ), and after commas:
```
var x = y + z;
var values = ["Volvo", "Saab", "Fiat"];
......
Contributing
=======
============
Always create a branch for your specific purpose (exple : "feature-share", or relative to particuliar issue : "issue-#456-bug-in-geocoder")
Always create a branch for your specific purpose (example: "feature-share", or relative to particular issue: "issue-#456-bug-in-geocoder")
When you're done with your work, create a pull request and wait for the validation by the administrator
When you're done with your work, create a merge request and wait for the validation by the administrator.
Please comment as possible your work !
\ No newline at end of file
Please comment as possible your work!
Installation and Production Instructions
========================================
*Last update : 2019/01/04*
Feel free to add some more information if you solve installation issues!
Feel free to add some more informations if you solve installation issues !
Quick install
Quick Install
-------------
- **Debian script**: there is a script for debian installation named install_debian.sh in this docs directory ! After installation, go to http://localhost/GoGoCarto/web/app_dev.php/project/initialize to initialize your project.
- **Debian script**: there is a script for Debian installation named `install_debian.sh` in this docs directory! After installation, go to `http://localhost/GoGoCarto/web/project/initialize` to initialize your project.
- **Docker containers**: please follow the instructions [here](installation_docker.md).
Requirements
------------
1. Php (Sur Linux : php7.2-curl)
1. PHP 7
2. [Composer](https://getcomposer.org/download/)
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
5. Web Server (Apache, Ngninx, [Wamp server](http://www.wampserver.com/) ...)
5. Web Server (Apache, Nginx, [Wamp server](http://www.wampserver.com/) ...)
6. MongoDB (http://php.net/manual/fr/mongodb.installation.php) -> !!Version 3.4 or below!!!
The project is using php5. **If you want to use php7**, you will need to install the [MongoPhpAdapter](https://github.com/alcaeus/mongo-php-adapter)
To do so, please run :
```
composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter
```
Consider the [Docker installation](installation_docker.md) if you run into troubles installing these softwares.
Installation
------------
### Cloning repo (clone dev branch)
```
### Cloning Repository (clone dev branch)
```shell
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
git clone https://gitlab.adullact.net/pixelhumain/GoGoCarto.git
cd GoGoCarto/
```
### Installing dependencies
Php dependency (symfony, bundles...)
```
### Installing Dependencies
PHP dependencies (Symfony, bundles...)
```shell
composer install
```
*During installation, app/config/parameters.yml file will be created, leave default fields*
Workflow dependencies (compiling sass and javascript)
```
Workflow dependencies (compiling SASS and JavaScript)
```shell
npm install gulp
npm install
```
Start
-----
Dumping assets
Create an `.env.local` file containing:
```
php bin/console assets:install --symlink web
MONGODB_URL=mongodb://localhost:27017
```
First build of Javascript and Css
Dump assets:
```shell
php bin/console assets:install --symlink web
```
First build of JavaScript and CSS:
```shell
gulp build
```
Start watching for file change (automatic recompile)
```
Start watching for file change (automatic recompile):
```shell
gulp watch
```
Generate Database
-----------------
Go to symfony console : http://localhost/GoGoCarto/web/app_dev.php/_console
Run the followings command
```
Go to Symfony console: `http://localhost/GoGoCarto/web/_console`
Run the followings command:
```shell
doctrine:mongodb:schema:create
doctrine:mongodb:generate:hydrators
doctrine:mongodb:generate:proxies
doctrine:mongodb:fixtures:load
```
The last command will generate a basic configuration
The last command will generate a basic configuration.
Then generate if necessary random points on the map:
Then generate if necessary random point on the map :
```shell
app:elements:generate 200
```
Now initialize your project with the following route:
Now initialize your project with following route
http://localhost/GoGoCarto/web/app_dev.php/project/initialize
`http://localhost/GoGoCarto/web/project/initialize`
Updating your install
Updating your Install
---------------------
Each time you want to update GoGoCarto, run the following script
```
Each time you want to update GoGoCarto, run the following script:
```shell
sh deploy.sh
```
You can have a look to [the CHANGELOG](../CHANGELOG.md) to know what are the new functionalities
You can have a look to [the CHANGELOG](../CHANGELOG.md) to know what are the new features.
Production
----------
1. Dump assetic in symfony console to update the web/templates files
```assetic:dump```
1. Dump assets in Symfony console to update the web/templates files:
```
assets:install web
```
2. Generate compressed JS and CSS files:
2. Generate compressed js and css files
```
gulp build
gulp production
```
3. enable gz compression in your web server
3. Enable gz compression in your web server.
4. In the distant console (http://yoursite.com/web/_console):
4. In the distant console (http://yoursite.com/web/app_dev.php/_console)
```
cache:clear --env=prod
```
5. Make sure that the var folder is writable ```chmod -R 771 var/```
5. Make sure that the var folder is writable `chmod -R 771 var/`.
Issues
-------
If you creating an element you ahev the issue "cannot load method bcmod from namespace ..."
You need to install the bc-math module
If when you create an element you have the issue "cannot load method bcmod from namespace ...",
you need to install the bc-math module:
```
sudo apt install php7.0-bcmath
sudo apt install php7.3-bcmath
```
If memory limits while using composer
```
If memory limits while using Composer:
```shell
COMPOSER_MEMORY_LIMIT=-1 composer ...
```
\ No newline at end of file
```
......@@ -9,10 +9,8 @@ With the Docker installation, you have all the required softwares installed in t
* Run `docker-compose up` to launch the containers.
* Enter the `gogocarto` container with this command: `docker exec -it gogocarto bash`
* Enter the `gogocarto` container with this command: `docker-compose exec gogocarto bash` or `docker exec -it gogocarto bash` (you can execute this one anywhere)
* Run `./post_install.sh` from within the `gogocarto` container. This will launch all the required commands to finish the installation.
* **Warning**: During the `composer install`, when the script asks you for the parameters value, use `mongodb://mongo:27017` for the `mongodb_server` config instead of the default `mongodb://localhost:27017` value.
* Go to `http://localhost/app_dev.php/project/initialize` to initialize the project.
\ No newline at end of file
* Go to `http://localhost/project/initialize` to initialize the project.
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