Giter Site home page Giter Site logo

zangassis / pet-manager Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 20 KB

This project contains a sample ASP.NET Core app. This app is an example of the article I produced for the Telerik Blog (telerik.com/blogs).

License: MIT License

C# 100.00%
asp-net-core database dotnet-7 minimal-api sqlite

pet-manager's Introduction

PetManager 🐢🐱

This project contains a sample ASP.NET Core app. This app is an example of the article I produced for the Telerik Blog (telerik.com/blogs).

PetManager is a minimal API built using .NET 7 that allows you to manage pets using a SQLite database. It provides basic CRUD (Create, Read, Update, Delete) operations for pet entities.

Requirements

Before running the PetManager project, ensure that you have the following dependencies installed:

πŸ₯ Getting Started

To download and run the PetManager project, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/zangassis/pet-manager.git
  2. Navigate to the project directory:

    cd PetManager
  3. Build the project:

    dotnet build
  4. Apply the database migrations to create the SQLite database:

    dotnet ef database update --project PetManager
  5. Run the API:

    dotnet run --project PetManager

The API should now be running locally on http://localhost:[PORT].

🧩 API Endpoints

The PetManager API provides the following endpoints:

  • GET /pets: Retrieves all pets.
  • GET /pets/{id}: Retrieves a specific pet by its ID.
  • POST /pets: Creates a new pet.
  • PUT /pets/{id}: Updates an existing pet.
  • DELETE /pets/{id}: Deletes a pet.

🐢 Example Usage

To create a new pet, you can use a tool like cURL or a REST client of your choice:

curl -X POST -H "Content-Type: application/json" -d '{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Max",
  "species": "Dog",
  "breed": "Golden Retriever",
  "age": 3,
  "color": "Golden",
  "weight": 30,
  "vaccinated": true,
  "lastVaccinationDate": "2023-05-01",
  "owner": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "123-456-7890"
  }
}
' http://localhost:5000/api/pets

This will create a new pet named "Max" with the species "Dog" and age 3.

🌟 Contributing

Contributions to the PetManager project are welcome! If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub repository: https://github.com/zangassis/pet-manager/issues

When contributing code, please follow the existing code style and submit a pull request with your changes.

βš– License

The PetManager project is licensed under the MIT License. You can find more information in the LICENSE file.

πŸ“ž Contact

If you have any questions or need further assistance, you can reach out to the project maintainers:

Feel free to contact us with any feedback or inquiries.

Thank you for using PetManager!

pet-manager's People

Contributors

zangassis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.