- Introduction
- Environment Variables
- Run Locally
- Running Tests
- Tech Stack
- API References
- The Team
- Appendix
Welcome to Care-Full!
This app was created as part of the School of Code bootcamp, a team of 6 animal lovers came together and began brainstorming what real world problem we wanted to solve. Soon we realised a common issue experienced amongst pet owners - remembering when specific symptoms began and tracking how many times a symptom has been experienced. This then led us onto talking about the difficulty of remembering when you need to administer medication and attend appointments. After lots of ideation and grand ideas, we pulled ourselves back to reality and came up with a viable product that we could plan and produce in only 4 weeks, this is the result.
Problem statement: Having a sick pet is a stressful situation, on top of our already busy lives, this additional stress can make it difficult to remember the specific details of your pet's illness and their needs.
Solution: This app aims to alleviate some of the stress that comes with having a sick pet by providing the user with an easy way to track symptoms and medications and facilitate better and more accurate in person communication when visiting the vets.
This repository holds the code to make our API, it runs on an Express Server, making queries to a POSTGRESQL Database. The credentials for the database will be stored in your environment variables.
The server handles requests to a database with 3 tables that allows for users to add and update pet details as well as adding symptoms and appointments.
The Care-Full website makes fetch requests to this server when running locally.
This README is for the Back-end of the Care-Full app. If you would like to explore the Front-end of the app please go to the Front-end repository
To run this project locally, you will need to add the following environment variables to your .env file
DATABASE_URL
Clone the project
git clone https://github.com/SchoolOfCode/final-project_back-end-team-con-cat-enate-room-7.git
Go to the project directory
cd final-project_back-end-team-con-cat-enate-room-7.git
Install dependencies
npm install
Start the server
npm run start
Copy your database (e.g. Heroku) URL into the .env file, following the format:
DATABASE_URL = <Database URL goes here>
Create all tables in your database by running the following scripts in the terminal:
npm run createSymptomsTable
npm run createRemindersTable
npm run createPetsTable
To populate the tables you can achieve this by interacting with the front end UI here https://care-full.netlify.app. If you would like to run the front end locally, please follow the instructions in the next section.
Frontend
The front end is deployed using netlify, however you will need to follow the steps below if you would like to run it locally.
- Git clone the frontend repository.
git clone https://github.com/SchoolOfCode/final-project_front-end-team-con-cat-enate-room-7
-
Remember to navigate to the correct folder: final-project_front-end-team-con-cat-enate-room-7
-
Install all necessary dependencies by running the following command in the terminal.
npm i
- Start the app.
npm run dev
To run tests, run the following command
npm run test
Client: Next.js, CSS, Chakra Component Library, Auth0
Server: Node, Express, PostreSQL, Nanoid
Client-side Testing: React Testing Library, Cypress
Server-side Testing: Supertest, Jest
GET /pets/${user_id}
Parameter | Type | Description |
---|---|---|
user_id |
string |
Required. User ID associated with account |
GET /pets/${user_id}?pet_id=${pet_id}
Parameter | Type | Description |
---|---|---|
user_id |
string |
Required. User ID associated with account |
pet_id |
string |
Required. Pet ID |
GET /pets?pet_id=${pet_id}
Parameter | Type | Description |
---|---|---|
pet_id |
string |
Required. Pet ID |
POST /pets
Parameter | Type | Description |
---|---|---|
body |
JSON |
Required. JSON object containing pet details |
user_id |
string |
Required. ID associated with user account (Front End obtains this from Auth0) |
pet_id |
string |
Required. ID associated with the pet (Front End generates this with nanoid) |
name |
string |
Required. Name of Pet |
species |
boolean |
Required. Species of pet true is Cat, false is Dog |
breed |
string |
Breed of Pet |
age |
Integer |
Age of Pet |
weight |
Float |
Weight of Pet |
PUT /pets/${pet_id}
Parameter | Type | Description |
---|---|---|
body |
JSON |
Required. JSON object containing pet details |
user_id |
string |
ID associated with user account (Front End obtains this from Auth0) |
pet_id |
string |
Required. ID associated with the pet (Front End generates this with nanoid) |
name |
string |
Name of Pet |
species |
boolean |
Species of pet true is Cat, false is Dog |
breed |
string |
Breed of Pet |
age |
Integer |
Age of Pet |
weight |
Float |
Weight of Pet |
GET /symptoms/${pet_id}
Parameter | Type | Description |
---|---|---|
pet_id |
string |
Required. ID associated with pet |
GET /symptoms/${pet_id}?symptoms_id=${symptoms_id}
Parameter | Type | Description |
---|---|---|
pet_id |
string |
Required. ID associated with pet |
symptoms_id |
string |
Required. ID associated with a symptom entry |
POST /symptoms
Parameter | Type | Description |
---|---|---|
body |
JSON |
Required. JSON object containing symptom details |
user_id |
string |
Required. ID associated with user account (Front End obtains this from Auth0) |
pet_id |
string |
Required. ID associated with the pet (Front End generates this with nanoid) |
symptoms_id |
string |
Required. ID associated with the symptom (Front End generates this with nanoid) |
incident_id |
string |
Required. ID associated with the incident (Front End generates this with nanoid) |
symptoms |
string |
Required. Title/Name of the symptom |
date |
string |
Required. Date that the incident occured |
time |
string |
Required. Time that the incident occured |
description |
string |
Required. More detailed explanation of the symptom |
Delete /symptoms/${symptoms_id}
Parameter | Type | Description |
---|---|---|
symptoms_id |
string |
Required. ID associated with a symptom entry |
GET /reminders/pet_id=${pet_id}
Parameter | Type | Description |
---|---|---|
pet_id |
string |
Required. ID associated with a pet |
POST /reminders
Parameter | Type | Description |
---|---|---|
body |
JSON |
Required. JSON object containing symptom details |
user_id |
string |
Required. ID associated with user account (Front End obtains this from Auth0) |
pet_id |
string |
Required. ID associated with the pet (Front End generates this with nanoid) |
reminder_id |
string |
Required. ID associated with the reminder (Front End generates this with nanoid) |
task |
string |
Required. Title/Name of the task |
date |
string |
Required. Date that the task needs to be completed by |
completed |
boolean |
Required. Whether the task has been completed (default value is false) |
repeated |
boolean |
Required. Whether the task is done needs to be done multiple times |
frequency |
string |
How often the task needs to be completed Suitable entries: (null, 1, 7, 30, 365) |
Patch /reminders/${reminder_id}
Parameter | Type | Description |
---|---|---|
reminder_id |
string |
Required. ID associated with a reminder entry |
body |
JSON |
Required. JSON object containing symptom details |
completed |
boolean |
Required. Whether the task has been completed |
Delete /reminders/${reminder_id}
Parameter | Type | Description |
---|---|---|
reminder_id |
string |
Required. ID associated with a reminder entry |
---
We are Con-Cat-enate!