diff --git a/README.md b/README.md index d787fdb0..04b5b1b6 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,40 @@ -# 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 -``` +## 1. Clone the repository -## Seeding Data - -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 +## 2. Install the dependencies -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. - -### Sign Up for a Render Account +``` +npm install -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 +## 3. Start the development server -Once you've completed the signup process, you will be taken to the Render -dashboard. +``` +npm run dev -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 +use CTRL + C to stop 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. +## 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. -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. +Feel free to reset the data to its initial state through: -### 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: -```sh -git add . -git commit -m "Updated database" -git push ``` -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." +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 diff --git a/db/db.json b/db/db.json index 746cc522..b244e411 100644 --- a/db/db.json +++ b/db/db.json @@ -1,444 +1,268 @@ { - "example": [ + "chickens": [ { + "date": "2024-05-17", "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 + "group": 1, + "number": 10, + "eggs": 100, + "food": 10 }, { + "date": "2024-05-17", "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 + "group": 1, + "number": 8, + "eggs": 85, + "food": 20 }, { + "date": "2024-05-17", "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 + "group": 2, + "number": 15, + "eggs": 150, + "food": 35 }, { + "date": "2024-05-17", "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 + "group": 2, + "number": 12, + "eggs": 110, + "food": 28 }, { + "date": "2024-05-17", "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 + "group": 3, + "number": 20, + "eggs": 200, + "food": 50 } - ] -} +], +"cows": [ + { + "date": "2024-05-17", + "id": 1, + "name": "Tom", + "age": 24, + "weight": 450, + "milk": 20, + "feed": "Grass" + }, + { + "date": "2024-05-17", + "id": 2, + "name": "Jerry", + "age": 30, + "weight": 490, + "milk": 25, + "feed": "Hay" + }, + { + "date": "2024-05-17", + "id": 3, + "name": "Lucy", + "age": 18, + "weight": 420, + "milk": 18, + "feed": "Silage" + }, + { + "date": "2024-05-17", + "id": 4, + "name": "Bella", + "age": 36, + "weight": 510, + "milk": 28, + "feed": "Grain" + }, + { + "date": "2024-05-17", + "id": 5, + "name": "Luna", + "age": 22, + "weight": 440, + "milk": 21, + "feed": "Grass" + }, + { + "date": "2024-05-17", + "id": 6, + "name": "Max", + "age": 26, + "weight": 460, + "milk": 23, + "feed": "Hay" + }, + { + "date": "2024-05-17", + "id": 7, + "name": "Charlie", + "age": 32, + "weight": 495, + "milk": 26, + "feed": "Silage" + }, + { + "date": "2024-05-17", + "id": 8, + "name": "Molly", + "age": 28, + "weight": 480, + "milk": 24, + "feed": "Grain" + }, + { + "date": "2024-05-17", + "id": 9, + "name": "Sadie", + "age": 20, + "weight": 430, + "milk": 19, + "feed": "Grass" + }, + { + "date": "2024-05-17", + "id": 10, + "name": "Oscar", + "age": 40, + "weight": 520, + "milk": 30, + "feed": "Grain" + } +], + +"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://t3.ftcdn.net/jpg/00/90/13/54/360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg", + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": [ + "Beef Cattle", + "Sheep" + ], + "license": "VET11223" + }, + { + "id": 5, + "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", + "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 746cc522..b244e411 100644 --- a/db/seeds.json +++ b/db/seeds.json @@ -1,444 +1,268 @@ { - "example": [ + "chickens": [ { + "date": "2024-05-17", "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 + "group": 1, + "number": 10, + "eggs": 100, + "food": 10 }, { + "date": "2024-05-17", "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 + "group": 1, + "number": 8, + "eggs": 85, + "food": 20 }, { + "date": "2024-05-17", "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 + "group": 2, + "number": 15, + "eggs": 150, + "food": 35 }, { + "date": "2024-05-17", "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 + "group": 2, + "number": 12, + "eggs": 110, + "food": 28 }, { + "date": "2024-05-17", "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 + "group": 3, + "number": 20, + "eggs": 200, + "food": 50 } - ] -} +], +"cows": [ + { + "date": "2024-05-17", + "id": 1, + "name": "Tom", + "age": 24, + "weight": 450, + "milk": 20, + "feed": "Grass" + }, + { + "date": "2024-05-17", + "id": 2, + "name": "Jerry", + "age": 30, + "weight": 490, + "milk": 25, + "feed": "Hay" + }, + { + "date": "2024-05-17", + "id": 3, + "name": "Lucy", + "age": 18, + "weight": 420, + "milk": 18, + "feed": "Silage" + }, + { + "date": "2024-05-17", + "id": 4, + "name": "Bella", + "age": 36, + "weight": 510, + "milk": 28, + "feed": "Grain" + }, + { + "date": "2024-05-17", + "id": 5, + "name": "Luna", + "age": 22, + "weight": 440, + "milk": 21, + "feed": "Grass" + }, + { + "date": "2024-05-17", + "id": 6, + "name": "Max", + "age": 26, + "weight": 460, + "milk": 23, + "feed": "Hay" + }, + { + "date": "2024-05-17", + "id": 7, + "name": "Charlie", + "age": 32, + "weight": 495, + "milk": 26, + "feed": "Silage" + }, + { + "date": "2024-05-17", + "id": 8, + "name": "Molly", + "age": 28, + "weight": 480, + "milk": 24, + "feed": "Grain" + }, + { + "date": "2024-05-17", + "id": 9, + "name": "Sadie", + "age": 20, + "weight": 430, + "milk": 19, + "feed": "Grass" + }, + { + "date": "2024-05-17", + "id": 10, + "name": "Oscar", + "age": 40, + "weight": 520, + "milk": 30, + "feed": "Grain" + } +], + +"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://t3.ftcdn.net/jpg/00/90/13/54/360_F_90135478_lxK4uE9obbedwV0IRjEC0thl5yU94Ngg.jpg", + "name": "Dr. Michael Brown", + "contact": "michael.brown@example.com", + "phone": "+3344556677", + "specializations": [ + "Beef Cattle", + "Sheep" + ], + "license": "VET11223" + }, + { + "id": 5, + "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", + "specializations": [ + "Exotic Animals", + "Beef Cattle", + "Dairy Cattle" + ], + "license": "VET99807" + } +] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 68b763ec..e946deba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,18 @@ { "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", - "json-server": "^0.16.3" + "json-server": "^0.16.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" }, "devDependencies": { "nodemon": "1.18.4" @@ -1736,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", @@ -1826,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", @@ -3097,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", @@ -3261,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", @@ -5530,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", @@ -5605,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", @@ -6597,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", @@ -6732,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 new file mode 100644 index 00000000..c8f71ef9 --- /dev/null +++ b/public/index.html @@ -0,0 +1,64 @@ + + + + + + Chicken Server Main Page + + + +

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