The application is made up of a React front-end communicating with a simple API that performs the following functions
- Returns previously held engineer names
- Generates and persists a randomized two week rota
- Open a terminal to the web project and navigate to
.\ClientApp\
directory - Execute
npm install
to install the dependencies - F5 to run the application.
Each of the engineers sent to API service get added to a Dictionary<Guid, Engineer>
collection. Due to the random nature of the GUID when calling the Sort
method will randomize the collection.
The collection object is then stored in the fake repository and returned to the React app.
The React app then pushes each of the returned names into the week planner and is then displayed twice.
Day | Position in dataset | Position in dataset |
---|---|---|
Monday | 1 | 2 |
Tuesday | 3 | 4 |
Wednesday | 5 | 6 |
Thursday | 7 | 8 |
Friday | 9 | 10 |
Monday | 1 | 2 |
Tuesday | 3 | 4 |
Wednesday | 5 | 6 |
Thursday | 7 | 8 |
Friday | 9 | 10 |
If you're in position 1 of the returned dataset then you get allocated to Monday AM slot, position 2 and you're allocated to Monday PM etc.
- The application is designed for 10 engineers, any more will mean some may not be allocated a shift, any less and gaps will appear in the schedule.
- Week one is repeated into week two, this meets the requirements without complicated logic.
This application can be hosted using Azure Static Websites and API requests proxied to an Azure Website host.