From 04aef3da043374ead1dfc37a20dfed4c729613ac Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 4 May 2024 19:44:27 +0300 Subject: [PATCH 01/20] Updates README --- README.md | 107 ++--------- db/seeds.json | 444 ---------------------------------------------- package-lock.json | 5 +- 3 files changed, 15 insertions(+), 541 deletions(-) diff --git a/README.md b/README.md index d787fdb0..e0c3f6b0 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,26 @@ -# JSON Server Template +## Introduction +This is the json server for FarmFolio. To set it up in a development environment follow the steps below. -## Setup -Fork and clone this repo. Then install the dependencies by running: +## Setting up -```sh -npm install -``` - -## Seeding Data +# 1. Clone the repository -To set up your database, update the `db/seeds.json` file to contain an object -with a key pointing to an array of data, like this: - -```json -{ - "toys": [ - { - "id": 1, - "name": "Woody", - "image": "http://www.pngmart.com/files/3/Toy-Story-Woody-PNG-Photos.png", - "likes": 8 - }, - { - "id": 2, - "name": "Buzz Lightyear", - "image": "http://www.pngmart.com/files/6/Buzz-Lightyear-PNG-Transparent-Picture.png", - "likes": 14 - } - ] -} ``` +git@github.com:NB-Kamoni/FarmFolio-Backend.git -Then, run `npm run seed` to copy data from the `db/seeds.json` file to the -`db/db.json` file. `json-server` uses the `db.json` file to create your RESTful -API, so make sure your `db.json` file is always up to date! - -Any time you want to reset your database back to your original data, run -`npm run seed` again. Doing this will overwrite all the data in your `db.json` -file, so make sure you don't have any data in that file that you don't mind -losing! - -## Running the Server Locally - -To run your server in development mode, run: - -```sh -npm run dev ``` -While running in development mode, the server will re-load any time you make -changes to the `db.json` file, so you can test our your seed data. - -While your server is running, you can make requests to -[http://localhost:3000](http://localhost:3000). Check it out in the browser to -make sure your server works! - -## Deploying - -Free services like Render make it simple to deploy your Node server. Render also -works nicely with Rails, which you'll learn later in the program. +# 2. Install the dependencies -### Sign Up for a Render Account - -You can sign up for a free account at -[https://dashboard.render.com/register][Render signup]. We recommend that you -sign up using GitHub as that will make it a little easier for you to connect -Render to your GitHub account. The instructions below assume you've done that. - -[Render signup]: https://dashboard.render.com/register - -Once you've completed the signup process, you will be taken to the Render -dashboard. - -In order to connect Render to your GitHub account, you'll need to click the "New -Web Service" button in the "Web Services" box. On the next page, you will see a -GitHub heading on the right side and below that a link labeled "Configure -account". (If you didn't sign up using GitHub, it will say "Connect account" -instead.) Click that link; a modal will appear asking you for permission to -install Render on your GitHub account. Click "Install." You should then be taken -back to the "Create a New Web Service" page, which should now show a list of -your GitHub repos. - -### Deploy the Server - -Find the GitHub repo for your json server in the list and click Connect. Give -the web service a name and make sure the Environment is set to Node. Everything -else can be left as is. Scroll down to the bottom of the page and click "Create -Web Service." The build process will begin automatically. - -The URL for your deployed server is shown in the upper left corner of the page, -e.g., `https://my-server.onrender.com`. Once the build is complete, you will be able to -make fetch requests to that URL. +``` +npm install -### Making Updates +``` -Since Render deployment integrates with your GitHub repo, you can easily deploy -changes to your database. First, commit and push your code up to GitHub: +# 3. Start the development server -```sh -git add . -git commit -m "Updated database" -git push ``` +npm run dev -Then launch the build process by going to the page for your server on the -Render dashboard, clicking the "Manual Deploy" button in the upper right corner -of the page, and selecting "Deploy latest commit." +``` \ No newline at end of file diff --git a/db/seeds.json b/db/seeds.json index 746cc522..e69de29b 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -1,444 +0,0 @@ -{ - "example": [ - { - "id": 1, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 2, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 3, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 4, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 5, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 6, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 7, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 8, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 9, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 10, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 11, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 12, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 13, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 14, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 15, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 16, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 17, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 18, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 19, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 20, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 21, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 22, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 23, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 24, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 25, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 26, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 27, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 28, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 29, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 30, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 31, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 32, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 33, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 34, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 35, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 36, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 37, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 38, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 39, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 40, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - } - ] -} diff --git a/package-lock.json b/package-lock.json index 68b763ec..058d35d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "json-server-template", - "version": "1.0.0", + "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.0.0", + "name": "json-server-template", + "version": "0.1.0", "license": "ISC", "dependencies": { "cors": "^2.8.5", From 5011d3706a15e67e53f4898cb00b9d32e458e636 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 4 May 2024 19:46:33 +0300 Subject: [PATCH 02/20] Updates db.json --- db/db.json | 482 +++++++++++--------------------------------------- db/seeds.json | 164 +++++++++++++++++ 2 files changed, 265 insertions(+), 381 deletions(-) diff --git a/db/db.json b/db/db.json index 746cc522..7add0425 100644 --- a/db/db.json +++ b/db/db.json @@ -1,444 +1,164 @@ { - "example": [ + "chickens": [ { "id": 1, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 12, + "weight_kg": 2.5, + "total_eggs": 20, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 2, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 8, + "weight_kg": 1.8, + "total_eggs": 15, + "date": "2024-05-04", + "daily_eggs": 1 }, { "id": 3, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 10, + "weight_kg": 1.6, + "total_eggs": 18, + "date": "2024-05-04", + "daily_eggs": 3 }, { "id": 4, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 14, + "weight_kg": 2.3, + "total_eggs": 22, + "date": "2024-05-04", + "daily_eggs": 4 }, { "id": 5, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 9, + "weight_kg": 1.7, + "total_eggs": 17, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 6, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 11, + "weight_kg": 2.0, + "total_eggs": 19, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 7, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 13, + "weight_kg": 2.2, + "total_eggs": 21, + "date": "2024-05-04", + "daily_eggs": 3 }, { "id": 8, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 7, + "weight_kg": 1.5, + "total_eggs": 14, + "date": "2024-05-04", + "daily_eggs": 1 }, { "id": 9, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 15, + "weight_kg": 2.6, + "total_eggs": 24, + "date": "2024-05-04", + "daily_eggs": 4 }, { "id": 10, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 16, + "weight_kg": 2.8, + "total_eggs": 26, + "date": "2024-05-04", + "daily_eggs": 3 }, { "id": 11, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 11, + "weight_kg": 2.1, + "total_eggs": 20, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 12, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 18, + "weight_kg": 3.0, + "total_eggs": 28, + "date": "2024-05-04", + "daily_eggs": 4 }, { "id": 13, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 10, + "weight_kg": 2.2, + "total_eggs": 19, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 14, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 12, + "weight_kg": 2.3, + "total_eggs": 21, + "date": "2024-05-04", + "daily_eggs": 3 }, { "id": 15, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 14, + "weight_kg": 2.4, + "total_eggs": 23, + "date": "2024-05-04", + "daily_eggs": 3 }, { "id": 16, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 9, + "weight_kg": 1.9, + "total_eggs": 16, + "date": "2024-05-04", + "daily_eggs": 1 }, { "id": 17, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 13, + "weight_kg": 2.3, + "total_eggs": 21, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 18, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 10, + "weight_kg": 2.1, + "total_eggs": 18, + "date": "2024-05-04", + "daily_eggs": 2 }, { "id": 19, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 11, + "weight_kg": 2.2, + "total_eggs": 19, + "date": "2024-05-04", + "daily_eggs": 3 }, { "id": 20, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 21, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 22, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 23, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 24, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 25, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 26, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 27, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 28, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 29, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 30, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 31, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 32, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 33, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 34, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 35, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 36, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 37, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 38, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 39, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false - }, - { - "id": 40, - "exampleAttributeString": "This is just an example. Please supply your own data.", - "exampleImgString": "https://placehold.co/150x150.jpg", - "exampleAttributesArray": ["Replace", "this", "data"], - "exampleAttributeNumber": 2341, - "exampleAttributeObj": { - "objectKey": "objectValue" - }, - "exampleAttributeBoolean": false + "age_months": 12, + "weight_kg": 2.0, + "total_eggs": 20, + "date": "2024-05-04", + "daily_eggs": 1 } ] } diff --git a/db/seeds.json b/db/seeds.json index e69de29b..7add0425 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -0,0 +1,164 @@ +{ + "chickens": [ + { + "id": 1, + "age_months": 12, + "weight_kg": 2.5, + "total_eggs": 20, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 2, + "age_months": 8, + "weight_kg": 1.8, + "total_eggs": 15, + "date": "2024-05-04", + "daily_eggs": 1 + }, + { + "id": 3, + "age_months": 10, + "weight_kg": 1.6, + "total_eggs": 18, + "date": "2024-05-04", + "daily_eggs": 3 + }, + { + "id": 4, + "age_months": 14, + "weight_kg": 2.3, + "total_eggs": 22, + "date": "2024-05-04", + "daily_eggs": 4 + }, + { + "id": 5, + "age_months": 9, + "weight_kg": 1.7, + "total_eggs": 17, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 6, + "age_months": 11, + "weight_kg": 2.0, + "total_eggs": 19, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 7, + "age_months": 13, + "weight_kg": 2.2, + "total_eggs": 21, + "date": "2024-05-04", + "daily_eggs": 3 + }, + { + "id": 8, + "age_months": 7, + "weight_kg": 1.5, + "total_eggs": 14, + "date": "2024-05-04", + "daily_eggs": 1 + }, + { + "id": 9, + "age_months": 15, + "weight_kg": 2.6, + "total_eggs": 24, + "date": "2024-05-04", + "daily_eggs": 4 + }, + { + "id": 10, + "age_months": 16, + "weight_kg": 2.8, + "total_eggs": 26, + "date": "2024-05-04", + "daily_eggs": 3 + }, + { + "id": 11, + "age_months": 11, + "weight_kg": 2.1, + "total_eggs": 20, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 12, + "age_months": 18, + "weight_kg": 3.0, + "total_eggs": 28, + "date": "2024-05-04", + "daily_eggs": 4 + }, + { + "id": 13, + "age_months": 10, + "weight_kg": 2.2, + "total_eggs": 19, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 14, + "age_months": 12, + "weight_kg": 2.3, + "total_eggs": 21, + "date": "2024-05-04", + "daily_eggs": 3 + }, + { + "id": 15, + "age_months": 14, + "weight_kg": 2.4, + "total_eggs": 23, + "date": "2024-05-04", + "daily_eggs": 3 + }, + { + "id": 16, + "age_months": 9, + "weight_kg": 1.9, + "total_eggs": 16, + "date": "2024-05-04", + "daily_eggs": 1 + }, + { + "id": 17, + "age_months": 13, + "weight_kg": 2.3, + "total_eggs": 21, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 18, + "age_months": 10, + "weight_kg": 2.1, + "total_eggs": 18, + "date": "2024-05-04", + "daily_eggs": 2 + }, + { + "id": 19, + "age_months": 11, + "weight_kg": 2.2, + "total_eggs": 19, + "date": "2024-05-04", + "daily_eggs": 3 + }, + { + "id": 20, + "age_months": 12, + "weight_kg": 2.0, + "total_eggs": 20, + "date": "2024-05-04", + "daily_eggs": 1 + } + ] +} From 004216b26d4b8db7aabc8ccb9bec448eb30c8ca5 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 4 May 2024 20:27:32 +0300 Subject: [PATCH 03/20] Adds a server home page --- public/index.html | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 public/index.html diff --git a/public/index.html b/public/index.html new file mode 100644 index 00000000..956f62f0 --- /dev/null +++ b/public/index.html @@ -0,0 +1,55 @@ + + + + + + Chicken Server Main Page + + + +

