Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leblanc-simon/openaddressbook
A very simple address book
https://github.com/leblanc-simon/openaddressbook
Last synced: 4 days ago
JSON representation
A very simple address book
- Host: GitHub
- URL: https://github.com/leblanc-simon/openaddressbook
- Owner: leblanc-simon
- License: wtfpl
- Created: 2014-05-20T23:13:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-15T19:54:45.000Z (over 1 year ago)
- Last Synced: 2023-04-15T21:11:15.819Z (over 1 year ago)
- Language: JavaScript
- Size: 161 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# OpenAddressBook
A very simple address book
## Install
### Dependencies
OpenAddressBook store the datas in [Redis](http://redis.io/). Install it, before.
### Installation
#### Install project
```bash
git clone https://github.com/leblanc-simon/OpenAddressBook.git
cd OpenAddressBook
composer install
cp web/js/config.js.dist web/js/config.js
```#### Configure webserver
Configure your webserver to redirect all nonexistent files to web/api.php.
Example of .htaccess file :```bash
DirectoryIndex index.htmlRewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^(.*)$ api.php [QSA,L]
```#### Configure application
If you want use the click2call, copy ```config/click2call.yml.dist``` to ```config/click2call.yml```,
configure it and activate click2call into the ```web/js/config.js``` (set click2call_enable to true)### Click2Call
Click2Call is available for Ovh, if you have an other provider, create a class implements
\OpenAddressBook\Click2Call\Click2CallInterface and change the class name into the ```config/click2call.yml```
file### Connect to an external source
You can connect OpenAddressBook to an external source. Now, a connector for Odoo already exist.
To connect OpenAddressBook and Odoo
* copy and edit ```config/command.yml.dist``` to ```config/command.yml```
* copy and edit ```config/odoo.yml.dist``` to ```config/odoo.yml```
* run ```bin/console address:retrieve```You can add the command ```bin/console address:retrieve``` into a cronjob to update the database periodically.
To connect OpenAddressBook and another external source
* create a connector class which implements ```\OpenAddressBook\Connector\ConnectorInterface```
* create a item class which implements ```\OpenAddressBook\Connector\ItemInterface```
* copy ```config/command.yml.dist``` to ```config/command.yml```
* edit ```config/command.yml``` to indicate your class into the ```connector``` parameter and edit ```options``` parametersYou can show the ```\OpenAddressBook\Connector\Odoo\Connector``` and ```\OpenAddressBook\Connector\Odoo\Item```
classes for inspiration.### Manage multiple databases
If you want use OpenAddressBook with multiple databases, you can use environment variable `OAB_BD_NAME` :
* Set environment variable in your PHP-FPM configuration
* Or set environment variable in your Apache configuration
* if you use Click2Call, name your parameter file with the `OAB_BD_NAME`, example :
* with `OAB_BD_NAME` equals `otherdb`
* name the parameter file `config/click2call-otherdb.yml`## API
Get all addresses
```bash
GET http://localhost/api/v1/address-books.json
```Get an address
```bash
GET http://localhost/api/v1/address-books/1.json
```Insert an address
```bash
POST -X "name=my-name&phone=+33.3.20.20.20.20" http://localhost/api/v1/address-books.json
```Update an address
```bash
POST -X "name=my-name&phone=+33.3.20.20.20.20" http://localhost/api/v1/address-books/1.json
```Remove an address
```bash
DELETE http://localhost/api/v1/address-books/1.json
```## Thanks to
* http://silex.sensiolabs.org/
* https://github.com/nrk/predis
* http://jquery.com/
* http://phpjs.org/
* http://blog.echarp.org/filterTable
* https://github.com/filamentgroup/tablesaw
* http://fontello.com/ and http://www.entypo.com/
* http://tympanus.net/Development/CreativeButtons/## License
* [WTFPL](http://www.wtfpl.net/txt/copying/)