Your application should be considered as a part of a big project, so don't use simple scripts and consider using a proper framework (of your choice though). No need to try to introduce any optimizations in advance, the idea of the task is to make an example of your very best code with the very best design/architecture. Tests are required. Front-end will not be considered.
No authentication is required — all actions can be done by guests. You need to add ability to add a message, show all messages, show leaderboard of most active authors.
- app can be ran using PHP7.4
- every posted message has:
content
which can contain any text,author
field of email format and statuspublished/draft
- next pages are required:
/
is the index page showing all published messages/add
is the page to add a message having three fields:content
,author
, andstatus
flag/checkbox/leaderboard
is a list of top-10 authors (published messages counted only) and top-10 writers (status is not accounted)
You can implement pages either as server-generated html or as API endpoints. Using DDD/CQRS is appreciated.