Welcome to the FarmFolio Server

+ +

Endpoints:

+

This server provides access to FarmFolio data through the following endpoints:

+ + + From fc9559606a67b9772fd496c5419402418c9448b4 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 4 May 2024 20:35:54 +0300 Subject: [PATCH 04/20] updates the README --- README.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e0c3f6b0..5367031e 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,40 @@ -## Introduction +# Introduction This is the json server for FarmFolio. To set it up in a development environment follow the steps below. -## Setting up +# Setting up -# 1. Clone the repository +## 1. Clone the repository ``` git@github.com:NB-Kamoni/FarmFolio-Backend.git ``` -# 2. Install the dependencies +## 2. Install the dependencies ``` npm install ``` -# 3. Start the development server +## 3. Start the development server ``` npm run dev -``` \ No newline at end of file +``` + +use CTRL + C to stop the server + +## 3. Reset the data +Since this server is for testing and prototyping, you can reset the data to its initial state.. In future this backend will be migrated to a more secure and scalabele DB. + +Feel free to reset the data to its initial state through: + +``` +npm run seed + +``` + +Incase you add a new endpoint (a new key and its array), Please update the initial state of the data in seeds.json \ No newline at end of file From a6848a019d67ce8ef8d614a8fb961efcd0ab6591 Mon Sep 17 00:00:00 2001 From: Maggie-karuri Date: Tue, 7 May 2024 13:06:31 +0300 Subject: [PATCH 05/20] updated data on db.json --- db/db.json | 84 ++++++++++++++++++++++++++++++++++++++++++-- db/seeds.json | 83 +++++++++++++++++++++++++++++++++++++++++-- package-lock.json | 89 ++++++++++++++++++++++++++++++++++++++++++++++- package.json | 4 ++- public/index.html | 6 +++- server.js | 2 +- 6 files changed, 259 insertions(+), 9 deletions(-) diff --git a/db/db.json b/db/db.json index 7add0425..9027af8b 100644 --- a/db/db.json +++ b/db/db.json @@ -1,5 +1,5 @@ { - "chickens": [ + "chicken": [ { "id": 1, "age_months": 12, @@ -160,5 +160,83 @@ "date": "2024-05-04", "daily_eggs": 1 } - ] -} + ], +"veterinarians": [ + { + "id": 1, + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET12345", + "availability": { + "monday": "9:00 AM - 5:00 PM", + "tuesday": "9:00 AM - 5:00 PM", + "wednesday": "9:00 AM - 5:00 PM", + "thursday": "9:00 AM - 5:00 PM", + "friday": "9:00 AM - 7:00 PM" + } + }, + { + "id": 2, + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET54321", + "availability": { + "monday": "8:00 AM - 4:00 PM", + "tuesday": "8:00 AM - 4:00 PM", + "wednesday": "8:00 AM - 12:00 PM", + "thursday": "8:00 AM - 4:00 PM", + "friday": "8:00 AM - 5:00 PM" + } + }, + { + "id": 3, + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": ["Poultry", "Dairy Cattle"], + "license": "VET67890", + "availability": { + "monday": "10:00 AM - 6:00 PM", + "tuesday": "10:00 AM - 6:00 PM", + "wednesday": "10:00 AM - 6:00 PM", + "thursday": "10:00 AM - 4:00 PM", + "friday": "10:00 AM - 5:00 PM" + } + }, + { + "id": 4, + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": ["Beef Cattle", "Sheep"], + "license": "VET11223", + "availability": { + "monday": "7:00 AM - 3:00 PM", + "tuesday": "7:00 AM - 3:00 PM", + "wednesday": "7:00 AM - 3:00 AM", + "thursday": "7:00 AM - 3:00 PM", + "friday": "7:00 AM - 1:00 PM" + } + }, + { + "id": 5, + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], + "license": "VET99887", + "availability": { + "monday": "11:00 AM - 7:00 PM", + "tuesday": "11:00 AM - 7:00 PM", + "wednesday": "11:00 AM - 5:00 PM", + "thursday": "11:00 AM - 7:00 PM", + "friday": "11:00 AM - 3:00 PM" + } + } + ] + } + diff --git a/db/seeds.json b/db/seeds.json index 7add0425..977f45ce 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -1,5 +1,5 @@ { - "chickens": [ + "chicken": [ { "id": 1, "age_months": 12, @@ -160,5 +160,84 @@ "date": "2024-05-04", "daily_eggs": 1 } - ] + ], + "veterinarians": [ + { + "id": 1, + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET12345", + "availability": { + "monday": "9:00 AM - 5:00 PM", + "tuesday": "9:00 AM - 5:00 PM", + "wednesday": "9:00 AM - 5:00 PM", + "thursday": "9:00 AM - 5:00 PM", + "friday": "9:00 AM - 7:00 PM" + } + }, + { + "id": 2, + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET54321", + "availability": { + "monday": "8:00 AM - 4:00 PM", + "tuesday": "8:00 AM - 4:00 PM", + "wednesday": "8:00 AM - 12:00 PM", + "thursday": "8:00 AM - 4:00 PM", + "friday": "8:00 AM - 5:00 PM" + } + }, + { + "id": 3, + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": ["Poultry", "Dairy Cattle"], + "license": "VET67890", + "availability": { + "monday": "10:00 AM - 6:00 PM", + "tuesday": "10:00 AM - 6:00 PM", + "wednesday": "10:00 AM - 6:00 PM", + "thursday": "10:00 AM - 4:00 PM", + "friday": "10:00 AM - 5:00 PM" + } + }, + { + "id": 4, + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": ["Beef Cattle", "Sheep"], + "license": "VET11223", + "availability": { + "monday": "7:00 AM - 3:00 PM", + "tuesday": "7:00 AM - 3:00 PM", + "wednesday": "7:00 AM - 3:00 AM", + "thursday": "7:00 AM - 3:00 PM", + "friday": "7:00 AM - 1:00 PM" + } + }, + { + "id": 5, + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], + "license": "VET99887", + "availability": { + "monday": "11:00 AM - 7:00 PM", + "tuesday": "11:00 AM - 7:00 PM", + "wednesday": "11:00 AM - 5:00 PM", + "thursday": "11:00 AM - 7:00 PM", + "friday": "11:00 AM - 3:00 PM" + } + } +] + } + diff --git a/package-lock.json b/package-lock.json index 058d35d1..e946deba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,9 @@ "license": "ISC", "dependencies": { "cors": "^2.8.5", - "json-server": "^0.16.3" + "json-server": "^0.16.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" }, "devDependencies": { "nodemon": "1.18.4" @@ -1737,6 +1739,11 @@ "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=" }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, "node_modules/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -1827,6 +1834,17 @@ "node": ">= 4" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/lowdb": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-1.0.0.tgz", @@ -3098,6 +3116,29 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, "node_modules/readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -3262,6 +3303,14 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -5531,6 +5580,11 @@ "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -5606,6 +5660,14 @@ "resolved": "https://registry.npmjs.org/lodash-id/-/lodash-id-0.14.0.tgz", "integrity": "sha1-uvSJNOVDobXWNG+MhGmLGoyAOJY=" }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, "lowdb": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-1.0.0.tgz", @@ -6598,6 +6660,23 @@ } } }, + "react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -6733,6 +6812,14 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "requires": { + "loose-envify": "^1.1.0" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", diff --git a/package.json b/package.json index 6ed54410..8020dd22 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ }, "dependencies": { "cors": "^2.8.5", - "json-server": "^0.16.3" + "json-server": "^0.16.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" }, "devDependencies": { "nodemon": "1.18.4" diff --git a/public/index.html b/public/index.html index 956f62f0..fb5984e9 100644 --- a/public/index.html +++ b/public/index.html @@ -49,7 +49,11 @@

