A crowded day at the bike shop
Meet Carla. She fixes worn gears at Spoke City Bikes. Her shop has two wooden work benches. Customers love to book tune-ups on their phones. But Carla has a big problem this week. Two people booked bench one at two o'clock.
A calendar is an online grid showing dates and times. An AI tool built a pretty calendar for her. Yet three people took the very same repair slot. The screen looked tidy, but the shop had chaos. Carla had only two stands for three big bikes.
Think of her shop benches like two wooden chairs. Only one person can sit on a chair at once. An AI can paint the chairs on a screen. But a server, which is a central storage computer, must guard those seats. We will build a website that guards the chairs well.
- One calendar must share facts with every visitor.
- The server computer makes the final booking choice.
- Never trust a screen button alone to block seats.
Decide your basic shop rules first
Before you ask an AI to code, write down your facts. An AI works best when you set firm borders. Tell it your shop hours and your correct time zone. A time zone is the official clock time for an area.
Next, set your capacity. Capacity is the highest count of jobs you can do at one time. Carla has two benches, so her capacity is two. If two bikes are on benches, the door is shut. No third bike can start.
Write down how long each repair takes before touching software. You also need a small cleanup break between each job. Carla needs ten minutes to wipe grease off her tools. Write these facts on paper first so your AI builds true rules.
- Write your official shop time zone clearly.
- List your true bench count so capacity stays safe.
- Add short cleanup gaps between long repair visits.
Track the five stages of every visit
A booking does not simply switch from free to full. It moves through stages like a package in the mail. We call each stage a state, which is the exact status of a task. Good tools track five distinct states.
First, a slot is requested when a user clicks it. Next, the slot is held while they type their name. A held slot stops others from taking the seat. But it needs an expiry time, or a lost visitor holds it forever.
When the server saves the name, the slot becomes confirmed. If the rider calls to back out, it becomes cancelled. If the clock runs out while typing, it becomes expired. These distinct labels prevent messy schedule errors.
How web forms send reservation facts
Carla asks customers for three things: a name, a phone number, and a bike type. A web form collects these inputs on the customer screen. The form sends the data away over the web. It uses standard web rules to move the text.
A local storage space is a small locker inside only one browser. A common beginner mistake is saving bookings only inside that one locker. If Carla uses local storage, phone A cannot see what phone B just saved. That causes double bookings.
The form must send its data to one shared backend database instead. The database checks if a bench is open right now. Then it sends back an acknowledgement, which is a formal receipt saying the seat is officially yours.
Read more: MDN: sending form data
A worked example with practice shop data
Let us test Carla's workshop with fake data. We call this practice record TEST-DATA-BENCH. It runs in Pacific Time. The work day starts at nine and ends at five. The bench count is fixed at two.
A rider named Marco selects a tune-up at ten o'clock. His screen asks for a hold on bench one. His hold lasts five minutes. Meanwhile, a rider named Sarah looks for ten o'clock. The server offers her bench two, because bench one is held.
Now a third rider named Leo taps ten o'clock. Both benches are already held. The server tells Leo that ten o'clock has no seats left. Leo sees clear options for eleven o'clock instead. The system protected both benches from overlap.
- Record TEST-DATA-BENCH: Pacific Time, nine to five.
- Two open benches accept Marco and Sarah for ten o'clock.
- The server rejects Leo's request because both benches are full.
Another real test: a music lesson studio
This same plan works for different small businesses. Consider David, who runs a drum and piano school. David has three soundproof practice rooms. Three rooms mean his true capacity is three students at once.
David sets room rules just like Carla set bench rules. A drum lesson lasts forty-five minutes. Each teacher needs fifteen minutes of quiet air time. David makes sure the software counts rooms, not just teacher names.
Two students pick guitar at four o'clock. A third student picks flute at four o'clock. When a fourth student arrives, the form gently offers five o'clock. The shared room count keeps David's music school calm and fair.
Avoid hidden traps in generated code
When an AI writes a web page, it likes to disable screen buttons. A disabled button looks gray and cannot be clicked. But gray buttons on one phone do not stop a second visitor on another phone. Always enforce limits on the server.
Watch out for time changes too. In spring, clocks jump one hour ahead. In autumn, clocks jump back. If your code ignores time changes, appointments land at the wrong hour. Always store appointments as exact moments in time.
Also check your shop closing time. A sixty-minute tune-up cannot start thirty minutes before Carla locks the shop doors. Your code must stop long visits from running past the end of the day. Good checks keep your workday normal.
Read more: MDN: sending form data
How to test your booking site today
You do not need real customers to test your website. Open your booking page on your laptop. At the same second, open the same page on your mobile phone. You are now running a concurrency test.
A concurrency test checks if two actions fight over one spot. Pick the very last open slot on both screens. Tap the reserve button on both screens at the exact same moment. Watch what both screens do next.
One screen should show a green receipt with a booking reference. The other screen should show that the slot was just taken. It should keep the typed name safe and offer a new time. If both get the seat, rewrite your server rules.
| Controlled case | Expected evidence |
|---|---|
| Two visitors request the final slot | At most the configured capacity is confirmed. |
| Visitor abandons a temporary hold | Availability returns after the defined expiry. |
| Shop and visitor use different timezones | Both see the same underlying appointment instant. |
Clear next steps for your project
Keep your booking site simple before you add payments. Adding credit cards creates messy refunds when cards clear too late. Start with confirmed appointment requests first. Once your calendar never double books, you can add payment steps.
Write out a clear plan of your five reservation states. Test your cancel button to make sure dropped spots become free again. Keep records of your two-phone tests so you know your shared logic holds firm.
Roseram can help you write tests for your booking rules. Your daily usage limits depend on your current Roseram plan. For today, follow our checklist to stay safe.
Act as a web developer. Build one repair appointment journey for Spoke City Bikes using our existing project files. Inspect the current data layer before making edits. Use America/Los_Angeles time and a capacity of two benches. Return explicit reservation states for requested, held, confirmed, cancelled, and expired slots. Reject conflicting confirmations on the server, and preserve user input if a slot fails. Do not invent a payment integration. Include a test with two competing requests for the last open bench, and explain which files control availability.
Your idea. Your next step.
Put Roseram super intelligence to work.
Bring the idea you keep coming back to. Choose a Roseram plan, then give your project a clear first task. You can think it through, build a first version, and improve it as you learn.
Check current access, plan limits, and pricing before joining.
Your next step
Your quick checklist.
Tick a step as you finish it. Your ticks and feedback stay on this device. They are not public reviews.
0 of 7 complete
Tell the community what you tried or tell us what needs fixing. Include a source if you are correcting a fact.
Your questions, answered
Can AI create the calendar and booking logic together?
AI can suggest ideas for both. Still, you must test booking rules. Test open times away from graphics. Make sure two people cannot clash.
Do I need payments at launch?
Only add pay steps if needed. Do this if your rules require it. Adding payments brings new ways to fail.
How do I know the task is done?
Keep a map of booking stages. Test two people booking one spot. Let the shop owner cancel visits. Show when spots open back up.
Why is browser storage unsafe for bookings?
Browser storage stays on one phone. Other shoppers cannot see that space. Two shoppers might book one bench.
Want the technical details?Open the code notes, deeper checks, and common questions.
These notes go deeper. Use the parts that fit your project. Examples are for learning; they are not claims that we tested your app.
A worked example: where the task becomes difficult
Consider a fictional bicycle workshop with two repair benches and appointments lasting different amounts of time. A customer chooses a service, sees eligible times and receives a booking reference. The difficult part is not drawing a calendar: two visitors can select the same final space. Define the shop timezone, cleanup interval and capacity before generating the interface. Keep the example separate from real customer bookings until concurrent behavior is tested.
Decisions to make before implementation
Represent requested, held, confirmed, cancelled and expired reservations separately. A temporary hold needs an expiry and must not permanently remove availability if the visitor leaves. The backend should decide whether capacity remains at confirmation; a disabled browser button cannot enforce capacity across customers. If a payment is involved, specify what happens when payment succeeds after the hold expires. Start without payments if the business only needs appointment requests.
A practical sequence for the work
Use the sequence below as a task boundary, not as a claim that the example has been executed. Work with approved inputs and the project’s actual architecture. If a required integration or permission is unavailable, keep that stage visibly incomplete rather than generating a plausible substitute result.
- Model service duration, capacity, timezone and blocked dates before creating the calendar.
- Implement the slot query and confirmation operation against controlled appointment records.
- Connect the form to an acknowledgement containing the accepted status and booking reference.
- Add cancellation and expiry handling, then check the same journey on a phone.
A detailed brief you can adapt for your agent
Replace the illustrative context with your approved facts and controlled inputs. Keep the stated boundaries when adapting the brief. The expected deliverable matters more than a particular tool name: ask for an explanation grounded in the inspected material and evidence for the requested outcome.
Implement one repair appointment journey using the existing framework. Inspect the current data layer before edits. Use the shop timezone and two-bench capacity supplied in this brief. Return explicit reservation states, reject conflicting confirmations and preserve customer input on failure. Do not invent a payment integration. Include a concurrent-slot test and explain which files own availability.
Failure modes that an attractive preview can hide
A common generated prototype keeps bookings only in browser storage. It appears to work on one device while another visitor sees the same free slot. Treat local storage as a prototype boundary, not the shared booking source. Also test daylight-saving transitions and appointments crossing closing time. Preserve the requested slot when confirmation fails, but refresh availability before offering a retry.
Read more: MDN: sending form data
Acceptance checks and the evidence to retain
Keep the reservation state diagram, slot rules, changed files and evidence from two competing requests. The shop operator should be able to cancel a controlled booking and explain when its capacity becomes available again.
| Controlled case | Expected evidence |
|---|---|
| Two visitors request the final slot | At most the configured capacity is confirmed. |
| Visitor abandons a temporary hold | Availability returns after the defined expiry. |
| Shop and visitor use different timezones | Both see the same underlying appointment instant. |
Common questions
Can AI create the calendar and booking logic together?
It can propose both, but verify shared availability and concurrency independently of the visual calendar.
Do I need payments at launch?
Only if the actual booking contract requires them. Adding checkout creates additional failure and reconciliation states.
What is the practical completion criterion?
Keep the reservation state diagram, slot rules, changed files and evidence from two competing requests. The shop operator should be able to cancel a controlled booking and explain when its capacity becomes available again.
Where the facts come from
Use these links to check the technical facts. The stories here are made-up examples to help you learn. Roseram sells AI tools; our examples are not promises of results.
- MDN: sending form data ↗
What this source covers
Form submission transports data to a receiving endpoint; downstream delivery is a separate implementation.
References last reviewed 2026-10-11. Writing refreshed 2026-10-14. Spot a mistake? Tell us.