stephen_p's avatar

Planning the General Data Structure for a Reservation App in Laravel

I am working on a project that I can best describe as having similar functionality to OpenTable (the restaurant reservation app). While still working with reservations, the users can having regularly recurring reservations (say at 12pm and 4pm Mon-Fri), but they will also have the ability to add additional reservations or delete reservations (can add a 8pm reservation on Monday and cancel the 4pm reservation on Friday, for example).

I need some help with planning the database structure for the next development phase:

  1. I am contemplating the best way to setup the tables for the reservations. Do I keep the regular schedule reservations in one table and create a 2nd table for tracking adds and deletions?

  2. For reservation availability, I was thinking about setting up the table with each date representing a record, and each column represents a reservation time, and the value is the count of available reservations for that date and time, which can be appended (+1 or -1) as users add or cancel reservations. For passing this to the view, "if the value > 0, then show the available reservation time". Is this the best structure or is there a better way?

  3. The superadmin role will be responsible for uploading the base reservation schedule with any revisions for the upcoming week and will upload a file for the available additional reservations. While not necessary, it would be nice to keep historical data for trend analysis in the future.

  4. I am anticipating upwards of 5k reservations per week upon initial deployment. I don't have a lot of database experience, but that could create some big tables pretty fast and I am concerned about slowing down the app.

So far on this project, I have setup multi-auth and bladed out the template with unique navigation for each type of user. I took my inspiration from a video series (https://www.youtube.com/watch?v=iKRLrJXNN4M).

The data model currently has 4 tables: superadmin, admin, accounts, and users (Superadmin has many Admin, Admin has many Accounts, Accounts has many Users). Superadmins can only register admins, Superadmins and admins can only create accounts, and users can only register with registration link that is generated upon account creation and sent to the user.

I am incredibly new to Laravel and coding in general. Any ideas or suggestions would be greatly appreciated.

0 likes
0 replies

Please or to participate in this conversation.