CRMx
CRMx is a super-flexible micro-CRM system for personal, freelance and small businesses. It can be customized very quickly for Customer Relationship Management, Lead Management System, Project Management, To-Do List or any other usage due to its flexibility in customization and scalable code. CRMx allows unlimited users to work in the same or different environments very flexibly. CRMx works through a RESTful API which allows third-party services and other software to interact neatly. CRMx also has a User Access Control system (UAC) to define permissions for each user and have maximum control over the organization.
Install / Use
/learn @luckyshot/CRMxREADME
CRMx
CRMx is a super-flexible micro-CRM system for personal, freelance and small businesses. It can be customized very quickly for Customer Relationship Management, Lead Management System, Project Management, To-Do List or any other usage due to its flexibility in customization and scalable code.
- <strong>RESTful API</strong>: Works through a RESTful API which allows third-party services and other software to interact neatly.
- <strong>Unlimited users & environments</strong>: Allows unlimited users to work in the same or different environments very flexibly (including a User Access Control system (UAC) to define permissions for each user and have maximum control).
- <strong>Simple setup</strong>: Similar to Sublime Text, all the config is done in <code>config.php</code> which keeps the overall code tiny and much easier to maintain and scale.
- <strong>Extremely scalable</strong>: CRMx is extremely small, with one PHP, one JS and one CSS files, with inline comments, you can see the code and start hacking it in 5 minutes. Oh, and you can also create CRMx plugins :)
Screenshots
Table view
From here you have an overall view of your contacts:

Search as-you-type
Type in the search box to start filtering, results update dynamically as you type:

Smart filtering
CRMx detects your custom form field types and adds shortcut lists on the top navigation automatically:

Person view
View a person details, edit them directly and also add timed comments:

Smart links
Buttons appear next to the person fields to email, search Google or Skype-call in one click

