The mini application sends push notifications to all users by country. The push notification contains a title and a message. It sends to the user's device by device token. There are 3 "actions" in the application:
send
saves the push notification in the database and puts it in the queue. We send push notifications by CRON action.details
displays detailed information about the push notification.cron
sends the push notification(s) to 100K devices.
- Create the necessary tables to save and send push notifications.
- Implement App\Controllers\PushNotificationController->sendByCountryId()
- Implement App\Controllers\PushNotificationController->details()
- Implement App\Controllers\PushNotificationController->cron()
- The user can have multiple devices.
- The device token can be expired (expired = 1).
- The cron action runs automatically every minute. So it's 100k devices per 1 minute.
- Use App\models\PushNotification::send() to send a push notification. It returns random value true/false.
- Read the documentation to understand the task: {project}/documentation/index.html
- Use the postman collection for testing: {project}/postman_collection.json
- Feel free to ask about anything if the task is not clear.
PHP 7.4+, PDO and no frameworks/libraries/wrappers, only your code and SQL queries. The app should not only work, but also work fast and safely. Think about the optimization.
- Clone the repo:
git clone https://x-token-auth:ATCTT3xFfGN0MvdiqxwZy89g4Sx7ppHHLbxsArNIux8A_r1YhbNmDqf3ZMy-ZTXx8U8yAMrlcv9YWbwb9Lx9HmXE_5hlnVJYeNdGXE_NqZvHgPfSEd1izqYiaLRE9AopCQF3WQw1UDTrDL3Ru8vmR72Zsw9YMNhwHkHFpk8IK6I00_4r_rrcgcc=08E86936@bitbucket.org/levantsoft/push-notifications.git
- Install:
composer install
- Create and configure .env file:
cp .env.example .env
- Run migrations and fill your database:
vendor/bin/phinx migrate
vendor/bin/phinx seed:run -s CountriesSeeder -s UsersSeeder -s DevicesSeeder
Send a link of your repository to [email protected] when you're done. Let us know how many hours you spent on this task.