- Implement the coding challenge requirements as defined
- Extend the requirements making the "Family Mode" feature more complete
- Invite a user
- Accept an invitation
- Reject an invitation
- Write code that is easily maintainable, readable, testable, understandable
- Use a time series datastore for metrics
- Make for minimal code changes when switching to a different datastore
- Demonstrate some level of devops competence
It is recommended to install PhpStorm, or similar environment, in order to facilitate easier code review and tracing. It is available as a free 30-day trial. https://www.jetbrains.com/phpstorm/download/
- Docker
- PhpStorm (recommended)
Spin up docker containers and initialize the application
chmod a+x setup-environment.sh
./setup-environment.sh
- Open
<root>/docker/influxdb/config/influx-configs
- Copy token value from line similar to
token = "VB_LSJOw1spqi577hGhZDcngDK0pLPOjcEKrgPphiaF5xonbZX6TOQnupwcKPCYPB3v_DOHH03dzvEnlSXwT6Q=="
excluding"
- Open
<root>/.env
- Add token value to
INFLUXDB_TOKEN=
Now we should be ready to populate the datastores
chmod a+x setup-data.sh
./setup-data.sh
The password for all generated user accounts is password
- Application code is decoupled from the underlying framework
- API endpoints and corresponding code are versioned
- Domain operations are reusable functional classes
- Intended to make forming new logic easy and straight forward without duplicating code
- Dependencies injected and easily mocked
- Simplifies unit testing since there is only 1 function per, instead of large service classes
- Domain actions bring together operations forming application/business logic used as a
- Controller
- Command
- Dependency in another action
The best place to start digging in is in the seeder file. It best demonstrates how the code I wrote works, aside from a presentation, and is the easiest way to trace into the code base.
<root>/database/seeders/DatabaseSeeder.php
Additionally, certain interfaces and classes need to be bound to the framework instance container and those bindings can be found in:
<root>/app/EightSleep/Provider.php
Here are the critical file paths to help you focus and review the code I generated instead of framework code
<root>/storage/logs
// Integration code specifically for the Laravel framework
<root>/app/EightSleep
// Migrations are timestamped and in time order
// All migrations prior to 2023_08_25_103343_create_linked_user_accounts_table.php were generated by the framework
<root>/database/migrations
// Application code I wrote specifically for this engineering challenge
<root>/eight-sleep/App
// Custom framework code I wrote to decouple application code from an underlying framework
<root>/eight-sleep/Framework
// API Route Definitions
<root>/routes/api.php
// I used UI starter package to sleep things along
// The following are the files I modified/created that related to challenge
<root>/resources/js/Pages/Dashboard.vue
<root>/resources/js/components/LoadApiToken.vue
<root>/resources/js/components/LoadUserData.vue
<root>/resources/js/components/SleepHeartRate.vue
<root>/resources/js/components/SleepInterval.vue
<root>/resources/js/components/SleepScore.vue
<root>/resources/js/components/SleepStages.vue
<root>/resources/js/components/SleepTemperature.vue
<root>/resources/js/components/SleepTossAndTurn.vue
- Setup a development environment using Docker containers define using
docker-compose.yml
- php
- nginx
- influxdb
- sqlserver
- memsql (now single store)
- Implement a backend that satisfies the challenge requirements
- Implement a frontend that satisfies the challenge requirements
- Do the whole thing again in C# to show how awesome I am
- NOTE: Because C# is my favorite language and I wanted to dust off the rust