Jaka Štraser

← All projects

BookWithStraser

An online booking platform for stays and flights.

Stack: Angular, Node.js, MongoDB

Screenshot of the BookWithStraser home page: a photo of the Julian Alps with a headline, buttons to search stays and book flights, and a row of destinations.

Problem

Booking a trip means searching across several sites. The app covers search, reviewing your own bookings, and user sign-up and sign-in.

Solution

The Angular client has pages for searching stays, details, flights, attractions, my bookings and a profile. Protected pages are closed to signed-out users by a route guard. Maps use Leaflet. The backend is an Express REST API with a MongoDB database.

Architecture

AngularpagesLeafletExpress API/api/authbookingsflightsMongoDBUserBookingFlightJWTsign-inAngularpagesLeafletExpress API/api/authbookingsflightsMongoDBUserBookingFlightJWTsign-in

The client and the server run separately.

Key decisions

  • Separate client and API. Angular builds on its own, and Express exposes /api/auth, /api/bookings and /api/flights.
  • JWT sign-in. Passwords are hashed with bcrypt, and an Angular interceptor attaches the token to each request.
  • Route guard. My bookings and the profile are only reachable for signed-in users.
  • Data model. A booking is either a stay or a flight. A flight supports one-way, round-trip and multi-city trips with several legs.

The code is in a private repository.