Welcome to the FarmFolio Server

Endpoints:

This server provides access to FarmFolio data through the following endpoints:

+
+ diff --git a/server.js b/server.js index 8a753265..c43485bb 100644 --- a/server.js +++ b/server.js @@ -14,4 +14,4 @@ const PORT = process.env.PORT || 3000; server.listen(PORT, () => { console.log(`JSON Server is running on http://localhost:${PORT}`); -}); +}); \ No newline at end of file From 9b5c65c20a68b1bc74685516d3782d98293d5b6c Mon Sep 17 00:00:00 2001 From: Bennie Date: Thu, 9 May 2024 21:56:49 +0300 Subject: [PATCH 06/20] Adds cows and products --- README.md | 2 +- db/db.json | 118 +++++++++++++++++++++++++++++++++++++++++++++- db/seeds.json | 118 +++++++++++++++++++++++++++++++++++++++++++++- public/index.html | 9 +++- 4 files changed, 241 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5367031e..04b5b1b6 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Since this server is for testing and prototyping, you can reset the data to its Feel free to reset the data to its initial state through: ``` -npm run seed + ``` diff --git a/db/db.json b/db/db.json index 7add0425..1e80929c 100644 --- a/db/db.json +++ b/db/db.json @@ -160,5 +160,119 @@ "date": "2024-05-04", "daily_eggs": 1 } - ] -} + ], + "products": [ + { + "id": 1, + "name": "Cow", + "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", + "description": "3 year old", + "price": 80000, + "location": "Kilifi" + }, + { + "id": 2, + "name": "Chicken", + "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", + "description": "6 months old", + "price": "500", + "location": "Kakamega" + }, + { + "id": 3, + "name": "tractor", + "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", + "description": "Ford Tractor", + "price": "2600000", + "location": "Kitale" + }, + { + "id": 4, + "name": "Eggs", + "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", + "description": "A crate of eggs", + "price": 450, + "location": "Eldoret" + + }, + { + "id": 5, + "name": "Milk", + "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", + "description": "fresh milk", + "price": "150 ", + "location": "Eldoret" + + }, + { + "id": 6, + "name": "Fertilizer", + "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", + "description": "DAP Fertlizer", + "price": "3000", + "location": "Eldoret" + + }, + { + "id": 7, + "name": "Maize Seed", + "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", + "description": "A packet of maize seed", + "price": "1500", + "location": "Eldoret" + + }, + + { + "id": 8, + "name": "Pesticide", + "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", + "description": "Best pest killer", + "price": "150 ", + "location": "Eldoret" + + } + ], + "veterinarians": [ + { + "id": 1, + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET12345" + }, + { + "id": 2, + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET54321" + }, + { + "id": 3, + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": ["Poultry", "Dairy Cattle"], + "license": "VET67890" + }, + { + "id": 4, + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": ["Beef Cattle", "Sheep"], + "license": "VET11223" + }, + { + "id": 5, + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], + "license": "VET99807" + } +] +} \ No newline at end of file diff --git a/db/seeds.json b/db/seeds.json index 7add0425..1e80929c 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -160,5 +160,119 @@ "date": "2024-05-04", "daily_eggs": 1 } - ] -} + ], + "products": [ + { + "id": 1, + "name": "Cow", + "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", + "description": "3 year old", + "price": 80000, + "location": "Kilifi" + }, + { + "id": 2, + "name": "Chicken", + "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", + "description": "6 months old", + "price": "500", + "location": "Kakamega" + }, + { + "id": 3, + "name": "tractor", + "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", + "description": "Ford Tractor", + "price": "2600000", + "location": "Kitale" + }, + { + "id": 4, + "name": "Eggs", + "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", + "description": "A crate of eggs", + "price": 450, + "location": "Eldoret" + + }, + { + "id": 5, + "name": "Milk", + "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", + "description": "fresh milk", + "price": "150 ", + "location": "Eldoret" + + }, + { + "id": 6, + "name": "Fertilizer", + "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", + "description": "DAP Fertlizer", + "price": "3000", + "location": "Eldoret" + + }, + { + "id": 7, + "name": "Maize Seed", + "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", + "description": "A packet of maize seed", + "price": "1500", + "location": "Eldoret" + + }, + + { + "id": 8, + "name": "Pesticide", + "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", + "description": "Best pest killer", + "price": "150 ", + "location": "Eldoret" + + } + ], + "veterinarians": [ + { + "id": 1, + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET12345" + }, + { + "id": 2, + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET54321" + }, + { + "id": 3, + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": ["Poultry", "Dairy Cattle"], + "license": "VET67890" + }, + { + "id": 4, + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": ["Beef Cattle", "Sheep"], + "license": "VET11223" + }, + { + "id": 5, + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], + "license": "VET99807" + } +] +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 956f62f0..07caf406 100644 --- a/public/index.html +++ b/public/index.html @@ -20,7 +20,7 @@ h2 { margin-top: 30px; - color: #666; + color: #0d0101; } ul { @@ -51,5 +51,12 @@

Endpoints:

+ + +products \ No newline at end of file From 3331060c1cc93448106a9bd090d9a40f9983fe40 Mon Sep 17 00:00:00 2001 From: Bennie Date: Thu, 9 May 2024 22:00:06 +0300 Subject: [PATCH 07/20] Adds links to html --- public/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/public/index.html b/public/index.html index 07caf406..87f2230a 100644 --- a/public/index.html +++ b/public/index.html @@ -59,4 +59,3 @@

Endpoints:

-products \ No newline at end of file From c873b62b9b83a397d739c261814a5a8a02bc4d30 Mon Sep 17 00:00:00 2001 From: Bennie Date: Thu, 9 May 2024 22:11:15 +0300 Subject: [PATCH 08/20] Adds cows --- db/db.json | 142 ++++++++++++++++++++++++++++++++++++++++++++++ db/seeds.json | 142 ++++++++++++++++++++++++++++++++++++++++++++++ public/index.html | 3 + 3 files changed, 287 insertions(+) diff --git a/db/db.json b/db/db.json index 1e80929c..b2bb4bfc 100644 --- a/db/db.json +++ b/db/db.json @@ -274,5 +274,147 @@ "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], "license": "VET99807" } +], +"cows": [ + { + "id": 1, + "age_months": 21, + "weight_kg": 360, + "daily_milk_production_g": 2800, + "feedType": "Grass" + }, + { + "id": 2, + "age_months": 25, + "weight_kg": 320, + "daily_milk_production_g": 2400, + "feed_type": "Grain" + }, + { + "id": 3, + "age_months": 24, + "weight_kg": 318, + "daily_milk_production_g": 2660, + "feedType": "Hay" + }, + { + "id": 4, + "age_months": 16, + "weight_kg": 327, + "daily_milk_production_g": 2760, + "feed_type": "Grain" + }, + { + "id": 5, + "age_months": 20, + "weight_kg": 350, + "daily_milk_production_g": 2550, + "feedType": "Grass" + }, + { + "id": 6, + "age_months": 30, + "weight_kg": 390, + "daily_milk_production_g": 2730, + "feedType": "Hay" + }, + { + "id": 7, + "age_months": 27, + "weight_kg": 364, + "daily_milk_production_g": 3300, + "feed_type": "Grain" + }, + { + "id": 8, + "age_months": 40, + "weight_kg": 390, + "daily_milk_production_g": 4000, + "feedType": "Grass" + }, + { + "id": 9, + "age_months": 17, + "weight_kg": 310, + "daily_milk_production_g": 2200, + "feedType": "Hay" + }, + { + "id": 10, + "age_months": 22, + "weight_kg": 370, + "daily_milk_production_g": 3500, + "feed_type": "Grain" + }, + { + "id": 11, + "age_months": 16, + "weight_kg": 340, + "daily_milk_production_g": 3700, + "feedType": "Grass" + }, + { + "id": 12, + "age_months": 35, + "weight_kg": 380, + "daily_milk_production_g": 3500, + "feed_type": "Grain" + }, + { + "id": 13, + "age_months": 27, + "weight_kg": 380, + "daily_milk_production_g": 3200, + "feedType": "Hay" + }, + { + "id": 14, + "age_months": 25, + "weight_kg": 380, + "daily_milk_production_g": 2700, + "feed_type": "Grain" + }, + { + "id": 15, + "age_months": 23, + "weight_kg": 354, + "daily_milk_production_g": 3800, + "feedType": "Grass" + }, + { + "id": 16, + "age_months": 20, + "weight_kg": 310, + "daily_milk_production_g": 1950, + "feedType": "Hay" + }, + { + "id": 17, + "age_months": 20, + "weight_kg": 325, + "daily_milk_production_g": 2300, + "feed_type": "Grain" + }, + { + "id": 18, + "age_months": 26, + "weight_kg": 360, + "daily_milk_production_g": 2800, + "feedType": "Grass" + }, + { + "id": 19, + "age_months": 18, + "weight_kg": 330, + "daily_milk_production_g": 2000, + "feedType": "Hay" + }, + { + "id": 20, + "age_months": 12, + "weight_kg": 350, + "daily_milk_production_g": 2500, + "feed_type": "Grain" + } ] } \ No newline at end of file diff --git a/db/seeds.json b/db/seeds.json index 1e80929c..b2bb4bfc 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -274,5 +274,147 @@ "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], "license": "VET99807" } +], +"cows": [ + { + "id": 1, + "age_months": 21, + "weight_kg": 360, + "daily_milk_production_g": 2800, + "feedType": "Grass" + }, + { + "id": 2, + "age_months": 25, + "weight_kg": 320, + "daily_milk_production_g": 2400, + "feed_type": "Grain" + }, + { + "id": 3, + "age_months": 24, + "weight_kg": 318, + "daily_milk_production_g": 2660, + "feedType": "Hay" + }, + { + "id": 4, + "age_months": 16, + "weight_kg": 327, + "daily_milk_production_g": 2760, + "feed_type": "Grain" + }, + { + "id": 5, + "age_months": 20, + "weight_kg": 350, + "daily_milk_production_g": 2550, + "feedType": "Grass" + }, + { + "id": 6, + "age_months": 30, + "weight_kg": 390, + "daily_milk_production_g": 2730, + "feedType": "Hay" + }, + { + "id": 7, + "age_months": 27, + "weight_kg": 364, + "daily_milk_production_g": 3300, + "feed_type": "Grain" + }, + { + "id": 8, + "age_months": 40, + "weight_kg": 390, + "daily_milk_production_g": 4000, + "feedType": "Grass" + }, + { + "id": 9, + "age_months": 17, + "weight_kg": 310, + "daily_milk_production_g": 2200, + "feedType": "Hay" + }, + { + "id": 10, + "age_months": 22, + "weight_kg": 370, + "daily_milk_production_g": 3500, + "feed_type": "Grain" + }, + { + "id": 11, + "age_months": 16, + "weight_kg": 340, + "daily_milk_production_g": 3700, + "feedType": "Grass" + }, + { + "id": 12, + "age_months": 35, + "weight_kg": 380, + "daily_milk_production_g": 3500, + "feed_type": "Grain" + }, + { + "id": 13, + "age_months": 27, + "weight_kg": 380, + "daily_milk_production_g": 3200, + "feedType": "Hay" + }, + { + "id": 14, + "age_months": 25, + "weight_kg": 380, + "daily_milk_production_g": 2700, + "feed_type": "Grain" + }, + { + "id": 15, + "age_months": 23, + "weight_kg": 354, + "daily_milk_production_g": 3800, + "feedType": "Grass" + }, + { + "id": 16, + "age_months": 20, + "weight_kg": 310, + "daily_milk_production_g": 1950, + "feedType": "Hay" + }, + { + "id": 17, + "age_months": 20, + "weight_kg": 325, + "daily_milk_production_g": 2300, + "feed_type": "Grain" + }, + { + "id": 18, + "age_months": 26, + "weight_kg": 360, + "daily_milk_production_g": 2800, + "feedType": "Grass" + }, + { + "id": 19, + "age_months": 18, + "weight_kg": 330, + "daily_milk_production_g": 2000, + "feedType": "Hay" + }, + { + "id": 20, + "age_months": 12, + "weight_kg": 350, + "daily_milk_production_g": 2500, + "feed_type": "Grain" + } ] } \ No newline at end of file diff --git a/public/index.html b/public/index.html index 87f2230a..c0ce5c2c 100644 --- a/public/index.html +++ b/public/index.html @@ -57,5 +57,8 @@

