This repo contains the frontend and backend for my Z-Prefix CRUD application.
- A docker postgres image
- A postgres instance
- username: postgres
- password: docker
- port: 5432:5432
To start the postgres instance, run
$ docker run --name some-pg-docker-name -e POSTGRES_PASSWORD=docker -d -p 5432:5432 postgres
-
A database named
inventoryin the postgres container- To add this database:
$ docker exec -it postgres-instance-container-id bash# psql -U postgres# CREATE DATABASE inventory;
- To add this database:
-
A
.envfile in theserverfolder with the following contents:PG_HOST = localhost PG_USER = postgres PG_PASSWORD = docker PG_DATABASE = inventory PG_PORT = 5432
git clone https://github.com/gigann/CRUD-Application-Project.git- download and extract the zip.
Navigate to the server directory and run $ npm install to install dependencies. Next, run $ npm run dev. This will rollback, migrate, and seed the database, and start the server. However, if only starting the server is desired, run $ npm start instead. The server will be live on http://localhost:1337/.
Navigate to the client directory and run $ npm install to install dependencies. Next, run $ npm run dev or $ npm start. The client will be live on http://localhost:2077/.
This full-stack application allows inventory managers to create accounts, and, once logged in, to create, update, and delete items in their personal inventories. The application also allows inventory managers and visitors to view the inventory of all items.
- On the home page, click the
Create Accountbutton. This will redirect you to the registration page. You cannot create an account if you are already logged in. If necessary, log out by clicking theLogoutbutton. - On the registration page, enter your
First Name,Last Name,UsernameandPassword. - Click the
Create Accountbutton. You will be notified if your account was successfully registered. User accounts must have unique usernames. - After creating your account, you will be automatically logged in and redirected to your personal inventory page.
- On the home page, Click the
Loginbutton. - On the login page, enter your
UsernameandPassword. - Click the
login button. - If successfully authenticated, you will be automatically redirected to your personal inventory page.
- On the home page, click the
View Personal Inventorybutton. This will redirect you to your personal inventory page.- On the personal inventory page, click an item to view its details.
- Click the
Go Backbutton to return to viewing personal items.
- On the personal inventory page, click the
Enable Edit Modbutton. - Under the Add a New Item section, enter the
Item Name,Description, andQuantity. - Click the
Add Itembutton to add the item to the database.
- On the personal inventory page, click the
Enable Edit Modbutton. - Under the Edit or Delete Existing Items section, modify the
Item Name,Description, andQuantityfields of a particular item. - To save your changes, click the
Edit Itembutton in the same row.
- On the personal inventory page, click the
Enable Edit Modbutton. - Under the Edit or Delete Existing Items section, click the
Delete Itembutton.
- On the home page, click the
View All Inventoriesbutton. This will redirect you to the global inventory page. - On the global inventory page, click an item to view its details.
- Click the
Go Backbutton to return to viewing all items.
- On the home page, click the
View All Inventoriesbutton. This will redirect you to the global inventory page. - On the global inventory page, click an item to view its details. This will redirect you to the item details page.
- On the item details page, click the
Go Backbutton to return to the global inventory page.
| User ID | Username | Password |
|---|---|---|
| 1 | smbro |
MAR10 |
| 2 | mc_master |
25565 |
| 3 | vampire_killer |
Wallachia1476! |
- Passwords are salted and hashed.
- User IDs are temporarily stored as cookies.