---
# System prepended metadata

title: THE IDEA

---

# THE IDEA
Make a system which kills the friction between people coming to cafes and playing, people can book their slots and just come and get to it.

From the cafe owners' perspective, an easy to use system which allows them to manage their whole setting - lets them keep track of bookings, helps them publicize and reach out. 

Make everybody win.

---

# DB Architecture
## Needed collections -
1. **cafe_meta_info** - stores meta info like systems available, address, contact details etc (list of meta_info objects with each object corresponding to a cafe)

    ```
    [{
        "cafe_id" : ""
        "cafe_name" : "Starks Gaming Cafe"
        "contact_info" : {},
        "games_available": ["","",..], //list of ids of games available from games collection
        "systems": ["","",...], //list of ids of systems from systems collection
        "opening_time":datetime value,
        "closing_time":datetime value
    }]
    ```
    > we should have a field as list for 'open_on_days'
    > and then an object 'timings' for open days
    > Example:
    ```
    {
        "open_on_days": ['mon', 'tue'],
        "timings": {
            "mon": {
                "opening_time":datetime value,
                "closing_time":datetime value
            }
        }
    }
    ```
     ##### - contactinfo - cafe's contact info
      ###### contact_info - 
           {
                "address":"building 303, 2nd floor Indiranagar, Bangalore",
                "phone_number":"",
           }
           
> address should be object with postal, city, state, pincode fields and geospatial data which can be referenced directly with G maps. Reference: https://docs.mongodb.com/manual/geospatial-queries/#geospatial-geojson
>
> Phone should also be an object with one key 'primary' and value a string and another key as 'others' which is a list.

2. **games** - list of objects of games available
      ###### game object - 
            [{
                "game_id" : "123-sadas",
                "game_name": "PLAYTERUNKNOWNS BATTLEGROUNDS",
                "developer": "RIOT GAMES",
                "description": "some writeup about the game, maybe first line of wikipedia
            }]
            
## Station Model

#### ==cafe_id== ==> ref to 'cafes' collection

#### ==type== ==> (TBD - Configurable field)

enum = ["PS2", "PS3", "PS4", "XBOX360", "XBOX1", "XBOX1S", "XBOX1X", "PC"]

#### configuration (mandatory for pc)

```
{
    CPU: "i7",
    GPU: "2080Ti",
    MonitorRR: "300"
}
```

#### ==games== List of below objects
```
[
    ref to 'games' collection //list of strings of game_ids
]
```

<!-- #### ==supports_addons== default False (can be true for consoles) -->

<!-- #### ==cost== (TBD - Configurable depending on number of hours slots)
```
    {
        ""
    }
``` -->

#### ==station_cost== Number

#### addons
```
[
    {
        type: "controller",
        cost: Number
    }
]
```

3. **systems** - list of objects of systems 
    ###### system object - 
        {
            "cpu":{
                "brand":"amd",
                "trade_name":"ryzen 5 3600x",
                "model":"3600x",
                "series":"ryzen",
                "clock_speed": 4,
            },
            "gpu":{
                "brand":"nvidia",
                "trade_name":"gtx 1060",
                "model":"1060",
                "vram": 6,
            },
            "monitor":{
                "brand":"msi",
                "refresh_rate": 144,
                "model":"optix 241cr",
                "size":24.2
            },
            "mouse":{
                "brand":"logitech",
                "model":"g403"
            },
            "keyboard":{
                "brand":"kingston hyperx",
                "model":"alloy elite",
                "type":"mechanical",
                "backlit":"rgb"
            },
            "headset":{
                "brand":"corsair",
                "model":"void pro"
            },
            "coupons":{
                "coupon_code":"",
                "percentage":"", //% of discount
            }
            "cost_per_hour":100,
            "system_ids":"",
            "cafe_id":"" //id of cafe this belongs to
        }
         
    ###### *doesnt have to be this descriptive
        
2. **bookings** - 

    ```
    {
        "booking_id":"",
        "payment_status":"partial/full/none",
        "amount_paid":45.0, //float
        "coupon_applied":"coupon code"/null //coupon code string if applied, else null
        "cafe_id": "",
        "station_id": "", //id of system booked
        "date":"", //datetime value or epoch value
        "slots":Number, //multiple slots booking allowed(only consecutive though)
        "start_time":"", //datetime or epoch
        "end_time":"", //datetime or epoch
        "user_id": "", //id of user
        "game_id":"", //id of game
        "cancelled": Boolean // default => false
    }        
    ```
    slot number - for example if a cafe opens from 12-9 during the day, it has 8 slots - 12-1, 1-2, .... 8-9. When a user selects a time slot he wants to book, we'll know exactly what slot number it translates to, we can then add those slot numbers to `slots` array - will help in writing apis.
    
    
3. **user** - 
    ```
    {
        "name":"",
        "id":"",
        "phone_number":"",
        "age":"",
        .
        .
        . //some more fields like profile picture, steam/uplay etc profile links
    }
    ```

---

# Questions - 
1. how to -- mechanism for seat holding for 15-20mins ?? 
2. SQL seems better for all this. All ids in all tables can be foriegn keys - decide on one and move ahead  **do not overthink just choose one and move ahead, can switch later**
3. Username password type auth or no passwords and email/phone number OTP based login?? - OTP based seems better, can(prolly should) be made as a standalone service 
Pros :: 
     - no password storage/handling needed
     - is easy for the user as well, one less password to remember

    Cons ::
     - cant login without access to phone/email but since it is a phone app, can assume access to phone will always be there 

---
# Workflow -
## User Side

1. Welcome screen of app, display list of games available from games info collection.
2. Give a screen with list of cafes.
3. Give user a screen to select date and time of booking.
4. Hit booking collection and match (date,time,cafe_id) and fetch ids of systems booked for those, take set difference (all_system_ids(for that cafe_id) - booked_system_ids) to get free systems, show a list of those.
5. User selects a system, reserve the system for say, 15-20 mins, and give that time to complete the payment.

## Admin(cafe personnel) Side - 
//todo

___

# Potential Features

1. Review/Rating for cafes/games
2. Fetch reviews/rating of games from sites like ign,gamespot and surface on the UI etc
3. Events page? - the cafe if hosting any events/competitions can alert on that page on the app
4. Some analytics on the bookings - which games people are most interested in?, what time of the week/day sees the highest traffic etc?
 
---
---
---

# *KEEP IT SMALL, BUT MAKE IT GOOD*
