Open the live app in your browser with this link: http://vet-practice.herokuapp.com/
- username: [email protected]
- password: password
A veterinary practice database app that allows tracking of owners and their pets with a one to many relationship and pet treatments with a many to many relationship. The app also includes a RESTful API (End-points listed below)
- PHP
- MySQL
- Laravel
- Blade
- HTML/CSS
- Bootstrap (styling)
- Git (version managed)
- Heroku (deployment)
- Adaptive welcome screen depending on time of day and logged in user
- Add, edit, delete, list and search owners
- Add, edit and delete pets for each owner (one to many)
- Add and delete treatments for each pet
- List treatments and see which pets are booked in for each treatment (many to many)
- Authentication login to only allow admin rights for adding, editing and deleting from the database (I have provided a login above for you to play around and update the database)
- Restful API
- Age of pet calculated from DoB
- Danger warning if pet is a 3 or above in biteyness
- Neat and clean UI 👍
- Login using the credentials provided (username: [email protected] password: password)
- Click "owners" to see a list of current owners in the database
- Click the owners name to see their details and pets they own
- Use the form at the bottom of the owners page to add a pet to the currently selected owner (multiple treatments can be added using a comma to separate)
- Once a pet is added, treatments can be clicked which will bring up a list of all pets that are booked in for the chosen treatment
- A list of all the treatments can be seen by clicking the treatments in the navbar
This project requires Vagrant to be downloaded on your machine
- Create a local directory on your machine
- Run the following code in your command line to navigate into that directory:
$ cd ~/your-directory-name-here
-
Copy the SSH key from this GitHub repository
[email protected]:deanssmart/the-vet-practice.git
-
Run the following code in your command line to clone the repo to your machine (you can change the app-name to what you desire):
git clone [email protected]:deanssmart/the-vet-practice.git <app-name>
- Navigate to your new app directory (the app name you just picked):
$ cd app-name
- Install the dependencies in the node_modules folder:
npm i
- Install the dependencies in the composer file:
composer i
- Copy the relevant Homestead files into the project directory:
vendor/bin/homestead make
- Change the second line of Homestead.yaml so it just uses 512mb:
memory: 512
- Create a .env file:
cp .env.example .env
- Edit the .env file you just created to use the default Homestead database setup:
DB_DATABASE=homestead
DB_USERNAME=root
DB_PASSWORD=secret
- Generate an application key:
php artisan key:generate
- Get Vagrant up and running:
vagrant up
-
Once Vagrant has finished loading, go to:
- On Mac: http://homestead.test
- On Windows: http://localhost:8000
-
SSH into the Vagrant machine:
vagrant ssh
- Navigate to the code directory:
cd code
- Run migrations:
artisan migrate
Some of the app's features are blocked to unauthorised users to you will need to create a user in order to access them. The easiest way to do this is using artisan tinker
:
$user=newUser();
$user->name="Your Name"
$user->role="Your Role"
$user->email="[email protected]"
$user->password=Hash::make("password")
$user->save()
You can now use these credentials to log in and add, edit, and delete owners, pets and treatments.
You can access the live API using the following link:
https://vet-practice.herokuapp.com/api
and corresponding end-points:
Will return a list of all owners
{
"data": [
{
"id": 2,
"first_name": "Cadbury",
"last_name": "Flake"
},
{
"id": 3,
"first_name": "Hula",
"last_name": "Hoop"
},
{
"id": 4,
"first_name": "Chilli",
"last_name": "Bottle"
}
]
}
Will create a new owner
first_name
: requiredlast_name
: requiredtelephone
: requiredemail
: requiredaddress_1
: requiredaddress_2
: optionaltown
: requiredpostcode
: required
Will return an owner with the given id
{
"data": {
"id": 2,
"first_name": "Cadbury",
"last_name": "Flake",
"address_1": "99",
"address_2": null,
"town": "Cornetto",
"postcode": "BR0 WNN",
"animals": [
"Big ol Parrot",
"Big ol Parrot II"
]
}
}
Will update an entire existing owner
first_name
: requiredlast_name
: requiredtelephone
: requiredemail
: requiredaddress_1
: requiredaddress_2
: optionaltown
: requiredpostcode
: required
Will delete an existing owner
Will return the pets of a given owner
{
"data": [
{
"id": 29,
"name": "Big ol Parrot",
"type": "Parrot",
"treatments": [
"defeather"
],
"owner_first_name": "Cadbury",
"owner_last_name": "Flake",
"owner_id": 2
},
{
"id": 32,
"name": "Big ol Parrot II",
"type": "Parrot",
"treatments": [
"defeather",
"debeak"
],
"owner_first_name": "Cadbury",
"owner_last_name": "Flake",
"owner_id": 2
}
]
}
Add a pet to an owner
name
: requiredtype
: required, type of animaldob
: required, YYYY-mm-ddweight
: required, number in kgheight
: required, number in mbiteyness
: required, integer between 1 and 5treatments
: required, array comma separated
Will return a list of all animals
{
"data": [
{
"id": 14,
"name": "Pumpy",
"type": "Dog",
"treatments": [
"deball"
],
"owner_first_name": "Rugby",
"owner_last_name": "Ball",
"owner_id": 25
},
{
"id": 23,
"name": "Mr Catty",
"type": "Cat",
"treatments": [
"deflea"
],
"owner_first_name": "Rugby",
"owner_last_name": "Ball",
"owner_id": 25
},
{
"id": 25,
"name": "Sharky",
"type": "Shark",
"treatments": [
"tooth filling",
"counseling"
],
"owner_first_name": "Chilli",
"owner_last_name": "Bottle",
"owner_id": 4
}
]
}
Will return an animal with the given id
{
"data": {
"id": 14,
"name": "Pumpy",
"type": "Dog",
"dob": "2019-01-11",
"weight": "7.30",
"height": "0.70",
"biteyness": 5,
"owner_first_name": "Rugby",
"owner_last_name": "Ball",
"treatments": [
"deball"
]
}
}
Will update an entire existing animal
name
: requiredtype
: required, type of animaldob
: required, YYYY-mm-ddweight
: required, number in kgheight
: required, number in mbiteyness
: required, integer between 1 and 5treatments
: required, array comma separated
Will delete an existing animal
Will return a list of all treatments
{
"data": [
{
"id": 2,
"treatment": "defeather",
"animals": [
"Big ol Parrot",
"Big ol Parrot II"
]
},
{
"id": 7,
"treatment": "debeak",
"animals": [
"Big ol Parrot II"
]
},
{
"id": 14,
"treatment": "eye lift",
"animals": [
"Sophie"
]
}
]
}