Skip to content

duplamatyi/simple-symfony-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Chat Application

  1. Installing the project

First clone this repository to your local machine.

Install the dependencies with composer:

composer install

Make sure that the app/logs, app/cache and db/ directories are writable for both the command line user and the web server user.

Create the sqlite database by running the migrations:

app/console doctrine:migrations:migrate
  1. Running the tests

You can run the tests with PHPUnit:

bin/phpunit -c app/
  1. Managing users

You can create new users and list exising users with the following commands:

app/console chat:user:create user1
app/console chat:user:create user2
app/console chat:user:list
+----+----------+
| id | username |
+----+----------+
| 1  | user1    |
| 2  | user2    |
+----+----------+
  1. Trying out the API

Start PHP's built-in web server:

app/console server:start

Go to the API documentation at http://127.0.0.1:8000/api/doc/ and try out the sandboxes:

Alt screenshot

Or use curl from a terminal:

curl -H "Content-Type: application/json" -d '{"author_id":"1","recipient_id":"2","content":"Hello World!"}' http://127.0.0.1:8000/message/send
curl -H "Content-Type: application/json" http://127.0.0.1:8000/message/get-messages?recipient_id=2

About

A simple chat application written in Symfony.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages