The solution proposed here outlines the architecture for an API designed to manage restaurant reviews and associated data. Let's break down the key components:
- Users: Users of the system are identified by their email addresses and have the ability to claim tags and categories. They are also associated with reviews they create.
- Tags and Categories: Tags and categories are used to categorize restaurants and reviews. They can be claimed by users, allowing for personalized categorization. Each tag and category has a creator, enabling accountability and ownership.
- Restaurants: Restaurants are represented with basic information such as name, description, and contact information. They can be associated with multiple categories and tags.
- Reviews: Reviews are created by users for specific restaurants. They include details such as content, recommendation status, ratings for various aspects like ambience and service, and the visit date.
- Locations: Restaurant locations are represented with address details, including the city, state, and country. This allows for accurate geographical representation.
- Geographical Entities: Cities, states, and countries are modeled as separate entities, enabling efficient organization and retrieval of location data.
Overall, this solution provides a robust API for managing restaurant reviews with features like user authentication, categorization, and detailed review attributes. The data model is designed to support scalability, data integrity, and extensibility, ensuring that the API can evolve to meet future requirements.
Source code:
GitHub - esteres/gastronomy_hub_api: robust API for managing restaurant reviews with features like user authentication, categorization, and detailed review attributes. The data model is designed to support scalability, data integrity, and extensibility, ensuring that the API can evolve to meet future requirements.
Testing the API:
Registration:
curl --header "Content-Type: application/json" <http://localhost:3000/api/v1/users> -v --data '{"user": {"email": "[email protected]", "password": "SecurePassword!1@"}}'
