This repository contains the Pokemon Review API, which allows users to manage and review Pokemon. The UML diagram above outlines the structure of the system, including the relationships between different entities such as Pokemon, Reviews, Reviewers, Owners, and Categories.
-
Get all Pokemon
GET /api/pokemon
- Retrieves a list of all Pokemon.
-
Get a single Pokemon
GET /api/pokemon/{id}
- Retrieves details of a specific Pokemon by ID.
-
Create a new Pokemon
POST /api/pokemon
- Adds a new Pokemon to the database.
-
Update a Pokemon
PUT /api/pokemon/{id}
- Updates the details of an existing Pokemon.
-
Delete a Pokemon
DELETE /api/pokemon/{id}
- Deletes a specific Pokemon by ID.
-
Get all reviews
GET /api/reviews
- Retrieves a list of all reviews.
-
Get reviews for a specific Pokemon
GET /api/pokemon/{pokemonId}/reviews
- Retrieves all reviews for a specific Pokemon.
-
Create a new review
POST /api/reviews
- Adds a new review to the database.
-
Update a review
PUT /api/reviews/{id}
- Updates the details of an existing review.
-
Delete a review
DELETE /api/reviews/{id}
- Deletes a specific review by ID.
-
Get all reviewers
GET /api/reviewers
- Retrieves a list of all reviewers.
-
Get a single reviewer
GET /api/reviewers/{id}
- Retrieves details of a specific reviewer by ID.
-
Get all owners
GET /api/owners
- Retrieves a list of all owners.
-
Get a single owner
GET /api/owners/{id}
- Retrieves details of a specific owner by ID.
-
Get all categories
GET /api/categories
- Retrieves a list of all categories.
-
Get a single category
GET /api/categories/{id}
- Retrieves details of a specific category by ID.
- Pokemon: Represents a Pokemon entity with attributes such as
Id
,Name
, andBirthDate
. It has relationships withReview
,Owner
, andCategory
. - Review: Represents a review entity with attributes such as
id
,Title
, andText
. It is linked toReviewer
andPokemon
. - Reviewer: Represents a reviewer entity with attributes such as
Id
,FirstName
, andLastName
. It has a relationship withReview
. - Owner: Represents an owner entity with attributes such as
Id
,Name
, andGym
. It is linked toPokemon
andCountry
. - Country: Represents a country entity with attributes such as
Id
andName
. It has a relationship withOwner
. - Category: Represents a category entity with attributes such as
Id
andName
. It is linked toPokemon
.
- Pokemon-Review: A Pokemon can have multiple reviews.
- Pokemon-Owner: A Pokemon can have multiple owners and an owner can own multiple Pokemon.
- Pokemon-Category: A Pokemon can belong to multiple categories and a category can include multiple Pokemon.
- Owner-Country: An owner belongs to a country and a country can have multiple owners.
- Review-Reviewer: A review is written by a reviewer.
- Ensure you have .NET Core SDK installed.
- A database (e.g., PostgreSQL, MySQL) to store the data.
-
Clone the repository:
git clone https://github.com/Sadeqsoli/WebApplications.git
-
Navigate to the project directory:
cd WebApplications/PokemonReview
-
Restore dependencies:
dotnet restore
-
Configure the database connection:
- Create an
appsettings.Development.json
file in the root directory. - Add your database configuration to the
appsettings.Development.json
file:{ "ConnectionStrings": { "DefaultConnection": "Server=your-database-server;Database=your-database-name;User Id=your-username;Password=your-password;" } }
- Create an
-
Run database migrations:
dotnet ef database update
-
Run the application:
dotnet run
-
Open your browser and go to
http://localhost:5000
to access the API.
To contribute to this project:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push your changes to your branch:
git push origin feature/your-feature-name
- Open a pull request and describe your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or suggestions, please open an issue in the repository or contact the project maintainers.