This is a repository for a fully-fledged modern forum app, including private messaging, built with Laravel 5.3 and Vue 2.
- @mention functionality, alerting
User
s by email when they are mentioned in a post. Including auto link generation, when aUser
uses the @mention functionality. I.e@ashmenhennett
will be converted to[@ashmenhennett](http://example.com/user/profile/@ashmenhennett)
. - Internal user messaging system, in realtime, using
pusher-js
andLaravl-Echo
. - User role system, including Administrators (
admin
), Moderators (moderator
) and standard Users (user
). - Ability for Administrators to invite new users, with a specific role, as well as the ability to modify current
User
's roles. - Ability for users to subscribe to
Topic
s. - Ability for users to 'report'
Post
s andTopic
s. - Avatar image uploading to Amazon S3 storage.
- Markdown support for creating posts. All posts are stored in database as Markdown and are converted to HTML, when needed
User
s can register and createTopic
s andPost
s.User
s may subscribe to anyTopic
s and may report anyTopic
orPost
for moderation.- Users can @mention other users in
Post
s. - Users can send and receive messages from other users in realtime, via the internal messaging system.
- Owners of
Post
s or eleveatedUser
s may modify or deletePost
s. - Only
admin
andmoderator
accounts may deleteTopic
s. - Users can manage their own profile changing to their password and avatar image.
- All subscribed
User
s recieve emails, via a triggered event when aTopic
that they are subscribed to has aPost
added to it. - Moderators are alerted via email when content is reported. Moderators can easily manage these reports in the Moderator Dashboard.
- Other expected events are raised, check out
App\Events
andApp\Listeners
for further insight. SeeApp\Providers\EventServiceProvider
's$listen
property for the association ofEvent
s andListener
s.
If you would like to install this project, treat it as you would any other Laravel application:
- Clone the repo.
- Install dependencies:
composer install
(also,npm install
, if you need). - Configure environment variables-
.env
(see below). - Generate application key:
php artisan key:generate
. - Run Laravel migrations:
php artisan migrate
.
Make sure you configure these environment variables:
APP_URL
: the url of the application. This variable is used for linking to the application in emails.APP_NAME
: the human readable name of the application. This variable is used for refering to the application via emails. It is also used in the navbar as the application branding.MAIL_FROM_EMAIL
andMAIL_FROM_NAME
: the 'from' email address and name. This is used for sending out emails.S3_KEY
,S3_SECRET
,S3_REGION
,S3_BUCKET_NAME
andS3_IMG_BUCKET_URL
: the conncetion to Amazon S3 variables. These values are used for the avatar uploading facility built in to the application.PUSHER_APP_ID
,PUSHER_KEY
andPUSHER_SECRET
: the connection configuration for thepusher
broadcast driver.
Further steps:
- Set the
QUEUE_DRIVER
environment variable todatabase
. - Set the
BROADCAST_DRIVER
environment variable to the broadcast driver to be used. Set this topusher
if you wish to use the pusher API withLaravel Echo
. - Set the
APP_ENV
environment variable toproduction
when the app is on a live sever, to force HTTPS connections on all routes. - Configure your Amazon S3 bucket with a policy that will allow the application to upload avatars to it.
- Configure the
Laravel Echo
instance inresources/assets/js/bootstrap.js
, starting line 41. - Run
php artisan queue:work
to allow jobs, queued mail and event broadcasting to function.
Note:
This application uses some PHP 7's syntax. Version below 7 is not supported.
There are a couple of commands for use with this application:
- When the 'to-be' Administrator registers for an account, it is necessary to execute the
alter:role
command via command line, after they have registered, passing in the id of theUser
and the role (i.e.admin
). Eg.php artisan alter:role 1 admin
. This is currently the only logical way of elevating a specific user, when no otheradmin
s exist. - The local storage of avatars will have to be cleaned every now and then. To do so, execute the following command
php artisan clear:avatars
. They exist in the application storage, as they are uploaded to the applications storage, before being uploaded to Amazon's S3. They are currently not being automatically deleted from local storage after uploading to S3.
Thanks to Pretty Routes