PHP Chat API: Exchange chat messages between users using an API

Recommend this page to a friend!

  Author Author  
Name: uche <contact>
Classes: 2 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz  
This package can be used to exchange chat messages between users using an API.

It provides an API that with function end points to perform operations for implementing a chat system. Currently the API implements operations to:

- Authenticate a chat user
- Send a message from a user to another user
- Retrieve messages for a given user

Details

Backend Chat API

A backend Chat API written in Laravel with these features:

  • Users can send and receive messages
  • Users are authenticated in order to send and retrieve messages using Laravel Passport
  • Uses cache system to increase speed of message retrieval
  • Feature tests written to assert users can login, send messages and retrieve messages

How to use

  • Clone project
  • Run composer install
  • Add .env file and specify credentials for cache and database (if needed)
  • Run php artisan migrate for migrations
  • Run php artisan db:seed to seed users
  • Run php artisan passport:install for laravel passport
  • Test endpoints

Endpoints

  • Login User - /api/auth/login [POST]

    Sample body - { "username":"john", "password":"password" }

  • Send Message - /api/messages [POST] Sample body - { "message":"hello world", "receiver_username":"john" } > This endpoint uses bearer token gotten from login endpoint
  • Retrieve Message - /api/messages [GET] > This endpoint uses bearer token gotten from login endpoint

Testing

Run the feature test - vender/bin/phpunit


  Classes of uche  >  PHP Chat API  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Chat API
Base name: chat_api
Description: Exchange chat messages between users using an API
Version: -
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Web services Web data clipping, SOAP or XML-RPC clients and servers View top rated classes
Group folder image Chat Chating and instant messaging View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageapp (2 files, 7 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (14 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (4 files)
Files folder imageresources (4 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 4 directories)
Files folder imageObservers (1 file)
Files folder imageProviders (5 files)
Files folder imageRules (1 file)
Files folder imageServices (2 files)
  Plain text file Message.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files  /  app  /  Http  
File Role Description
Files folder imageControllers (3 files)
Files folder imageMiddleware (9 files)
Files folder imageRequests (1 file)
Files folder imageResources (1 file)
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file AuthController.php Class Class source
  Plain text file Controller.php Class Class source
  Plain text file MessageController.php Class Class source

  Files folder image Files  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file CheckApiToken.php Class Class source
  Plain text file CheckForMaintenanceMode.php Class Class source
  Plain text file EncryptCookies.php Class Class source
  Plain text file RedirectIfAuthenticated.php Class Class source
  Plain text file TrimStrings.php Class Class source
  Plain text file TrustHosts.php Class Class source
  Plain text file TrustProxies.php Class Class source
  Plain text file VerifyCsrfToken.php Class Class source

  Files folder image Files  /  app  /  Http  /  Requests  
File Role Description
  Plain text file MessageRequest.php Class Class source

  Files folder image Files  /  app  /  Http  /  Resources  
File Role Description
  Plain text file MessageResource.php Class Class source

  Files folder image Files  /  app  /  Observers  
File Role Description
  Plain text file MessageObserver.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file BroadcastServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source
  Plain text file RouteServiceProvider.php Class Class source

  Files folder image Files  /  app  /  Rules  
File Role Description
  Plain text file ValidateUsername.php Class Class source

  Files folder image Files  /  app  /  Services  
File Role Description
  Plain text file CacheService.php Class Class source
  Plain text file MessageService.php Class Class source

  Files folder image Files  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files  /  config  
File Role Description
  Plain text file app.php Class Class source
  Plain text file auth.php Class Class source
  Accessible without login Plain text file broadcasting.php Aux. Auxiliary script
  Accessible without login Plain text file cache.php Aux. Auxiliary script
  Accessible without login Plain text file cors.php Aux. Auxiliary script
  Accessible without login Plain text file database.php Aux. Auxiliary script
  Accessible without login Plain text file filesystems.php Aux. Auxiliary script
  Accessible without login Plain text file hashing.php Aux. Auxiliary script
  Plain text file logging.php Class Class source
  Accessible without login Plain text file mail.php Aux. Auxiliary script
  Accessible without login Plain text file queue.php Aux. Auxiliary script
  Accessible without login Plain text file services.php Aux. Auxiliary script
  Accessible without login Plain text file session.php Aux. Auxiliary script
  Accessible without login Plain text file view.php Aux. Auxiliary script

  Files folder image Files  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (3 files)
Files folder imageseeds (2 files)

  Files folder image Files  /  database  /  factories  
File Role Description
  Plain text file UserFactory.php Class Class source

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file 2019_08_19_000000_...iled_jobs_table.php Class Class source
  Plain text file 2020_06_25_101224_create_users_table.php Class Class source
  Plain text file 2020_06_25_164825_...e_message_table.php Class Class source

  Files folder image Files  /  database  /  seeds  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source
  Plain text file UserSeeder.php Class Class source

  Files folder image Files  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source
  Accessible without login Plain text file robots.txt Doc. Documentation
  Accessible without login Plain text file web.config Data Auxiliary data

  Files folder image Files  /  resources  
File Role Description
Files folder imagejs (2 files)
Files folder imagelang (1 directory)
Files folder imagesass (1 file)
Files folder imageviews (1 file)

  Files folder image Files  /  resources  /  js  
File Role Description
  Accessible without login Plain text file app.js Data Auxiliary data
  Accessible without login Plain text file bootstrap.js Data Auxiliary data

  Files folder image Files  /  resources  /  lang  
File Role Description
Files folder imageen (4 files)

  Files folder image Files  /  resources  /  lang  /  en  
File Role Description
  Accessible without login Plain text file auth.php Aux. Auxiliary script
  Accessible without login Plain text file pagination.php Aux. Auxiliary script
  Accessible without login Plain text file passwords.php Aux. Auxiliary script
  Accessible without login Plain text file validation.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  sass  
File Role Description
  Accessible without login Plain text file app.scss Data Auxiliary data

  Files folder image Files  /  resources  /  views  
File Role Description
  Accessible without login Plain text file welcome.blade.php Aux. Auxiliary script

  Files folder image Files  /  routes  
File Role Description
  Accessible without login Plain text file api.php Example Example script
  Accessible without login Plain text file channels.php Example Example script
  Accessible without login Plain text file console.php Example Example script
  Accessible without login Plain text file web.php Aux. Auxiliary script

  Files folder image Files  /  tests  
File Role Description
Files folder imageFeature (3 files)
Files folder imageUnit (1 file)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files  /  tests  /  Feature  
File Role Description
  Plain text file ExampleTest.php Class Class source
  Plain text file LoginTest.php Class Class source
  Plain text file MessageTest.php Class Class source

  Files folder image Files  /  tests  /  Unit  
File Role Description
  Plain text file ExampleTest.php Class Class source

Download Download all files: chat_api.tar.gz chat_api.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

For more information send a message to info at phpclasses dot org.