Technology
- Limonade PHP micro-framework (inc. <a href="https://gist.github.com/luckyshot/5098146">custom MySQL <i>lemon</i></a>)
- MySQL
- JavaScript / jQuery / JSON
- Twitter Bootstrap (and LESS)
Settings
There is no Settings menu or user accounts, all is done in PHP variables (like Sublime Text) in the <code>config.php</code> file, which makes the code app a lot smaller as well as easy to administer, maintain and scale.
Installation
Open <code>config.php</code> to modify the app settings:
- Type in the MySQL user, password, server and prefix (There is no need to create the MySQL tables, these are created automatically)
- Customize the <code>$form</code> array (see Form field types below for more info)
- Add your <code>$users</code> and their permissions
- If you are installing CRMx in a subdomain:
- Modify the <code>option('base_uri', '/');</code> and add it there (for <code>example.com/crmx/</code> it should be <code>option('base_uri', '/crmx/');</code>, note the trailing slash)
- Do the same in the <code>.htaccess</code> file, uncomment the <code>#</code> and add the subdomain (following the example above it will be <code>RewriteBase /crmx/</code>)
- Open CRMx and type in your user's password. You can also bookmark <code>http://YOURCRMXPATH.com<b>/login/YOURPASSWORD</b></code> so that it autologins you every time.
User accounts
User accounts are created by adding them to the <code>$users</code> PHP array. These are the fields you can customize:
- <strong>name</strong> <small>(string)</small> Full name of the user
- <strong>pass</strong> <small>(string)</small> Add a very long random alphanumeric string of between 100 and 300 characters (the more the better, check <code>is_logged_in()</code> in the code for a generator)
- <strong>level</strong> <small>(string)</small> Add flags to allow users certain privileges
- <strong>r</strong> <i>read</i>: useful when you want an external partner to submit contacts but not be able to access the CRM (i.e. external lead provider)
- <strong>s</strong> <i>save</i>: create and update contacts
- <strong>d</strong> <i>delete</i>: can delete contacts
- <strong>c</strong> <i>comment</i>: can comment on contacts
- <strong>dbprefix</strong> <small>(string)</small> Many users can work in different environments on the same database by using a different table. To do this, just specify a different MySQL prefix here (i.e. <code>sales_</code>)
- <strong>sitename</strong> <small>(string)</small> You can customize the app title for each user
Logging in
There is no login screen in CRMx. Users bookmark a long URL and click on it to login. You should specify a long and unique password (at least 50 characters) for each user and then send them the URL to bookmark, which looks like:
<code>http://crmx.com/login/thesuperlongpassword</code>
Environments
Environments allow users to work on separated CRMx (with their own contacts and form fields) while using the same app. Add that prefix to a user and another array in <code>$form</code>. Simple as that.
Form field types
It's very easy to customize CRMx to your own needs. You just need to modify the <code>$form</code> PHP array in <code>config.php</code> and the app will take care of the rest.
Textbox
Just name and title are needed:
<pre>'name' => 'email', 'title' => 'Email address'</pre>Select dropdown
Specify <code>'type' => 'select'</code> and a list of elements:
<pre>'name' => 'color', 'title' => 'Favorite color', 'type' => 'select', 'list' => array( "Red", Green", "Blue" )</pre>Others formats
You can use other HTML5 form field types like: <code>password</code>, <code>hidden</code>, <code>color</code>, <code>date</code>, <code>datetime</code>, <code>datetime-local</code>, <code>email</code>, <code>month</code>, <code>number</code>, <code>range</code>, <code>search</code>, <code>tel</code>, <code>time</code>, <code>url</code> and <code>week</code>.
<pre>'name' => 'website', 'title' => 'Website URL', 'type' => 'url'</pre>Example
This is how I have my personal CRMx <code>config.php</code> set up:
<pre>$form = array( 'test_' => array( // table prefix // name (default, no need to specify) // title (default, no need to specify) array('name' => 'group', 'title' => 'Group', 'type' => 'select', 'list' => array( "-", "London", "Barcelona")), array('name' => 'type', 'title' => 'Type', 'type' => 'select', 'list' => array( "-", "Partner", "Client", "Lead")), array('name' => 'email', 'title' => 'Email', 'type' => 'email'), array('name' => 'phone', 'title' => 'Phone Number', 'type' => 'tel'), array('name' => 'company', 'title' => 'Company', 'type' => 'search'), array('name' => 'address', 'title' => 'Address', 'type' => 'search'), ), );</pre>Hidden
To skip a form field to show in the main table, set the <code>hidden</code> property to <code>1</code>. This is useful when you have a lot of fields or you want to disable a field you might want to use in the future.
<pre>'hidden' => 1,</pre>Deleting fields
Note that if you remove a field from <code>config.php</code> it will still be in the database and will disappear when that person is updated. If you'd rather not loose any info, set <code>hidden = 1</code> instead of deleting it.
REST API
Home <code>/</code>
Request data (<code>GET</code>)
<i>(none)</i>
Response (<code>HTML</code>)
The home page in HTML format (including the default people and form JSON lists embedded to save server requests).
<hr>Login <code>/login/:pass</code>
Request data (GET)
- <code>pass</code> (string)
Response (<code>JSON</code>)
On success redirects to Home, on fail shows a message.
<hr>Search <code>/search/:q</code>
Searches people for that query and returns a JSON array.
Request data (<code>GET</code>)
- <code>q</code> (string)
Response <code>JSON</code>
<pre>{ "id":"46", "name":"Richard", "form":{ "title":"CEO", // your defined form fields } },{ "id":"37", "name":"Peter", "form":{ "title":"Director", // your defined form fields } }</pre> <hr>Load person <code>/get/:id</code>
You can pass an ID or a name, returns results for a single person (if more than one match returns the most recently modified).
Request data (<code>GET</code>)
- <code>id</code> (string)
Response (<code>JSON</code>)
<pre>{ "id": "46", "name": "Richard", "form": { "title": "CEO", // your defined form fields }, "comments":[ { "user": "Xavi Esteve", "date": "2013-03-24T16:03:19+00:00", "text": "..." } ], "created": "1364140289", "updated": "1364140289" }</pre> <hr>Save person <code>/save</code>
Request data (<code>POST</code>)
- <code>id</code> (string)
Response (<code>JSON</code>)
<pre>{ "status": "success" OR "error", "message": "Contact saved successfully." }</pre> <hr>Delete person <code>/delete</code>
Request data (<code>DELETE</code>)
- <code>id</code> (string)
Response (<code>JSON</code>)
<pre>{ "status": "success" OR "error", "message": "Contact deleted successfully." }</pre> <hr>Add comment <code>/comment</code>
Request data (<code>POST</code>)
- <code>id</code> (integer)
- <code>comment</code> (string)
Response (<code>JSON</code>)
<pre>{ "status": "success" OR "error", "message": "Comment added." }</pre> <hr>Delete comment <code>/comment/:id</code>
Request data (<code>DELETE</code>)
- <code>id</code> (integer)
Response (<code>JSON</code>)
<pre>{ "status": "success" OR "error", "message": "Comment deleted." }</pre>Plugins
With plugins you can add extra functionality to CRMx without needing to modify the core files. Creating plugins is extremely easy and you can run PHP, JavaScript and/or CSS code. To create a plugin,
