alexkr / friendly
Simple friendship service based on PHP + Neo4j
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=5.5.0
- bdemirkir/slim-json-view: 0.1.1
- danielgsims/php-collections: ^1.4
- everyman/neo4jphp: dev-master
- monolog/monolog: ^1.17
- oscarotero/psr7-middlewares: ^3.10
- slim/slim: ~3.1
Requires (Dev)
- codeception/codeception: ^2.1
- fzaninotto/faker: v1.5.0
- squizlabs/php_codesniffer: ^2.5
This package is not auto-updated.
Last update: 2024-11-13 18:38:17 UTC
README
Installation
Via composer:
composer create-project alexkr/friendly [destination]
.
Via git:
- Clone this repo
- Run
composer install
- Run
composer bootstrap
orcomposer run-script post-create-project-cmd
Copy source code:
- Fill
config.php
- Run
php initDatabase.php
- Start server with
composer serve
- Enjoy!
Endpoints
- Create user -
POST: /users
- Get friends list -
GET: /users/{%user_id%}/friends
- Get friends of friends list -
GET: /users/{%user_id%}/friendsOfFriends
- Get friends of friends with n-depth list -
GET: /users/{%user_id%}/friendsOfFriends/{%depth%}
- Get friendship requests -
GET: /users/{%user_id%}/friendshipRequests
- Send friendship requests -
POST: /users/{%user_id%}/friendshipRequest
with POST-parameterfromUserId
- Accept friendship requests -
POST: /users/{%user_id%}/friendshipRequest
with POST-parameterfromUserId
- Decline friendship requests -
POST: /users/{%user_id%}/friendshipRequest
with POST-parameterfromUserId
Structure
logs/ - Log output
public/ - Site configuration entry point limits what we expose
tests/ - Codeception tests
src/
Controller/ - Route controllers
Model/ - Data models
Service/ - Service providers
app.php - Primary application
routes.php - Route creation
vendor/ - Composer install directory
config.example.php - Example application config constants
Tests
Change url in tests/api.suite.yml
Run:
composer test
Scripts
Some scripts through composer for easier life.
composer
codecept - shortcut to codecept
test - alias for codecept run
cs - alias for "phpcs --standard=PSR2 src/",
cbf - alias for "phpcbf --standard=PSR2 src/",
serve - starts test server
bootstrap - alias to @post-create-project-cmd