Getting the Source
------------------
The source code of coreERP is published on github. Please refer to the `git - Quick Start Guide` to configure git and understand its basic commands.
There is also an excellent article on best practices `A successful git branching model _`.
Register on `github ' _ and fork the coreERP repo: **vspl-develop-manager/coreERP-develop**.
Clone git repository
~~~~~~~~~~~~~~~~~~~~
Create a new folder in your home directory on your local machine. We name it `gitWorkFolder`. Clone your newly forked github repository into this folder.
Please refer to **git - Quick Start Guide** to familiarise yourself with git concepts and commands.
After having successfully created a clone of the git repository on your local machine, we need to publish the application in apache.
The following would be the typical folder structure
.. code-block:: php
coreERP-stable
|-- CoreWebApp #application shell that needs to be published in apache
|-- CoreWebBase #core name-space with all the source
|-- CoreReportServer #report server that needs to be published in tomcat
|-- docs #Contains all the user and developer guides
Publishing in apache
~~~~~~~~~~~~~~~~~~~~
We will first unzip the vendor files ::
$ cd ~/gitWorkFolder/coreERP-develop/CoreWebApp/vendor
$ sudo tar zxvf vendor.tar.gz
This would decompress all the files required in vendor. We proceed to fix the file access rights ::
$ cd ..
$ sudo chmod -R 755 vendor #This ensures that all files are read and execute only
Let us create the symbolic links to the application. This would be inside lampp folder where xampp was installed.
Create a symbolic link in apache ::
$ cd /opt/lampp/htdocs/
$ sudo ln -s ~/gitWorkFolder/coreERP-develop/CoreWebApp CoreWebApp
:Note:
This folder is now published as an application in apache
Create a symbolic link between CoreWebApp and CoreWebBase/core ::
$ cd ~/gitWorkFolder/coreERP-develop/CoreWebApp
$ sudo ln -s ~/gitWorkFolder/coreERP-develop/CoreWebBase/core core
:Note:
The source core is now available to the web application
We need to provide write access to some of the folders in CoreWebApp. This is where the runtime rendering files are cached. ::
$ sudo chmod 777 runtime
$ cd web
$ sudo chmod 777 assets
Editing the config file
-----------------------
Connection to the database is managed via config file. coreERP has ``sample.xconfig`` file located in ``CoreWebBase\core``.
this file cannot be used directly. We need to create a copy of this file in the root folder of apache where the coreERP site is published.
This file is in xml format and you can edit it using any text editor.
Creating a copy of sample.xconfig ::
$ cd /opt/lampp/htdocs
$ sudo cp ~/gitWorkFolder/coreERP-develop/CoreWebBase/core/sample.xconfig core.xconfig
.. warning::
coreERP would read this file **only** if it is in the root folder of the published site or the virtual path of the virtual site.
Preview of the file
.. code-block:: php
127.0.0.1
coreadmin
core3cret
main
postgres
tiger123
Edit the file as follows: ::
$ sudo nano core.xconfig
If you have a development database already setup, enter the credentials of that database.
To setup a new development database, do the following:
- Set the value for *suPass*. coreERP installation would use the *suName* and *suPass* to create a new login/role in postgreSQL
- Set the value for *pgPass*. This is the password you had set while configuring *postgres* user according to **Server Setup Guide**
- Save (ctrl+o), *Enter*, exit (ctrl+x).
Open a browser and go to the following link: ``http://localhost/CoreWebApp/web``. See if you get the login screen.