Endpoints:

+ From bcb98fd548405cd8f65f5b3819fa6742d7cb2c38 Mon Sep 17 00:00:00 2001 From: Bennie Date: Fri, 10 May 2024 18:44:48 +0300 Subject: [PATCH 09/20] Updates cows data --- db/db.json | 160 ++++++++++++++++---------------------------------- db/seeds.json | 160 ++++++++++++++++---------------------------------- 2 files changed, 100 insertions(+), 220 deletions(-) diff --git a/db/db.json b/db/db.json index b2bb4bfc..dbafbc44 100644 --- a/db/db.json +++ b/db/db.json @@ -278,143 +278,83 @@ "cows": [ { "id": 1, - "age_months": 21, - "weight_kg": 360, - "daily_milk_production_g": 2800, - "feedType": "Grass" + "name": "Tom", + "age": 24, + "weight": 450, + "milk": 20, + "feed": "Grass" }, { "id": 2, - "age_months": 25, - "weight_kg": 320, - "daily_milk_production_g": 2400, - "feed_type": "Grain" + "name": "Jerry", + "age": 30, + "weight": 490, + "milk": 25, + "feed": "Hay" }, { "id": 3, - "age_months": 24, - "weight_kg": 318, - "daily_milk_production_g": 2660, - "feedType": "Hay" + "name": "Lucy", + "age": 18, + "weight": 420, + "milk": 18, + "feed": "Silage" }, { "id": 4, - "age_months": 16, - "weight_kg": 327, - "daily_milk_production_g": 2760, - "feed_type": "Grain" + "name": "Bella", + "age": 36, + "weight": 510, + "milk": 28, + "feed": "Grain" }, { "id": 5, - "age_months": 20, - "weight_kg": 350, - "daily_milk_production_g": 2550, - "feedType": "Grass" + "name": "Luna", + "age": 22, + "weight": 440, + "milk": 21, + "feed": "Grass" }, { "id": 6, - "age_months": 30, - "weight_kg": 390, - "daily_milk_production_g": 2730, - "feedType": "Hay" + "name": "Max", + "age": 26, + "weight": 460, + "milk": 23, + "feed": "Hay" }, { "id": 7, - "age_months": 27, - "weight_kg": 364, - "daily_milk_production_g": 3300, - "feed_type": "Grain" + "name": "Charlie", + "age": 32, + "weight": 495, + "milk": 26, + "feed": "Silage" }, { "id": 8, - "age_months": 40, - "weight_kg": 390, - "daily_milk_production_g": 4000, - "feedType": "Grass" + "name": "Molly", + "age": 28, + "weight": 480, + "milk": 24, + "feed": "Grain" }, { "id": 9, - "age_months": 17, - "weight_kg": 310, - "daily_milk_production_g": 2200, - "feedType": "Hay" + "name": "Sadie", + "age": 20, + "weight": 430, + "milk": 19, + "feed": "Grass" }, { "id": 10, - "age_months": 22, - "weight_kg": 370, - "daily_milk_production_g": 3500, - "feed_type": "Grain" - }, - { - "id": 11, - "age_months": 16, - "weight_kg": 340, - "daily_milk_production_g": 3700, - "feedType": "Grass" - }, - { - "id": 12, - "age_months": 35, - "weight_kg": 380, - "daily_milk_production_g": 3500, - "feed_type": "Grain" - }, - { - "id": 13, - "age_months": 27, - "weight_kg": 380, - "daily_milk_production_g": 3200, - "feedType": "Hay" - }, - { - "id": 14, - "age_months": 25, - "weight_kg": 380, - "daily_milk_production_g": 2700, - "feed_type": "Grain" - }, - { - "id": 15, - "age_months": 23, - "weight_kg": 354, - "daily_milk_production_g": 3800, - "feedType": "Grass" - }, - { - "id": 16, - "age_months": 20, - "weight_kg": 310, - "daily_milk_production_g": 1950, - "feedType": "Hay" - }, - { - "id": 17, - "age_months": 20, - "weight_kg": 325, - "daily_milk_production_g": 2300, - "feed_type": "Grain" - }, - { - "id": 18, - "age_months": 26, - "weight_kg": 360, - "daily_milk_production_g": 2800, - "feedType": "Grass" - }, - { - "id": 19, - "age_months": 18, - "weight_kg": 330, - "daily_milk_production_g": 2000, - "feedType": "Hay" - }, - { - "id": 20, - "age_months": 12, - "weight_kg": 350, - "daily_milk_production_g": 2500, - "feed_type": "Grain" + "name": "Oscar", + "age": 40, + "weight": 520, + "milk": 30, + "feed": "Grain" } ] } \ No newline at end of file diff --git a/db/seeds.json b/db/seeds.json index b2bb4bfc..dbafbc44 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -278,143 +278,83 @@ "cows": [ { "id": 1, - "age_months": 21, - "weight_kg": 360, - "daily_milk_production_g": 2800, - "feedType": "Grass" + "name": "Tom", + "age": 24, + "weight": 450, + "milk": 20, + "feed": "Grass" }, { "id": 2, - "age_months": 25, - "weight_kg": 320, - "daily_milk_production_g": 2400, - "feed_type": "Grain" + "name": "Jerry", + "age": 30, + "weight": 490, + "milk": 25, + "feed": "Hay" }, { "id": 3, - "age_months": 24, - "weight_kg": 318, - "daily_milk_production_g": 2660, - "feedType": "Hay" + "name": "Lucy", + "age": 18, + "weight": 420, + "milk": 18, + "feed": "Silage" }, { "id": 4, - "age_months": 16, - "weight_kg": 327, - "daily_milk_production_g": 2760, - "feed_type": "Grain" + "name": "Bella", + "age": 36, + "weight": 510, + "milk": 28, + "feed": "Grain" }, { "id": 5, - "age_months": 20, - "weight_kg": 350, - "daily_milk_production_g": 2550, - "feedType": "Grass" + "name": "Luna", + "age": 22, + "weight": 440, + "milk": 21, + "feed": "Grass" }, { "id": 6, - "age_months": 30, - "weight_kg": 390, - "daily_milk_production_g": 2730, - "feedType": "Hay" + "name": "Max", + "age": 26, + "weight": 460, + "milk": 23, + "feed": "Hay" }, { "id": 7, - "age_months": 27, - "weight_kg": 364, - "daily_milk_production_g": 3300, - "feed_type": "Grain" + "name": "Charlie", + "age": 32, + "weight": 495, + "milk": 26, + "feed": "Silage" }, { "id": 8, - "age_months": 40, - "weight_kg": 390, - "daily_milk_production_g": 4000, - "feedType": "Grass" + "name": "Molly", + "age": 28, + "weight": 480, + "milk": 24, + "feed": "Grain" }, { "id": 9, - "age_months": 17, - "weight_kg": 310, - "daily_milk_production_g": 2200, - "feedType": "Hay" + "name": "Sadie", + "age": 20, + "weight": 430, + "milk": 19, + "feed": "Grass" }, { "id": 10, - "age_months": 22, - "weight_kg": 370, - "daily_milk_production_g": 3500, - "feed_type": "Grain" - }, - { - "id": 11, - "age_months": 16, - "weight_kg": 340, - "daily_milk_production_g": 3700, - "feedType": "Grass" - }, - { - "id": 12, - "age_months": 35, - "weight_kg": 380, - "daily_milk_production_g": 3500, - "feed_type": "Grain" - }, - { - "id": 13, - "age_months": 27, - "weight_kg": 380, - "daily_milk_production_g": 3200, - "feedType": "Hay" - }, - { - "id": 14, - "age_months": 25, - "weight_kg": 380, - "daily_milk_production_g": 2700, - "feed_type": "Grain" - }, - { - "id": 15, - "age_months": 23, - "weight_kg": 354, - "daily_milk_production_g": 3800, - "feedType": "Grass" - }, - { - "id": 16, - "age_months": 20, - "weight_kg": 310, - "daily_milk_production_g": 1950, - "feedType": "Hay" - }, - { - "id": 17, - "age_months": 20, - "weight_kg": 325, - "daily_milk_production_g": 2300, - "feed_type": "Grain" - }, - { - "id": 18, - "age_months": 26, - "weight_kg": 360, - "daily_milk_production_g": 2800, - "feedType": "Grass" - }, - { - "id": 19, - "age_months": 18, - "weight_kg": 330, - "daily_milk_production_g": 2000, - "feedType": "Hay" - }, - { - "id": 20, - "age_months": 12, - "weight_kg": 350, - "daily_milk_production_g": 2500, - "feed_type": "Grain" + "name": "Oscar", + "age": 40, + "weight": 520, + "milk": 30, + "feed": "Grain" } ] } \ No newline at end of file From 9265e9d87a68ac64104b13b41fdca8900c3aa42d Mon Sep 17 00:00:00 2001 From: Bennie Date: Fri, 10 May 2024 23:17:17 +0300 Subject: [PATCH 10/20] Adds dates to cows --- db/seeds.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db/seeds.json b/db/seeds.json index dbafbc44..389fc314 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -277,6 +277,7 @@ ], "cows": [ { + "date": "2024-05-17", "id": 1, "name": "Tom", "age": 24, @@ -285,6 +286,7 @@ "feed": "Grass" }, { + "date": "2024-05-17", "id": 2, "name": "Jerry", "age": 30, @@ -293,6 +295,7 @@ "feed": "Hay" }, { + "date": "2024-05-17", "id": 3, "name": "Lucy", "age": 18, @@ -301,6 +304,7 @@ "feed": "Silage" }, { + "date": "2024-05-17", "id": 4, "name": "Bella", "age": 36, @@ -309,6 +313,7 @@ "feed": "Grain" }, { + "date": "2024-05-17", "id": 5, "name": "Luna", "age": 22, @@ -317,6 +322,7 @@ "feed": "Grass" }, { + "date": "2024-05-17", "id": 6, "name": "Max", "age": 26, @@ -325,6 +331,7 @@ "feed": "Hay" }, { + "date": "2024-05-17", "id": 7, "name": "Charlie", "age": 32, @@ -333,6 +340,7 @@ "feed": "Silage" }, { + "date": "2024-05-17", "id": 8, "name": "Molly", "age": 28, @@ -341,6 +349,7 @@ "feed": "Grain" }, { + "date": "2024-05-17", "id": 9, "name": "Sadie", "age": 20, @@ -349,6 +358,7 @@ "feed": "Grass" }, { + "date": "2024-05-17", "id": 10, "name": "Oscar", "age": 40, From eb11d3361cbc5e63e01d889209c94351f2d48247 Mon Sep 17 00:00:00 2001 From: Bennie Date: Fri, 10 May 2024 23:20:17 +0300 Subject: [PATCH 11/20] Adds to db.json --- db/db.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db/db.json b/db/db.json index dbafbc44..389fc314 100644 --- a/db/db.json +++ b/db/db.json @@ -277,6 +277,7 @@ ], "cows": [ { + "date": "2024-05-17", "id": 1, "name": "Tom", "age": 24, @@ -285,6 +286,7 @@ "feed": "Grass" }, { + "date": "2024-05-17", "id": 2, "name": "Jerry", "age": 30, @@ -293,6 +295,7 @@ "feed": "Hay" }, { + "date": "2024-05-17", "id": 3, "name": "Lucy", "age": 18, @@ -301,6 +304,7 @@ "feed": "Silage" }, { + "date": "2024-05-17", "id": 4, "name": "Bella", "age": 36, @@ -309,6 +313,7 @@ "feed": "Grain" }, { + "date": "2024-05-17", "id": 5, "name": "Luna", "age": 22, @@ -317,6 +322,7 @@ "feed": "Grass" }, { + "date": "2024-05-17", "id": 6, "name": "Max", "age": 26, @@ -325,6 +331,7 @@ "feed": "Hay" }, { + "date": "2024-05-17", "id": 7, "name": "Charlie", "age": 32, @@ -333,6 +340,7 @@ "feed": "Silage" }, { + "date": "2024-05-17", "id": 8, "name": "Molly", "age": 28, @@ -341,6 +349,7 @@ "feed": "Grain" }, { + "date": "2024-05-17", "id": 9, "name": "Sadie", "age": 20, @@ -349,6 +358,7 @@ "feed": "Grass" }, { + "date": "2024-05-17", "id": 10, "name": "Oscar", "age": 40, From d5dedfb3854e7f1be4f7e2712a63122e3f828a75 Mon Sep 17 00:00:00 2001 From: Bennie Date: Fri, 10 May 2024 23:41:01 +0300 Subject: [PATCH 12/20] Adds chicken data --- db/seeds.json | 286 +++++--------------------------------------------- 1 file changed, 26 insertions(+), 260 deletions(-) diff --git a/db/seeds.json b/db/seeds.json index 389fc314..ab42fc99 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -1,279 +1,45 @@ { - "chickens": [ + "chicken": [ { + "date": "2024-05-17", "id": 1, - "age_months": 12, - "weight_kg": 2.5, - "total_eggs": 20, - "date": "2024-05-04", - "daily_eggs": 2 + "group": 1, + "number": 10, + "eggs": 100, + "food": 10 }, { + "date": "2024-05-17", "id": 2, - "age_months": 8, - "weight_kg": 1.8, - "total_eggs": 15, - "date": "2024-05-04", - "daily_eggs": 1 + "group": 1, + "number": 8, + "eggs": 85, + "food": 20 }, { + "date": "2024-05-17", "id": 3, - "age_months": 10, - "weight_kg": 1.6, - "total_eggs": 18, - "date": "2024-05-04", - "daily_eggs": 3 + "group": 2, + "number": 15, + "eggs": 150, + "food": 35 }, { + "date": "2024-05-17", "id": 4, - "age_months": 14, - "weight_kg": 2.3, - "total_eggs": 22, - "date": "2024-05-04", - "daily_eggs": 4 + "group": 2, + "number": 12, + "eggs": 110, + "food": 28 }, { + "date": "2024-05-17", "id": 5, - "age_months": 9, - "weight_kg": 1.7, - "total_eggs": 17, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 6, - "age_months": 11, - "weight_kg": 2.0, - "total_eggs": 19, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 7, - "age_months": 13, - "weight_kg": 2.2, - "total_eggs": 21, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 8, - "age_months": 7, - "weight_kg": 1.5, - "total_eggs": 14, - "date": "2024-05-04", - "daily_eggs": 1 - }, - { - "id": 9, - "age_months": 15, - "weight_kg": 2.6, - "total_eggs": 24, - "date": "2024-05-04", - "daily_eggs": 4 - }, - { - "id": 10, - "age_months": 16, - "weight_kg": 2.8, - "total_eggs": 26, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 11, - "age_months": 11, - "weight_kg": 2.1, - "total_eggs": 20, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 12, - "age_months": 18, - "weight_kg": 3.0, - "total_eggs": 28, - "date": "2024-05-04", - "daily_eggs": 4 - }, - { - "id": 13, - "age_months": 10, - "weight_kg": 2.2, - "total_eggs": 19, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 14, - "age_months": 12, - "weight_kg": 2.3, - "total_eggs": 21, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 15, - "age_months": 14, - "weight_kg": 2.4, - "total_eggs": 23, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 16, - "age_months": 9, - "weight_kg": 1.9, - "total_eggs": 16, - "date": "2024-05-04", - "daily_eggs": 1 - }, - { - "id": 17, - "age_months": 13, - "weight_kg": 2.3, - "total_eggs": 21, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 18, - "age_months": 10, - "weight_kg": 2.1, - "total_eggs": 18, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 19, - "age_months": 11, - "weight_kg": 2.2, - "total_eggs": 19, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 20, - "age_months": 12, - "weight_kg": 2.0, - "total_eggs": 20, - "date": "2024-05-04", - "daily_eggs": 1 + "group": 3, + "number": 20, + "eggs": 200, + "food": 50 } - ], - "products": [ - { - "id": 1, - "name": "Cow", - "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", - "description": "3 year old", - "price": 80000, - "location": "Kilifi" - }, - { - "id": 2, - "name": "Chicken", - "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", - "description": "6 months old", - "price": "500", - "location": "Kakamega" - }, - { - "id": 3, - "name": "tractor", - "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", - "description": "Ford Tractor", - "price": "2600000", - "location": "Kitale" - }, - { - "id": 4, - "name": "Eggs", - "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", - "description": "A crate of eggs", - "price": 450, - "location": "Eldoret" - - }, - { - "id": 5, - "name": "Milk", - "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", - "description": "fresh milk", - "price": "150 ", - "location": "Eldoret" - - }, - { - "id": 6, - "name": "Fertilizer", - "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", - "description": "DAP Fertlizer", - "price": "3000", - "location": "Eldoret" - - }, - { - "id": 7, - "name": "Maize Seed", - "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", - "description": "A packet of maize seed", - "price": "1500", - "location": "Eldoret" - - }, - - { - "id": 8, - "name": "Pesticide", - "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", - "description": "Best pest killer", - "price": "150 ", - "location": "Eldoret" - - } - ], - "veterinarians": [ - { - "id": 1, - "name": "Dr. John Smith", - "contact": "john.smith@example.com", - "phone": "+1234567890", - "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], - "license": "VET12345" - }, - { - "id": 2, - "name": "Dr. Emily Johnson", - "contact": "emily.johnson@example.com", - "phone": "+1987654321", - "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], - "license": "VET54321" - }, - { - "id": 3, - "name": "Dr. Sarah Lee", - "contact": "sarah.lee@example.com", - "phone": "+1122334455", - "specializations": ["Poultry", "Dairy Cattle"], - "license": "VET67890" - }, - { - "id": 4, - "name": "Dr. Michael Brown", - "contact": "michael.brown@example.com", - "phone": "+3344556677", - "specializations": ["Beef Cattle", "Sheep"], - "license": "VET11223" - }, - { - "id": 5, - "name": "Dr. Maria Garcia", - "contact": "maria.garcia@example.com", - "phone": "+5566778899", - "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], - "license": "VET99807" - } ], "cows": [ { From 34c3ec946cceb452ee663e6dae2d1fdaf95a0ad3 Mon Sep 17 00:00:00 2001 From: Bennie Date: Fri, 10 May 2024 23:44:01 +0300 Subject: [PATCH 13/20] Adds seed --- db/db.json | 412 +++++++++++++++++++------------------------------- db/seeds.json | 126 +++++++++++++++ 2 files changed, 278 insertions(+), 260 deletions(-) diff --git a/db/db.json b/db/db.json index 389fc314..b719174c 100644 --- a/db/db.json +++ b/db/db.json @@ -1,279 +1,45 @@ { - "chickens": [ + "chicken": [ { + "date": "2024-05-17", "id": 1, - "age_months": 12, - "weight_kg": 2.5, - "total_eggs": 20, - "date": "2024-05-04", - "daily_eggs": 2 + "group": 1, + "number": 10, + "eggs": 100, + "food": 10 }, { + "date": "2024-05-17", "id": 2, - "age_months": 8, - "weight_kg": 1.8, - "total_eggs": 15, - "date": "2024-05-04", - "daily_eggs": 1 + "group": 1, + "number": 8, + "eggs": 85, + "food": 20 }, { + "date": "2024-05-17", "id": 3, - "age_months": 10, - "weight_kg": 1.6, - "total_eggs": 18, - "date": "2024-05-04", - "daily_eggs": 3 + "group": 2, + "number": 15, + "eggs": 150, + "food": 35 }, { + "date": "2024-05-17", "id": 4, - "age_months": 14, - "weight_kg": 2.3, - "total_eggs": 22, - "date": "2024-05-04", - "daily_eggs": 4 + "group": 2, + "number": 12, + "eggs": 110, + "food": 28 }, { + "date": "2024-05-17", "id": 5, - "age_months": 9, - "weight_kg": 1.7, - "total_eggs": 17, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 6, - "age_months": 11, - "weight_kg": 2.0, - "total_eggs": 19, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 7, - "age_months": 13, - "weight_kg": 2.2, - "total_eggs": 21, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 8, - "age_months": 7, - "weight_kg": 1.5, - "total_eggs": 14, - "date": "2024-05-04", - "daily_eggs": 1 - }, - { - "id": 9, - "age_months": 15, - "weight_kg": 2.6, - "total_eggs": 24, - "date": "2024-05-04", - "daily_eggs": 4 - }, - { - "id": 10, - "age_months": 16, - "weight_kg": 2.8, - "total_eggs": 26, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 11, - "age_months": 11, - "weight_kg": 2.1, - "total_eggs": 20, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 12, - "age_months": 18, - "weight_kg": 3.0, - "total_eggs": 28, - "date": "2024-05-04", - "daily_eggs": 4 - }, - { - "id": 13, - "age_months": 10, - "weight_kg": 2.2, - "total_eggs": 19, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 14, - "age_months": 12, - "weight_kg": 2.3, - "total_eggs": 21, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 15, - "age_months": 14, - "weight_kg": 2.4, - "total_eggs": 23, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 16, - "age_months": 9, - "weight_kg": 1.9, - "total_eggs": 16, - "date": "2024-05-04", - "daily_eggs": 1 - }, - { - "id": 17, - "age_months": 13, - "weight_kg": 2.3, - "total_eggs": 21, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 18, - "age_months": 10, - "weight_kg": 2.1, - "total_eggs": 18, - "date": "2024-05-04", - "daily_eggs": 2 - }, - { - "id": 19, - "age_months": 11, - "weight_kg": 2.2, - "total_eggs": 19, - "date": "2024-05-04", - "daily_eggs": 3 - }, - { - "id": 20, - "age_months": 12, - "weight_kg": 2.0, - "total_eggs": 20, - "date": "2024-05-04", - "daily_eggs": 1 + "group": 3, + "number": 20, + "eggs": 200, + "food": 50 } - ], - "products": [ - { - "id": 1, - "name": "Cow", - "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", - "description": "3 year old", - "price": 80000, - "location": "Kilifi" - }, - { - "id": 2, - "name": "Chicken", - "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", - "description": "6 months old", - "price": "500", - "location": "Kakamega" - }, - { - "id": 3, - "name": "tractor", - "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", - "description": "Ford Tractor", - "price": "2600000", - "location": "Kitale" - }, - { - "id": 4, - "name": "Eggs", - "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", - "description": "A crate of eggs", - "price": 450, - "location": "Eldoret" - - }, - { - "id": 5, - "name": "Milk", - "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", - "description": "fresh milk", - "price": "150 ", - "location": "Eldoret" - - }, - { - "id": 6, - "name": "Fertilizer", - "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", - "description": "DAP Fertlizer", - "price": "3000", - "location": "Eldoret" - - }, - { - "id": 7, - "name": "Maize Seed", - "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", - "description": "A packet of maize seed", - "price": "1500", - "location": "Eldoret" - - }, - - { - "id": 8, - "name": "Pesticide", - "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", - "description": "Best pest killer", - "price": "150 ", - "location": "Eldoret" - - } - ], - "veterinarians": [ - { - "id": 1, - "name": "Dr. John Smith", - "contact": "john.smith@example.com", - "phone": "+1234567890", - "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], - "license": "VET12345" - }, - { - "id": 2, - "name": "Dr. Emily Johnson", - "contact": "emily.johnson@example.com", - "phone": "+1987654321", - "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], - "license": "VET54321" - }, - { - "id": 3, - "name": "Dr. Sarah Lee", - "contact": "sarah.lee@example.com", - "phone": "+1122334455", - "specializations": ["Poultry", "Dairy Cattle"], - "license": "VET67890" - }, - { - "id": 4, - "name": "Dr. Michael Brown", - "contact": "michael.brown@example.com", - "phone": "+3344556677", - "specializations": ["Beef Cattle", "Sheep"], - "license": "VET11223" - }, - { - "id": 5, - "name": "Dr. Maria Garcia", - "contact": "maria.garcia@example.com", - "phone": "+5566778899", - "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], - "license": "VET99807" - } ], "cows": [ { @@ -366,5 +132,131 @@ "milk": 30, "feed": "Grain" } +], +[ + { + "id": 1, + "name": "Cow", + "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", + "description": "3 year old", + "price": 80000, + "location": "Kilifi" + }, + { + "id": 2, + "name": "Chicken", + "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", + "description": "6 months old", + "price": "500", + "location": "Kakamega" + }, + { + "id": 3, + "name": "tractor", + "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", + "description": "Ford Tractor", + "price": "2600000", + "location": "Kitale" + }, + { + "id": 4, + "name": "Eggs", + "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", + "description": "A crate of eggs", + "price": 450, + "location": "Eldoret" + }, + { + "id": 5, + "name": "Milk", + "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", + "description": "fresh milk", + "price": "150 ", + "location": "Eldoret" + }, + { + "id": 6, + "name": "Fertilizer", + "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", + "description": "DAP Fertlizer", + "price": "3000", + "location": "Eldoret" + }, + { + "id": 7, + "name": "Maize Seed", + "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", + "description": "A packet of maize seed", + "price": "1500", + "location": "Eldoret" + }, + { + "id": 8, + "name": "Pesticide", + "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", + "description": "Best pest killer", + "price": "150 ", + "location": "Eldoret" + } +], +[ + { + "id": 1, + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": [ + "Beef Cattle", + "Dairy Cattle", + "Poultry" + ], + "license": "VET12345" + }, + { + "id": 2, + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": [ + "Beef Cattle", + "Dairy Cattle", + "Poultry" + ], + "license": "VET54321" + }, + { + "id": 3, + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": [ + "Poultry", + "Dairy Cattle" + ], + "license": "VET67890" + }, + { + "id": 4, + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": [ + "Beef Cattle", + "Sheep" + ], + "license": "VET11223" + }, + { + "id": 5, + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": [ + "Exotic Animals", + "Beef Cattle", + "Dairy Cattle" + ], + "license": "VET99807" + } ] } \ No newline at end of file diff --git a/db/seeds.json b/db/seeds.json index ab42fc99..b719174c 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -132,5 +132,131 @@ "milk": 30, "feed": "Grain" } +], +[ + { + "id": 1, + "name": "Cow", + "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", + "description": "3 year old", + "price": 80000, + "location": "Kilifi" + }, + { + "id": 2, + "name": "Chicken", + "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", + "description": "6 months old", + "price": "500", + "location": "Kakamega" + }, + { + "id": 3, + "name": "tractor", + "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", + "description": "Ford Tractor", + "price": "2600000", + "location": "Kitale" + }, + { + "id": 4, + "name": "Eggs", + "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", + "description": "A crate of eggs", + "price": 450, + "location": "Eldoret" + }, + { + "id": 5, + "name": "Milk", + "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", + "description": "fresh milk", + "price": "150 ", + "location": "Eldoret" + }, + { + "id": 6, + "name": "Fertilizer", + "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", + "description": "DAP Fertlizer", + "price": "3000", + "location": "Eldoret" + }, + { + "id": 7, + "name": "Maize Seed", + "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", + "description": "A packet of maize seed", + "price": "1500", + "location": "Eldoret" + }, + { + "id": 8, + "name": "Pesticide", + "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", + "description": "Best pest killer", + "price": "150 ", + "location": "Eldoret" + } +], +[ + { + "id": 1, + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": [ + "Beef Cattle", + "Dairy Cattle", + "Poultry" + ], + "license": "VET12345" + }, + { + "id": 2, + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": [ + "Beef Cattle", + "Dairy Cattle", + "Poultry" + ], + "license": "VET54321" + }, + { + "id": 3, + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": [ + "Poultry", + "Dairy Cattle" + ], + "license": "VET67890" + }, + { + "id": 4, + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": [ + "Beef Cattle", + "Sheep" + ], + "license": "VET11223" + }, + { + "id": 5, + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": [ + "Exotic Animals", + "Beef Cattle", + "Dairy Cattle" + ], + "license": "VET99807" + } ] } \ No newline at end of file From f62b1f32982ae9bb21142cd6bd68bbe7ce7c6876 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 11 May 2024 00:16:55 +0300 Subject: [PATCH 14/20] Adds data --- db/db.json | 5 +++-- db/seeds.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/db/db.json b/db/db.json index b719174c..25b47edf 100644 --- a/db/db.json +++ b/db/db.json @@ -133,7 +133,8 @@ "feed": "Grain" } ], -[ + +"products": [ { "id": 1, "name": "Cow", @@ -199,7 +200,7 @@ "location": "Eldoret" } ], -[ + "veterinarians": [ { "id": 1, "name": "Dr. John Smith", diff --git a/db/seeds.json b/db/seeds.json index b719174c..25b47edf 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -133,7 +133,8 @@ "feed": "Grain" } ], -[ + +"products": [ { "id": 1, "name": "Cow", @@ -199,7 +200,7 @@ "location": "Eldoret" } ], -[ + "veterinarians": [ { "id": 1, "name": "Dr. John Smith", From 319936da12cb51412d1108280ef6b76095357438 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 11 May 2024 00:20:10 +0300 Subject: [PATCH 15/20] Adds data --- db/db.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db.json b/db/db.json index 25b47edf..243b2225 100644 --- a/db/db.json +++ b/db/db.json @@ -1,5 +1,5 @@ { - "chicken": [ + "chickens": [ { "date": "2024-05-17", "id": 1, From 6c0f7742686ca748284cc409d53475af7395dd01 Mon Sep 17 00:00:00 2001 From: Maggie-karuri Date: Sat, 11 May 2024 03:57:33 +0300 Subject: [PATCH 16/20] updated images --- db/db.json | 9 +- db/seeds.json | 267 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 271 insertions(+), 5 deletions(-) diff --git a/db/db.json b/db/db.json index b9869ddf..d3d05f5e 100644 --- a/db/db.json +++ b/db/db.json @@ -1,5 +1,5 @@ { - "chicken": [ + "chickens": [ { "id": 1, "age_months": 12, @@ -236,6 +236,7 @@ "veterinarians": [ { "id": 1, + "imageUrl": "https://media.istockphoto.com/id/1189303662/photo/portrait-of-happy-african-doctor-at-private-clinic.jpg?s=612x612&w=0&k=20&c=P1sA44uF-qI-8Ox5iv4j7dMThSB9trT_QPjYdS13sKo=", "name": "Dr. John Smith", "contact": "john.smith@example.com", "phone": "+1234567890", @@ -244,6 +245,7 @@ }, { "id": 2, + "imageUrl": "https://img.freepik.com/free-photo/ill-puppy-x-ray-image_329181-10408.jpg", "name": "Dr. Emily Johnson", "contact": "emily.johnson@example.com", "phone": "+1987654321", @@ -252,6 +254,7 @@ }, { "id": 3, + "imageUrl": "https://vetmed.illinois.edu/wp-content/uploads/2022/02/johnson-walker-feature.jpg", "name": "Dr. Sarah Lee", "contact": "sarah.lee@example.com", "phone": "+1122334455", @@ -260,6 +263,7 @@ }, { "id": 4, + "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Ft3.ftcdn.net%2Fjpg%2F00%2F90%2F13%2F54%2F360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg&tbnid=e3KReuLHLIElTM&vet=12ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg..i&imgrefurl=https%3A%2F%2Fstock.adobe.com%2Fsearch%2Fimages%3Fk%3Dcow%2Bdoctor&docid=7MXGKvyb_gwpeM&w=540&h=360&itg=1&q=veterinary%20doctor%20image&hl=en&ved=2ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg", "name": "Dr. Michael Brown", "contact": "michael.brown@example.com", "phone": "+3344556677", @@ -268,6 +272,7 @@ }, { "id": 5, + "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Fc8.alamy.com%2Fcomp%2F2N6RWRY%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-2N6RWRY.jpg&tbnid=P0iHXks_QkOwaM&vet=12ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8..i&imgrefurl=https%3A%2F%2Fwww.alamy.com%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-image520524143.html&docid=mSn5HUL9khCx2M&w=1300&h=946&q=veterinary%20doctor%20image%20cow%20female&hl=en&ved=2ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8", "name": "Dr. Maria Garcia", "contact": "maria.garcia@example.com", "phone": "+5566778899", @@ -417,4 +422,4 @@ "feed_type": "Grain" } ] -} +} \ No newline at end of file diff --git a/db/seeds.json b/db/seeds.json index 75ef8d85..d3d05f5e 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -1,5 +1,5 @@ { - "chicken": [ + "chickens": [ { "id": 1, "age_months": 12, @@ -160,5 +160,266 @@ "date": "2024-05-04", "daily_eggs": 1 } - ] -} + ], + "products": [ + { + "id": 1, + "name": "Cow", + "imageUrl": "https://i.pinimg.com/564x/d7/d8/3c/d7d83cf0a11793d98b5907a8afd13b21.jpg", + "description": "3 year old", + "price": 80000, + "location": "Kilifi" + }, + { + "id": 2, + "name": "Chicken", + "imageUrl": "https://i.pinimg.com/564x/30/42/f4/3042f4a966af79f8d6d5c95e59c83fc1.jpg", + "description": "6 months old", + "price": "500", + "location": "Kakamega" + }, + { + "id": 3, + "name": "tractor", + "imageUrl": "https://i.pinimg.com/564x/75/dc/2f/75dc2fbd793747d966cdbe42face51e5.jpg", + "description": "Ford Tractor", + "price": "2600000", + "location": "Kitale" + }, + { + "id": 4, + "name": "Eggs", + "imageUrl": "https://i.pinimg.com/564x/1a/fe/d7/1afed7fe5e450b06c347bfa7810b38a3.jpg", + "description": "A crate of eggs", + "price": 450, + "location": "Eldoret" + + }, + { + "id": 5, + "name": "Milk", + "imageUrl": "https://i.pinimg.com/564x/5e/14/52/5e14526b4290b95c0bed550cf004d7f6.jpg", + "description": "fresh milk", + "price": "150 ", + "location": "Eldoret" + + }, + { + "id": 6, + "name": "Fertilizer", + "imageUrl": "https://i.pinimg.com/564x/dd/7e/1c/dd7e1ce0e31d33adfabd66934b999cb5.jpg", + "description": "DAP Fertlizer", + "price": "3000", + "location": "Eldoret" + + }, + { + "id": 7, + "name": "Maize Seed", + "imageUrl": "https://i.pinimg.com/564x/75/69/87/756987113da38d16783db702353b87b3.jpg", + "description": "A packet of maize seed", + "price": "1500", + "location": "Eldoret" + + }, + + { + "id": 8, + "name": "Pesticide", + "imageUrl": "https://i.pinimg.com/564x/3e/b4/5a/3eb45a8f5edc24960403124305804284.jpg", + "description": "Best pest killer", + "price": "150 ", + "location": "Eldoret" + + } + ], + "veterinarians": [ + { + "id": 1, + "imageUrl": "https://media.istockphoto.com/id/1189303662/photo/portrait-of-happy-african-doctor-at-private-clinic.jpg?s=612x612&w=0&k=20&c=P1sA44uF-qI-8Ox5iv4j7dMThSB9trT_QPjYdS13sKo=", + "name": "Dr. John Smith", + "contact": "john.smith@example.com", + "phone": "+1234567890", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET12345" + }, + { + "id": 2, + "imageUrl": "https://img.freepik.com/free-photo/ill-puppy-x-ray-image_329181-10408.jpg", + "name": "Dr. Emily Johnson", + "contact": "emily.johnson@example.com", + "phone": "+1987654321", + "specializations": ["Beef Cattle", "Dairy Cattle", "Poultry"], + "license": "VET54321" + }, + { + "id": 3, + "imageUrl": "https://vetmed.illinois.edu/wp-content/uploads/2022/02/johnson-walker-feature.jpg", + "name": "Dr. Sarah Lee", + "contact": "sarah.lee@example.com", + "phone": "+1122334455", + "specializations": ["Poultry", "Dairy Cattle"], + "license": "VET67890" + }, + { + "id": 4, + "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Ft3.ftcdn.net%2Fjpg%2F00%2F90%2F13%2F54%2F360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg&tbnid=e3KReuLHLIElTM&vet=12ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg..i&imgrefurl=https%3A%2F%2Fstock.adobe.com%2Fsearch%2Fimages%3Fk%3Dcow%2Bdoctor&docid=7MXGKvyb_gwpeM&w=540&h=360&itg=1&q=veterinary%20doctor%20image&hl=en&ved=2ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg", + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": ["Beef Cattle", "Sheep"], + "license": "VET11223" + }, + { + "id": 5, + "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Fc8.alamy.com%2Fcomp%2F2N6RWRY%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-2N6RWRY.jpg&tbnid=P0iHXks_QkOwaM&vet=12ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8..i&imgrefurl=https%3A%2F%2Fwww.alamy.com%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-image520524143.html&docid=mSn5HUL9khCx2M&w=1300&h=946&q=veterinary%20doctor%20image%20cow%20female&hl=en&ved=2ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8", + "name": "Dr. Maria Garcia", + "contact": "maria.garcia@example.com", + "phone": "+5566778899", + "specializations": ["Exotic Animals", "Beef Cattle", "Dairy Cattle"], + "license": "VET99807" + } +], +"cows": [ + { + "id": 1, + "age_months": 21, + "weight_kg": 360, + "daily_milk_production_g": 2800, + "feedType": "Grass" + }, + { + "id": 2, + "age_months": 25, + "weight_kg": 320, + "daily_milk_production_g": 2400, + "feed_type": "Grain" + }, + { + "id": 3, + "age_months": 24, + "weight_kg": 318, + "daily_milk_production_g": 2660, + "feedType": "Hay" + }, + { + "id": 4, + "age_months": 16, + "weight_kg": 327, + "daily_milk_production_g": 2760, + "feed_type": "Grain" + }, + { + "id": 5, + "age_months": 20, + "weight_kg": 350, + "daily_milk_production_g": 2550, + "feedType": "Grass" + }, + { + "id": 6, + "age_months": 30, + "weight_kg": 390, + "daily_milk_production_g": 2730, + "feedType": "Hay" + }, + { + "id": 7, + "age_months": 27, + "weight_kg": 364, + "daily_milk_production_g": 3300, + "feed_type": "Grain" + }, + { + "id": 8, + "age_months": 40, + "weight_kg": 390, + "daily_milk_production_g": 4000, + "feedType": "Grass" + }, + { + "id": 9, + "age_months": 17, + "weight_kg": 310, + "daily_milk_production_g": 2200, + "feedType": "Hay" + }, + { + "id": 10, + "age_months": 22, + "weight_kg": 370, + "daily_milk_production_g": 3500, + "feed_type": "Grain" + }, + { + "id": 11, + "age_months": 16, + "weight_kg": 340, + "daily_milk_production_g": 3700, + "feedType": "Grass" + }, + { + "id": 12, + "age_months": 35, + "weight_kg": 380, + "daily_milk_production_g": 3500, + "feed_type": "Grain" + }, + { + "id": 13, + "age_months": 27, + "weight_kg": 380, + "daily_milk_production_g": 3200, + "feedType": "Hay" + }, + { + "id": 14, + "age_months": 25, + "weight_kg": 380, + "daily_milk_production_g": 2700, + "feed_type": "Grain" + }, + { + "id": 15, + "age_months": 23, + "weight_kg": 354, + "daily_milk_production_g": 3800, + "feedType": "Grass" + }, + { + "id": 16, + "age_months": 20, + "weight_kg": 310, + "daily_milk_production_g": 1950, + "feedType": "Hay" + }, + { + "id": 17, + "age_months": 20, + "weight_kg": 325, + "daily_milk_production_g": 2300, + "feed_type": "Grain" + }, + { + "id": 18, + "age_months": 26, + "weight_kg": 360, + "daily_milk_production_g": 2800, + "feedType": "Grass" + }, + { + "id": 19, + "age_months": 18, + "weight_kg": 330, + "daily_milk_production_g": 2000, + "feedType": "Hay" + }, + { + "id": 20, + "age_months": 12, + "weight_kg": 350, + "daily_milk_production_g": 2500, + "feed_type": "Grain" + } +] +} \ No newline at end of file From bed442d257559e59560c805656646047c23503e0 Mon Sep 17 00:00:00 2001 From: Maggie-karuri Date: Sat, 11 May 2024 05:12:32 +0300 Subject: [PATCH 17/20] updated images --- db/db.json | 6 +++--- db/seeds.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/db.json b/db/db.json index 917874c5..23f199fd 100644 --- a/db/db.json +++ b/db/db.json @@ -1,5 +1,5 @@ { - "chickens": [ + "chicken": [ { "date": "2024-05-17", "id": 1, @@ -241,7 +241,7 @@ }, { "id": 4, - "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Ft3.ftcdn.net%2Fjpg%2F00%2F90%2F13%2F54%2F360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg&tbnid=e3KReuLHLIElTM&vet=12ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg..i&imgrefurl=https%3A%2F%2Fstock.adobe.com%2Fsearch%2Fimages%3Fk%3Dcow%2Bdoctor&docid=7MXGKvyb_gwpeM&w=540&h=360&itg=1&q=veterinary%20doctor%20image&hl=en&ved=2ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg", + "imageUrl": "https://t3.ftcdn.net/jpg/00/90/13/54/360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg", "name": "Dr. Michael Brown", "contact": "michael.brown@example.com", "phone": "+3344556677", @@ -253,7 +253,7 @@ }, { "id": 5, - "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Fc8.alamy.com%2Fcomp%2F2N6RWRY%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-2N6RWRY.jpg&tbnid=P0iHXks_QkOwaM&vet=12ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8..i&imgrefurl=https%3A%2F%2Fwww.alamy.com%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-image520524143.html&docid=mSn5HUL9khCx2M&w=1300&h=946&q=veterinary%20doctor%20image%20cow%20female&hl=en&ved=2ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8", + "imageUrl": "https://t4.ftcdn.net/jpg/07/73/67/37/360_F_773673773_BvF150LmX1ZNZRtZZta73STLK3JDnrFv.jpg", "name": "Dr. Maria Garcia", "contact": "maria.garcia@example.com", "phone": "+5566778899", diff --git a/db/seeds.json b/db/seeds.json index 7aca3e07..23f199fd 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -241,7 +241,7 @@ }, { "id": 4, - "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Ft3.ftcdn.net%2Fjpg%2F00%2F90%2F13%2F54%2F360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg&tbnid=e3KReuLHLIElTM&vet=12ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg..i&imgrefurl=https%3A%2F%2Fstock.adobe.com%2Fsearch%2Fimages%3Fk%3Dcow%2Bdoctor&docid=7MXGKvyb_gwpeM&w=540&h=360&itg=1&q=veterinary%20doctor%20image&hl=en&ved=2ahUKEwjQrKO_rYSGAxXX-AIHHYVXCSsQxiAoB3oECAAQMg", + "imageUrl": "https://t3.ftcdn.net/jpg/00/90/13/54/360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg", "name": "Dr. Michael Brown", "contact": "michael.brown@example.com", "phone": "+3344556677", @@ -253,7 +253,7 @@ }, { "id": 5, - "imageUrl": "https://www.google.com/imgres?imgurl=https%3A%2F%2Fc8.alamy.com%2Fcomp%2F2N6RWRY%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-2N6RWRY.jpg&tbnid=P0iHXks_QkOwaM&vet=12ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8..i&imgrefurl=https%3A%2F%2Fwww.alamy.com%2Fvet-doctor-or-black-woman-with-cattle-farming-agriculture-or-food-industry-for-healthcare-check-inspection-and-portrait-professional-african-person-image520524143.html&docid=mSn5HUL9khCx2M&w=1300&h=946&q=veterinary%20doctor%20image%20cow%20female&hl=en&ved=2ahUKEwjv6-6vroSGAxWFGhAIHX8OBLwQMygDegQIARA8", + "imageUrl": "https://t4.ftcdn.net/jpg/07/73/67/37/360_F_773673773_BvF150LmX1ZNZRtZZta73STLK3JDnrFv.jpg", "name": "Dr. Maria Garcia", "contact": "maria.garcia@example.com", "phone": "+5566778899", From c3b683dc5414641a1567be55c5ec554af86a069a Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 11 May 2024 20:43:16 +0300 Subject: [PATCH 18/20] Adds chickens --- public/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/public/index.html b/public/index.html index de7546c5..e622b57b 100644 --- a/public/index.html +++ b/public/index.html @@ -50,11 +50,7 @@

Endpoints:

This server provides access to FarmFolio data through the following endpoints:

-
- From ed5c549d366af56d1bf8edfbda7bfe1ded7f9cf2 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 11 May 2024 20:57:54 +0300 Subject: [PATCH 19/20] Changes endpoint --- db/db.json | 2 +- db/seeds.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/db.json b/db/db.json index 23f199fd..b244e411 100644 --- a/db/db.json +++ b/db/db.json @@ -1,5 +1,5 @@ { - "chicken": [ + "chickens": [ { "date": "2024-05-17", "id": 1, diff --git a/db/seeds.json b/db/seeds.json index 23f199fd..b244e411 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -1,5 +1,5 @@ { - "chicken": [ + "chickens": [ { "date": "2024-05-17", "id": 1, From 304a3e684b728995350e1795f16a2b091bfa8f74 Mon Sep 17 00:00:00 2001 From: Bennie Date: Sat, 11 May 2024 20:59:51 +0300 Subject: [PATCH 20/20] Adds endpoint --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index e622b57b..c8f71ef9 100644 --- a/public/index.html +++ b/public/index.html @@ -49,7 +49,7 @@

Welcome to the FarmFolio Server

Endpoints:

This server provides access to FarmFolio data through the following endpoints: