/fe-spothero

Primary LanguageJavaScriptOtherNOASSERTION

Mylo's Parking Challenge ๐Ÿš—

Welcome to Mylo's parking challenge! In this project, I've not only parked in the provided spots but also introduced some exciting new features to enhance the user experience. I've also dedicated a significant amount of time to documenting the changes made to ensure clarity and maintainability. ๐Ÿ“

Features ๐ŸŒŸ

Story #1: Spot Details Modal (โœ”๏ธ)

Users want to see details about a parking spot before reserving it.

Requirements

  • Implement a modal that shows the spot details. Follow the design provided by the product team. (โœ”๏ธ)

    • The modal should gracefully drive in and out, not just appear/disappear. (โœ”๏ธ)

Story #2: Easy Spot Reservation (โœ”๏ธ)

Users should be able to reserve a parking spot with ease.

Requirements

  • Add a form that takes user input, verifies it, and allows the user to proceed to the confirmation page. Follow the design provided by the product team. (โœ”๏ธ)

    • Email and Phone Number fields are required and should display errors if not filled out correctly. (โœ”๏ธ)
    • Phone Number should only allow entry of digits. Bonus points for auto-formatting to a US phone number (such as (xxx) xxx-xxxx). (โœ”๏ธ)
    • Adjust the confirmation page (if necessary) to ensure it works and renders correctly. (โœ”๏ธ)
    • Make sure that a second reservation and parking in another spot updates all UI correctly. (โœ”๏ธ)

Additional Features ๐Ÿš€

Parking Session Tracking ๐Ÿ•‘

  • Parking Session ID: A parking session ID is generated and stored in sessionStorage, enabling users to enter their information only once.
  • Clear Parking Session Button: A "Clear Parking Session" button on the home page allows users to reset their parking session and start fresh. ๐Ÿ”„

Activity Tracking ๐Ÿƒโ€โ™‚๏ธ

  • User Activity: User activity is monitored, and the user is considered "active" while navigating the parking app.
  • Automatic Data Save: When the user becomes inactive for 1 second, an API call is triggered to save their parking information securely. This data can be retrieved later using their parking session token. ๐Ÿ’พ

Enhanced Parking API ๐ŸŒ

I've made improvements to the parking API, including additional routes for user data:

  • GET /users/:sessionId: Get user parking data by session ID.
  • PUT /users/:sessionId: Update user parking data by session ID.
  • POST /users: Create a new parking user.

Documentation ๐Ÿ“–

I believe in the power of documentation to make code understandable and maintainable, just like proper parking signage! I've spent a significant amount of time documenting the changes made in this project, ensuring that anyone who parks here can easily understand and extend the functionality.

Getting Started ๐Ÿšฆ

  1. Download or clone this parking lot.
  2. Run npm install to download all necessary dependencies.
  3. Run npm start to serve the parking API and start the local parking experience.

API ๐ŸŒ

The parking API is available at http://localhost:8001/api and offers the following routes:

  • GET /spots: Get a list of available parking spots.

  • GET /spots/:id: Get parking spot details by ID.

  • GET /reservations/:id: Get parking reservation details by ID.

  • POST /reservations: Make a parking reservation with the required fields.

  • GET /users/:sessionId: Get user parking data by parking session ID.

  • PUT /users/:sessionId: Update user parking data by parking session ID.

  • POST /users: Create a new parking user.

Testing ๐Ÿงช

Testing plays a crucial role in ensuring the smooth parking experience of this application. While the existing parking lot may not include tests, I encourage the addition of tests to verify and validate the parking functionality.

Feedback ๐Ÿ’Œ

I value your feedback and welcome any further improvements and enhancements to this parking lot. Thank you for considering Mylo's parking challenge. I'm excited to showcase these additions and look forward to your feedback.