This is a Web Application that is created for Nocturnal Cookies as a tool to facilitate the buying and selling of cookies on a college campus. Features include:
- Admin Console for employees of Nocturnal Cookies to be able to manage and complete orders
- Owner console that will allow the Owner of the site to create and delete users
- Form for users to enter values and order cookies
This project was created using node/npm. I used [email protected] and [email protected]. You can download node at the node website or from your OS package manager (if you have one installed).
Windows (Chocolatey):
choco install node
Mac (Homebrew):
brew install node
-
Run the following command to clone the application to your machine
git clone https://github.com/ominiet/nocturnalcookies.git
-
cd nocturnal cookies
-
Use
npm install
to download all the dependencies (do this the first time you run the app) -
Use
npm start
to run the application (do this every time you run the app)
- Authorization - We have implemented 2 types of users in our project:
- Admin - Has access to admin panel and ability to view, modify, and delete orders
- Owner: Has access to all admin routes and routes to view and manage all other users
- Database - We have connected to an mLab instance for production and a separate instance for testing
- Authentication - You may use the login button in the footer to access the admin login page
- Deployed - The link to our deployed app is (https://nocturnal-cookies.herokuapp.com)
- Credentials for the owner are:
- Username: owner
- Password: pass
- Credentials for the owner are:
- Code Review - Testing was performed (Go to testing section of README to see more) and we have separated all code files in to logical locations
- General - Plan changes are in the plan section below
- User Stories - User stories are in the user stories section below
We used mocha as our testing framework and chai as our assertion library to test our backend API. Given time constraints, we were not able to test every potential scenario, but our tests do verify that our API does work.
-
You will likely have to run:
npm install --dev
-
Once the dependencies have downloaded, you may run from the base directory:
npm test
This will connect you to a test database and perform some unit tests on the API
- We have updated some of our user stories compared to the original document These changes will be documented in the User Stories section
- Our Tech stack has been updated based on team preference and familiarity and has changed to:
Tables | Old | New |
---|---|---|
Frontend | React | Angular |
Backend | Node | Node |
Routing | Express | Express |
Database | MongoDB | MongoDB |
DB Hosting | mLab | mLab |
Server Hosting | Heroku | Heroku |
- We had also decided to move away from including the Announcements module
from our final deliverable since we felt it was too similar to the order
management in terms of CRUD and user stories.
- Instead, We opted to create the owner classification that had additional privileges compared to a regular admin user
Order
- Create
- As a user, I want to be able to submit cookie orders through a form
- User visits site (No logon required)
- User goes to order tab or clicks on order button
- User fills out order info and submits
- User gets a confirmation with their order details
- As a user, I want to be able to submit cookie orders through a form
- Read
- As an admin I want to be able to see a list of all orders in an organized way
- Admin logs into a special account
- Admin goes to a dashboard-type page
- Admin can view and filter orders to prepare them for delivery
- As an admin I want to be able to see the details of a specific order
- Admin logs in
- Admin goes to dashboard
- Admin clicks on one of the orders in the list
- Admin sees a popup of all the order details
- As an admin I want to be able to see a list of all orders in an organized way
- Update
- As an admin, I want to be able to correct orders that may have errors in them
- Admin goes to dashboard
- Admin can view the details of any order
- Admin can click a button to change the status of the order to delivered
- As an admin, I want to be able to correct orders that may have errors in them
- Delete
- As an admin, I want to be able to delete wrong/faulty orders or posts
- Admin goes to dashboard
- Admin can delete specific orders
- As an admin, I want to be able to delete wrong/faulty orders or posts
Users
- Create
- As the Owner, I want to be able to create new users when I hire employees
- Owner logs in
- Owner uses navbar to go to Create User Page
- Owner creates new user account
- Owner shares account information with new employee
- As the Owner, I want to be able to create new users when I hire employees
- Read
- As the Owner, I want to see a list of all users on the website
- Owner uses login button like an admin
- Owner clicks nav button only visible to them that redirects them
- Owner can now see a list of all users
- As the Owner, I want to see a list of all users on the website
- Delete
- As the Owner, I want to be able to delete user accounts that are no
longer in use
- Owner goes to owner dashboard
- Owner clicks button to delete specific user
- As the Owner, I want to be able to delete user accounts that are no
longer in use
We are going to use the method we learned in Software Engineering to maintain the repository. This will entail keeping a "master" branch which will contain the most recent working version of our web app, a "development" (branched from "main") which will contain our in-progress next version of the web app, and multiple "feature" branches (branched from "development").
This will ensure that there will always be a workable version of the web app to fall back on and revert to if necessary, and will only allow usable changes to make it to the master branch. Having separate feature branches will also help prevent merge conflicts when combining all of the code into the development branch.
- From the nocturnalcookies repo on GitHub, select the
Branch: master
button and select development - Click the same button and type in the name of the feature branch you wish to create <branchName>
- In your Command Line, navigate to your project folder and type
git pull
git checkout <branchName>
- You are now on your created branch that was created from development
- When you are at a good stopping point and want to send code to your feature
branch, type in your terminal
git status
- Use
git add <filename>
to add files you wish to commit.
Do Not usegit add .
- When you have added all of the files you want, use
git commit -m "<commit message>"
- Use
git push
to send the code to GitHub.
- Go to the branch on the repo on GitHub
- Select development on the "base" drop-down and your branch on the "compare" drop-down.
- Follow the on screen instructions to create the pull request