I've stopped hosting this project on AWS, so some of the below will be out of date. This was done to reduce my footprint on the web.
This mock veterinary practice database web application and API was developed over 2 weeks of the developme bootcamp learning and applying the skills listed in the gitHub topics. It uses Laravel Blade to display lists of owners and their animals from the MySQL database. It contains forms that allow for adding/updating these based on your user role. We also developed an API (using a test driven development approach) with Laravel that can be used to query and update the database (based on OAUTH and user role). Finally we deployed the site on AWS and set up Capistrano to enable Continuous Deployment of updates to the site.
https://wildlifesupreme.developme.space
https://wildlifesupreme.developme.space/api/
- Clone the git repository to your local machine by running the following command in your terminal.
- Use the
main
branch in git to run this project locally.
git clone {url}
- In your terminal cd into the project directory and run the below composer command to install neccessary dependencies
cd {project-directory}
composer install
- Set up homestead virtual machine.
- Run the below command in the project directory
vendor/bin/homestead make
- This will create a Homestead.yaml file inside your project directory
- Inside this file edit the memory to be 512
memory: 512
- Inside this file edit the memory to be 512
- Create the .env file
- Run the below command in the project directory
cp .env.example .env
- Spin up the virtual machine
vagrant up
- Once the above is complete, ssh into the virtual machine and cd to the code directory
vagrant ssh
cd code
- Generate the app key, this will be set in your .env file
art key:generate
- Run the MySQL table migrations to set up the database,
- You can omit the --seed if you'd like to start with a blank database, otherwise this will seed the database with test data using faker.
art migrate:fresh --seed
- Navigate to http://homestead.test
- You should see the homepage
In the vagrant box run:
artisan test
This runs all the unit tests for the app and API.
https://wildlifesupreme.developme.space/api/
In order to use the service you'll need to have an account created for you. Message me and I'll get you set up.
Once you have the account information, make the following request to recieve a Bearer Token:
POST https://wildlifesupreme.developme.space/oauth/token
{
"grant_type": "password",
"client_id": "<your_client_id>",
"client_secret": "<your_client_secret>",
"username": "[email protected]",
"password": "password"
}
{
"token_type": "Bearer",
"expires_in": 31535999,
"access_token": "...",
"refresh_token": "..."
}
You'll need to use your token for all requests.
For example, if your response was:
{
"token_type": "Bearer",
"expires_in": 31535999,
"access_token": "massivelylongaccesstoken",
"refresh_token": "..."
}
All your requests should have the following header:
Authorization: Bearer massivelylongaccesstoken
Will return a list of all animal owners, their details, and the animals they own.
{
"data": [
{
"id": 1,
"name": "Helena Beahan",
"address": "Adah Villages, Suite 833, West Hudson, 52447-8504",
"animals": [
"Dr. Destiny Crist",
"Hardy Luettgen",
"Doogo"
]
},
{
"id": 2,
"name": "Grayce Graham",
"address": "Dicki Vista, Apt. 837, Lake Elouiseport, 14515-7225",
"animals": [
"Felipe Walsh Sr.",
"Nyasia Reynolds",
"Dr. Dina Fadel PhD"
]
},
]
}
Will create a new owner
{
"first_name": "<first name>", // REQ - String
"last_name" : "<last name>", // REQ - String
"address_1": "<address_1>", // REQ - String
"address_2": "<address_2>", // REQ - String
"town": "<town>", // REQ - String
"telephone": "+XXXXXXXXXXX", // REQ - String
"postcode": "<postcode>", // REQ - String
"user_id": {id} // // REQ - integer creating user,
}
Will return an owner with the given id
.
{
"id": 1,
"name": "Helena Beahan",
"address": "Adah Villages, Suite 833, West Hudson, 52447-8504",
"animals": [
"Dr. Destiny Crist",
"Hardy Luettgen",
"Doogo"
]
}
Will update an existing owner.
Use the same request format as POST /owners
.
Will delete an existing owner
Will return a list of all animals and their details.
{
"data": [
{
"id": 1,
"name": "Ludwig Walter",
"dob": "1974-12-29",
"weight": 76.47,
"height": 283.58,
"biteyness": 3,
"owner": "Christ Williamson",
"treatments": [
"Neuter",
"de-clawing",
"spay"
]
},
{
"id": 2,
"name": "Felipe Walsh Sr.",
"dob": "1979-10-06",
"weight": 129.47,
"height": 367.74,
"biteyness": 1,
"owner": "Grayce Graham",
"treatments": [
"spay",
"spay",
"shaving"
]
},
]
}
Will create a new animal. Similar to using POST /owners/<id>/animals
, but in this case you must include the owner_id in the request.
{
"name": "<animal name>", // REQ - string
"date_of_birth": "YYYY-MM-DD", // REQ - date
"type": "<type of animal>", // REQ - string
"weight": n.nn, // REQ - float in kg
"height": n.nn, // REQ - float in cm
"biteyness": n, // REQ - integer 1-5
"owner_id": int, // REQ - owner ID
"treatments": ["treatment 1", "treatment 2"] // OPT - array of strings
}
Will return an animal with the given id
.
{
"data": {
"id": 5,
"name": "Chloe Raynor",
"dob": "1988-10-05",
"weight": 175.61,
"height": 495.78,
"biteyness": 5,
"owner": "Arvel Bauch",
"treatments": [
"de-clawing",
"Neuter",
"Toenail Removal"
]
}
}
Will update an existing owner.
Use the same request format as POST /animals
.
Will delete an existing animal
Get the animals for an owner
{
"data": [
{
"id": 39,
"name": "Dr. Destiny Crist",
"dob": "2011-02-20",
"weight": 33.39,
"height": 86.05,
"biteyness": 2,
"owner": "Helena Beahan",
"treatments": [
"Flea Treatment",
"spay",
"petting therapy"
]
},
{
"id": 82,
"name": "Hardy Luettgen",
"dob": "2015-09-01",
"weight": 185.6,
"height": 16.07,
"biteyness": 5,
"owner": "Helena Beahan",
"treatments": [
"petting therapy",
"shaving",
"petting therapy"
]
},
{
"id": 101,
"name": "Doogo",
"dob": "2020-01-01",
"weight": 4,
"height": 12,
"biteyness": 2,
"owner": "Helena Beahan",
"treatments": []
}
]
}
Add a new animal to an owner
{
"name": "<animal name>", // REQ - string
"date_of_birth": "YYYY-MM-DD", // REQ - date
"type": "<type of animal>", // REQ - string
"weight": n.nn, // REQ - float in kg
"height": n.nn, // REQ - float in cm
"biteyness": n, // REQ - integer 1-5
"treatments": ["treatment 1", "treatment 2"] // OPT - array of strings
}
- Hosted on free AWS EC2 instance
bundle exec cap production deploy
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.
- Vehikl
- Tighten Co.
- Kirschbaum Development Group
- 64 Robots
- Cubet Techno Labs
- Cyber-Duck
- British Software Development
- Webdock, Fast VPS Hosting
- DevSquad
- UserInsights
- Fragrantica
- SOFTonSOFA
- User10
- Soumettre.fr
- CodeBrisk
- 1Forge
- TECPRESSO
- Runtime Converter
- WebL'Agence
- Invoice Ninja
- iMi digital
- Earthlink
- Steadfast Collective
- We Are The Robots Inc.
- Understand.io
- Abdel Elrafa
- Hyper Host
- Appoly
- OP.GG
- 云软科技
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.
The Laravel framework is open-sourced software licensed under the MIT license.