Backend Specs - KazztheCajun/petfoodweb GitHub Wiki
Server design
REST API Draft:
Endpoints:
- /api/:ID -- Loads the home data associated with the given ID.
- /api/new?home=”Name of Home” -- Creates a new Home with an empty pet list and log
- /api/list/homes -- Retrieves a list of the names of all created homes
- /api/update/:ID -- Updates the home data saved in the database respective to the given ID
- / -- The index page of the Pet Food Tracker. Redirects to /login for unauthenticated users or /main/:user for authenticated users.
- /signup -- Sends the signup page for new users to create an account.
- /login -- The main entrance to the app, allows unauthenticated users to authenticate and access the app or for currently authenticated users to redirect to the main app page. Also provides access to the signup flow.
- /main/:user -- Sends the main app page, which then loads the information for the given username in the URL.
Tools & Libraries:
Server Logic:
The server will mostly serve as a go-between for the frontend and the database. The main responsibilities will be handling user creation and login requests, and directing frontend GET, PUT, and POST requests to the appropriate database locations.