Final group project for the Lighthouse Lab web dev bootcamp
Find a file
2022-07-01 17:43:46 -04:00
.github/workflows Remove lint action. Makes too much noise 2022-06-15 16:55:22 -04:00
app Merge branch 'main' into fix/remove-trips 2022-06-24 22:48:32 -04:00
docs Merge branch 'main' into fix/remove-trips 2022-06-24 22:48:32 -04:00
server Fix app crashing if no perimeters exist 2022-06-23 00:59:03 -04:00
.env.example env var required to enable db reset 2022-06-22 09:34:57 -04:00
.eslintignore Add eslint ignore 2022-06-12 16:13:02 -04:00
.eslintrc.json Configure eslint to work for jsx files 2022-06-14 18:35:30 -04:00
.gitignore Fix/continued port fixing (#79) 2022-06-22 07:33:55 -04:00
.prettierignore Add prettierignore 2022-06-12 16:14:29 -04:00
.prettierrc.json Doc: Format code using prettier 2022-06-12 16:12:23 -04:00
LICENSE Initial commit 2022-06-07 12:59:11 -04:00
package-lock.json Fix/continued port fixing (#79) 2022-06-22 07:33:55 -04:00
package.json Fix/continued port fixing (#79) 2022-06-22 07:33:55 -04:00
Procfile Fix/continued port fixing (#79) 2022-06-22 07:33:55 -04:00
README.md adding screenshots to readme again 2022-06-24 17:07:02 -06:00

Paws patrol

Paws Patrol is designed to protect your pets and you. Always know where your pets are without anyone else able to do the same.
Self-hosting allows you to choose your own middleware (ex. authelia, pomerium) for login while also providing security.
Open source software allows you to know your devices are only talking to each other.

Setup

cd server
npm run build && npm start
cd ../app
npm run dev

Dependencies

  • Node 16.x
  • Postgres 10.x
  • Express
  • Bootstrap 5

Api

Coordinates


/api/coordinate

post /:imei
	add coordinate for a device
	body = {lat, long, time}
	all required

get /:imei
	get most recent for a device

Devices


/api/device

get /
	list of all devices

post /:imei
	add device
	body = {name, microchip}
	all optional
get /:imei
	info about device with matching imei
patch /:imei
	update a device
	body = {name, microchip}
	all optional

Email


/api/email

post /
	send an email
	body = {to, subject, body}
	to is required
	subject and body are optional

Perimeters


/api/perimeter

get /
	get all perimeters in db

post /:imei
	add perimeter for a device
	body = {p1lat, p1long, p2lat, p2long}
	all required
get /:imei
	get perimeter for device with matching imei
patch /:imei
	update perimeter for a device
	body = {p1lat, p1long, p2lat, p2long}

Reset


/api/reset

get /
	reset db leaving it empty

get /seed
	reset db before seeding with dummy data
	1 device, user, coordinate, and perimeter

Trips


/api/trip

get /
	get all trips

post /:imei
	start a trip
	body = {name, start}
	name is optional
	start is required
get /:imei
	get all trips for a device with matching imei
patch /:imei
	end a trip
	body = {id, end}
	both required

get /:imei/:id
	get the coordinates for a trip

Users


/api/user

get /
	get user info
patch /
	change user info
	body = {name, phone, email, password}
	all required