A fun and lightweight Python + web project to gamify your study routine using a deck of cards. Let chance decide your focus and break durations — with a clean web UI powered by AWS Lambda.
| Path | Purpose |
|---|---|
frontend/ |
Single-page UI (HTML + Tailwind) |
lambda/ |
AWS Lambda backend (Python) |
randomised_sessions.py |
Local Python script (CLI use) |
The project is based on a simple concept:
- Draw a card from a deck to determine your study session length.
- Draw another card to determine your break length.
The card values are mapped to time using simple algebraic formulas to ensure your sessions and breaks fall within a healthy range. The final calculated duration is rounded to the nearest multiple of 5 minutes for simplicity.
| Card | Value |
|---|---|
| Ace | 1 |
| 2–10 | 2–10 |
| Jack | 11 |
| Queen | 12 |
| King | 13 |
- Study Session (S): Your session will be between 45 and 100 minutes.
S = 45 + (
Where
- Break Duration (B): Your break will be between 10 and 20 minutes.
B = 10 + (
Where
A responsive single-page app (SPA) with Tailwind UI and card image previews.
- Calls AWS Lambda via API Gateway.
- Gets card name + suit + calculated durations.
- Dynamically fetches card images using:
https://deckofcardsapi.com/static/img/{CODE}.png
open frontend/index.htmlOr check the live version:
🔗 https://study.eishaenan.com
You only need Python installed on your computer.
-
Clone the repository:
git clone https://github.com/EishaEnan/randomised-sessions.git cd randomised-sessions -
Run the script:
python randomised-sessions.py
The script will automatically draw both cards and print your session and break times.
--- Let's get focused! ---
Your study card is: 8!
Your session will be: 75.0 minutes.
Your break card is: Queen!
Your break will be: 20.0 minutes.
The Lambda function (see lambda/lambda_function.py) returns JSON:
{
"study_card_name": "Jack",
"study_card_suit": "Spades",
"study_duration": 90.0,
"break_card_name": "3",
"break_card_suit": "Hearts",
"break_duration": 10.0
}It does not fetch images — only calculates values.
The frontend handles the display and image loading.
This project is licensed under the MIT License.