This typescript project acts as a demo of the usage of Typescript to create data objects and store them in a front-end "serverless" database with browser local storage. The database is aimed at hypothetical farmers who may want to keep track of their different species of Pigs, with there being four example species included. Each pig can have different characteristics, and corresponding values to these traits, so each entry is stored as a unique object. The program makes use of JSON parsing to stringify and decode objects to and from local storage. The TypeScript must be compiled using tsc
and is run through an HTML interface for the database, but has been pre-compiled to JavaScript.
-
Database Sorting: The database automatically sorts the Pigs by their species and color, so users don't need to worry about organizing.
-
Class Interface: The project uses a Class interface to allow users to manage and keep track of several similar pigs without mixing them up.
-
JSON Parsing: Objects are parsed out of local storage on every refresh, and added into storage on every update to the database, allowing users to quickly leave and enter the program without losing any stored data.
-
AJAX Form: Allows users to dynamically adjust their form for different corresponding pig species without having to update the rest of the web page.
Follow these steps to set up and run the Local Storage Database:
-
Clone the repository to your local machine:
git clone
Feel free to reach out if you have any questions, suggestions, or feedback:
- Email: [email protected]
- LinkedIn: @Daksh Patel