A web app to manage Freddy's candy orders.
This is the file structure for the [Freddy's Artisanal Halloween Candy Shop
] project.
.
├── README.md
├── public/
├── images/
├── scripts/
├── styles/
├── index.html
├── login.html
└── orders.html
Upon signing-in with { username: 'freddy', password: 'ElmStreet2019' }
, a JWT
is returned [validating the user login
], and the user [Freddy
] would be directed to the dashboard.
- The login form requires a valid
username
-password
pair. - Upon successful login, a
JWT
is return to the client [browser] - The
JWT
is stored in the browser'sSession Storage
and used for subsequentAPI calls
. - The following endpoint is used
POST https://freddy.codesubmit.io/login
- Hitting the above endpoint returns a JWT
access_token
and arefresh_token
. - The
access_token
is valid for 15 minutes after which it expires. - The
refresh_token
is valid for 30 days and is used to obtain a newaccess_token
upon expiry. - To get a new
access_token
, upon expiraion, the following endpoint is usedPOST https://freddy.codesubmit.io/refresh
- Overview of revenue generated by the shop
today
,last week
andlast month
. - Charts showcasing the revenue generated over the
last 7 days
and thelast 12 months
. - Best-selling candies and the revenues they have generated for
Freddy's Shop
- All the above information is accessed by hitting the following API endpoint
GET https://freddy.codesubmit.io/dashboard
- List of all
orders
indicating theProduct Name
,Date
,Price
andStatus
. - Search feature allows the user to search for orders by the
Product Name
- Pagination feature enables the user to view different pages of orders and move from one page to the other.
- The orders page gets its data from the following endpoint
GET https://freddy.codesubmit.io/orders?page=1&q=search_term