This is a personal demo application developed as a code challenge.
Allow users to find properties (e.g. hotels) around them and submit booking requests for them.
Requirements:
-
The search is location (geo positioning) based
-
Any property can be selected and a booking request submitted
-
All booking requests are available via a public REST API
- By user
- By property
Not defined in challenge:
- Load to be handled -> Assume prototype without load
- Persistence of data -> Assume basic persistence needed
- Which booking information needed? -> Assume only dummy data is collected (name of customer)
- What data of properties displayed? -> Assume only basic information (name and address) is displayed
- How many properties should be listed -> Assume max. 50 properties are displayed without pagination
- Should the service run on an actual server? -> Assume local prototype, no docker or CI setup
- Which languages should be supported? -> Assume no localization support needed for now
Basic working prototype consisting of an API and a web client that can be used locally. It is not intended for production use in any way. The frontend is only rudimentary, main focus is the full user flow and a clean setup.
Quality:
- Testing: Critical parts covered with unit and integration tests, no end-to-end tests
- Code: Automatically formatted using best practices (enforced by eslint and prettier)
- Typing: Fully typed using TypeScript
- Architecture: Clean structure that would allow future extension, but with focus on simplicity
This project consists of two packages, the API and the Web-App. See their README.md files for further details on setup and usage.
Follow the setup instructions in API and Web-App and start both servers using npm run start
.
Verify that the API is working correctly by accessing http://localhost:8080/v1/properties?at=48.1366,11.5771. If everything is setup correctly, this endpoint should return a list of properties near the given coordinates.
After access the web client using http://localhost:3000/ and feel free to look around. There is no actual booking involved, so no worries about clicking any buttons.
For development this project includes a self-signed certificate under etc/ssl.
To generate a new verion of this certificate run openssl req -out etc/ssl/server.cert -newkey rsa:2048 -x509 -days 365 -nodes -keyout etc/ssl/server.key -config etc/ssl/san.cnf
.
- Verify requirements
- Getting familiar with HERE Places API
- Tested it using Postman and looked deeper into the browse features that seems like a good fit
- Example call: /browse?at=48.1366,11.5771&cat=hotel&app_id={{appId}}&app_code={{appCode}}
- API project setup
- Typescript and Babel for typing and coding features
- Prettier and eslint for code quality
- Jest for testing
- OpenAPI v3 for documentation
- Express as server
- Initial API specification
- Add /v1/properties endpoint and HERE Places client
- Web-App project setup
- Create-React-App as basis
- Jest for testing
- Prettier and eslint for code quality
- Material-UI for UI components
- Add properties list in web
- Milestone reached: Properties are being displayed in a static list
- Update API specification
- Error responses and resource creation
- Add booking to API and web-app
- Milestone reached: Properties can be booked
- Add booking date to API and web-app
- Add booking confirmation
- Add other booking endpoints to API
- Milestone reached: Basic goal completion
- Polishing