Skip to content
Snippets Groups Projects
Commit 3a003feb authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Adds documentations files

- Installation instructions
- Project structure
- Coding conventions
parent 21d21750
No related branches found
No related tags found
No related merge requests found
MonVoisinFaitDuBio MonVoisinFaitDuBio
================== ==================
Feel free to add some more informations if you solve installation issues ! CartoV3
=======
Requirements Overview
------------ --------
1. Php We are developing a collaborative directory mapping app.
2. [Composer](https://getcomposer.org/download/)
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
5. Serveur Php ([Wamp server](http://www.wampserver.com/) for example)
6. Any Text Editor (SublimeText for example)
Installation helper (in french) : The main functionalities are
- Displaying data entries
- Free and smooth navigation on the map
- Filter the results, search for a particular location or data
- Ability to everyone to contribute adding/editing/deleting data
- Export data service (API and IFrame)
1. [Openclassroom "Vérifier l'installation de PHP en console"](https://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-symfony2/symfony2-un-framework-php) First we gonna develop this directory for the project "Près de chez vous", consisting on mapping food/education/health/... alternatives in France.
2. [Openclassroom "Installer composer et git"](https://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-symfony2/installer-un-bundle-grace-a-composer)
Then the goal is to make this application accessible to everyone, with a configuration panel to fit their needs.
Installation
------------
### Cloning repo Documentation
``` -------------
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
git clone https://github.com/Biopenlandes/CartoV3.git
cd CartoV3/
```
### Installing dependencies - [Installation intructions](docs/installation.md)
Php dependency (symfony, bundles...) - [Project structure](docs/project-structure.md)
``` - [Coding conventions](docs/coding-conventions.md)
php path-to/composer.phar install or composer install \ No newline at end of file
```
*During installation, config/parameters file will be created, provide database infos or leave default fields*
Workflow dependencies (compiling sass and javascript)
```
npm install -g gulp
npm install
```
Start
-----
Dumping assets
```
php bin/console assets:install --symlink web
```
First build for Javascript and Css
```
gulp build
```
Start watching for file change (automatic recompile)
```
gulp watch
```
Generate Database
-----------------
Lauch php server
Go to PhpMyAdmin and create a database
Change app/config/parameters.yml with database name you juste created, and enter database login information (by default user:"root", password:"null")
Go to symfony console : http://localhost/PagesVertes/web/app_dev.php/_console
```
doctrine:schema:update --force
doctrine:fixtures:load
```
Then generate if necessary random point on the map :
http://localhost/cartoV3/PagesVertes/web/app_dev.php/acteurs/generate/500
Everthing is ready, enjoy :
http://localhost/PagesVertes/web/app_dev.php
Production
----------
1. Generate compressed js and css files
```gulp production```
2. Move files to distant Server (FTP or other)
3. In the distant console (http://yoursite.com/web/app_dev.php/_console)
```
cache:clear --env=prod
assetic:dump --env=prod
```
Coding Coventions
===============
Naming Convention
-----------------
Php
- Folder : UperCamelCase
- Classes : UpperCamelCase
Html (twig templates), Javascript/TypeScrpits and CSS
- folder : dashed-case
- files-names : dashed-case
Javascript
- Classes : UpperCamelCase
- functionName : lowerCamelCase
- variables : lowerCamelCase
Html/CSS
- classes-and-ids : dashed-case
Curly Bracket
-------------
Line return after functionName and parameters
```
myFunction(myParameter)
{
// stuffs
}
```
Or inline function delcaration `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"];
```
Installation and Production Instructions
========================================
Feel free to add some more informations if you solve installation issues !
Requirements
------------
1. Php
2. [Composer](https://getcomposer.org/download/)
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
5. Serveur Php ([Wamp server](http://www.wampserver.com/) for example)
6. Any Text Editor (SublimeText for example)
Help (in french) :
1. [Openclassroom "Vérifier l'installation de PHP en console"](https://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-symfony2/symfony2-un-framework-php)
2. [Openclassroom "Installer composer et git"](https://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-symfony2/installer-un-bundle-grace-a-composer)
Installation
------------
### Cloning repo
```
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
git clone https://github.com/Biopenlandes/CartoV3.git
cd CartoV3/
```
### Installing dependencies
Php dependency (symfony, bundles...)
```
php path-to/composer.phar install or composer install
```
*During installation, config/parameters file will be created, provide database infos or leave default fields*
Workflow dependencies (compiling sass and javascript)
```
npm install -g gulp
npm install
```
Start
-----
Dumping assets
```
php bin/console assets:install --symlink web
```
First build of Javascript and Css
```
gulp build
```
Start watching for file change (automatic recompile)
```
gulp watch
```
Generate Database
-----------------
Lauch php server
Go to PhpMyAdmin and create a database
Change app/config/parameters.yml with database name you juste created, and enter database login information (by default user:"root", password:"null")
Go to symfony console : http://localhost/PagesVertes/web/app_dev.php/_console
```
doctrine:schema:update --force
doctrine:fixtures:load
```
Then generate if necessary random point on the map :
http://localhost/cartoV3/PagesVertes/web/app_dev.php/acteurs/generate/500
Everthing is ready, enjoy :
http://localhost/PagesVertes/web/app_dev.php
Production
----------
1. Generate compressed js and css files
```gulp production```
2. Move files to distant Server (FTP or other)
3. In the distant console (http://yoursite.com/web/app_dev.php/_console)
```
cache:clear --env=prod
assetic:dump --env=prod
```
Project Structure
=================
Html files (Twig templates) `app/Ressources/views`
Config `app/config`
Backend sources (symfony-bundles organization) `src/Biopen/XXXBundle`
Javascript/TypeScript sources `src/front-end/js`
Javascript compiled folder `web/js`
SCSS sources `serc/front-end/scss`
CSS compiled folder `web/assets/css`
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment