Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a3-kitzeller-karitta-zellerbach #94

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 54 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
Assignment 3 - Persistence: Two-tier Web Application with Flat File Database, Express server, and CSS template
===
## Wavelength

Due: September 16th, by 11:59 AM.
https://a3-kitzeller.glitch.me

This assignnment continues where we left off, extending it to use the most popular Node.js server framework (express), a flat file database suitable for small applications (lowdb), and a CSS application framework / template of your choice (Boostrap, Material Design, Semantic UI, Pure etc.)
Wavelength is a web application that facilitates real-time audio-visual collaboration. It makes use of [Hydra](https://github.com/ojack/hydra), [Tone.js](https://tonejs.github.io/), [Magenta.js](https://magenta.tensorflow.org/), and [Gibber](https://github.com/charlieroberts/gibber.audio.lib).
The goal of the app is to allow users to work on live-coding projects together in real-time, without having to be physically
present. The app allows interaction with pre-existing music/visual libraries, as well as tools and interfaces I created.
Most of the challenges faced were related to websockets, audio timing, and figuring out when states should be saved, given that multiple
users are editing the same content. I used PassportLocal and MongoDB cloud storage. PassportLocal was used so that I would have full control
over user accounts, while MongoDB was used as it provided cloud storage options and model-based implementation strategies.
I also used Bootstrap for the CSS, which was heavily modified and augmented with custom CSS.
I chose bootstrap for its responsive design nature.

To test, you can create an account, or use:

Baseline Requirements
---
username: kit

Your application is required to implement the following functionalities:
password: secret

- a `Server`, created using Express (no alternatives will be accepted for this assignment)
- a `Results` functionality which shows the entire dataset residing in the server's memory
- a `Form/Entry` functionality which allows users to add, modify, and delete data items (must be all three!) associated with their user name / account.
- Use of at least five [Express middleware packages](https://expressjs.com/en/resources/middleware.html). Explore!
- Basic authentication using the [Passport middleware](http://www.passportjs.org) for Express (this counts as one of your five middleware packages). We encourage using the Local strategy, but OAuth (Open Authentication) can also be used for additional technical achievement. The course staff cannot help you with the various flavors of OAuth strategies. YOU MUST PROVIDE US WITH ACCOUNT CREDENTIALS TO LOGIN TO YOUR APPLICATION IF YOU USE OAUTH. The course staff cannot be expected to have credentials for any particular OAuth service.
- Persistent data storage in between server sessions. [lowdb](https://github.com/typicode/lowdb) is a suitable database package for this assignment and will be discussed in class.
- Use of a [CSS framework or template](https://github.com/troxler/awesome-css-frameworks). This should do the bulk of your styling/CSS for you and be appropriate to your application. For example, don't use [NES.css](https://nostalgic-css.github.io/NES.css/) (which is awesome!) unless you're creating a game or some type of retro 80s site.
Middleware Used:

Your application is required to demonstrate the use of the following concepts:
- express-static: serve static files
- serve-favicon: serve a favicon
- passport: basic authentication
- body-parser: parse HTTP request body
- express-session: establish server-based sessions
- helmet: helps secure the app by setting various HTTP headers
- response-time: record HTTP response time as a response header

HTML:
- HTML input tags and form fields of various flavors (`<textarea>`, `<input>`, checkboxes, radio buttons etc.)
- HTML that can display all data *for a particular authenticated user*. Note that this is different from the last assignnment, which required the display of all data in memory on the server.
Future additions would be viewing/editing sessions using keys, babylon.js/three.js integration, better audio
visualization. I plan to continue this project for A4.

Note that it might make sense to have two simple pages for this assignment, one that handles login / authentication, and one that contains the rest of your application. For this assignment, it is acceptable to simply create new user accounts upon login if none exist, however, you must alert your users to this fact. If you're not using OAuth
The initial login/register page:

CSS:
- CSS styling should primarily be provided by your chosen template/framework. Oftentimes a great deal of care has been put into designing CSS templates; don't override their stylesheets unless you are extremely confident in your graphic design capabilities. The idea is to use CSS templates that give you a professional looking design aesthetic without requiring you to be a graphic designer yourself.
![login](img/login.png)

JavaScript:
- At minimum, a small amount of front-end JavaScript to get / fetch data from the server. See the [previous assignment](https://github.com/cs4241-19a/a2-shortstack) for reference.
The main tone editor:

Node.js:
- A server using Express, at least five pieces of Express middleware, and a persistent database (a flat file using lowdb is great).
![tone](img/tone.png)

Deliverables
---
The hydra editor:

Do the following to complete this assignment:
![hydra](img/hydra.png)

1. Implement your project with the above requirements. A good potential starting point is to use the "hello-express" project template inside of Glitch; this appears as an option when you hit the "New Project" button. Use the work you did in the last assignment as a reference to implement functionality, as well as the notes from class on 9/9 and 9/12.
2. If you developed your project locally, deploy your project to Glitch, and fill in the appropriate fields in your package.json file.
3. Test your project to make sure that when someone goes to your main page on Glitch, it displays correctly.
4. Ensure that your project has the proper naming scheme `a3-yourname` so we can find it.
5. Fork this repository and modify the README to the specifications below. You do not need to include any of your project files in this repo (we will see those on Glitch), you only need to update and commit thhe README file.
6. Create and submit a Pull Request to the original repo. Name the pull request using the following template: `a2-gitname-firstname-lastname`.
The piano:

Sample Readme (delete the above when you're ready to submit, and modify the below so with your links and descriptions)
---
![piano](img/piano.png)

## Your Web Application Title

your glitch link e.g. http://a3-charlieroberts.glitch.me

Include a very brief summary of your project here. Images are encouraged, along with concise, high-level text. Be sure to include:

- the goal of the application
- challenges you faced in realizing the application
- what authentication strategy / database you chose to use and why (choosing one because it seemed the easiest to implement is perfectly acceptable)
- what CSS framework you used and why.
- include any modifications to the CSS framework you made via custom CSS you authored.
- the five Express middleware packages you used and a short (one sentence) summary of what each one does.

## Technical Achievements
- **Tech Achievement 1**: I used OAuth authentication via the GitHub strategy
- **Tech Achievement 2**: I used over ten Express middleware packages, enabling me to create a server that...
- **Tech Achievement 1**: I used socket.io for realtime collaboration. This includes separate "rooms" that allow users to collaborate with
only the people who have joined that room. I send over sound data, tempo changes, visual changes, sequencer start/stop actions.
I also used socket.io for a small chat feature on the "profile" section of the website, which is accessed by clicking your username on the bottom right corner.
- **Tech Achievement 2**: I created a collaborative audio-visual editor using Tone.js, Magenta.js, Hydra, Gibber and CodeMirror.
I created a step sequencer, DrumPad, and Piano using Tone.js for sound generation.
- **Tech Achievement 3**: I used Magenta.js to implement Machine Learning models that would improvise new sounds based on sequences provided
by the user. This can testing using the "record" and "improvise" buttons while in piano mode.
- **Tech Achievement 4**: I used MongoDB (Mongoose.js) for cloud storage of session and user information, which allows users to delete and update their sessions.
It also allows users to save and load sessions from the "wave-pad", by clicking the "load" and "save" buttons. They can only load their own sessions (based on who is authenticated).
- **Tech Achievement 5**: I implemented MIDI functionality with the piano, converting midi note frequencies to piano keys, using this conversion [table](https://www.inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies).
Currently the piano only works with MIDI input.
- **Tech Achievement 6**: I used CodeMirror to allow users to write and evaluate Hydra and Gibber (javascript) code to modify the audio and visuals on screen.


### Design/Evaluation Achievements
- **Design Achievement 1**: I tested my application using screen reading software, and found that...
- **Design Achievement 2**: I followed best practices for accessibility, including providing alt attributes for images and using semantic HTML. There are no `<div>` or `<span>` elements in my document.
- **Design Achievement 3**: We tested the application with n=X users, finding that...
- **Design Achievement 1**: I designed the entire 'wave-pad' application from scratch. Including the GUI layout, the DrumPad (and sequencer animations), Piano, and all the user interaction with the elements.
I decided to have "mode" based interactions, where the user can click on the mode button on the right GUI pane to toggle between DrumPad, Hydra, Piano, and Gibber "modes", allowing them
to edit persistent audio and visual states at the same time.
- **Design Achievement 2**: I used a pre-existing bootstrap theme for the small login box on the login page. However, I heavily modified it to make it more minimal, and then added the
changing backgrounds and 'WAVELENGTH' text.
- **Design Achievement 3**: I used Dat.GUI and jQuery.UI for cool interfaces and to allow the user to move UI boxes around after clicking on the "edit" button.
- **Design Achievement 4**: I created several of the default hydra backgrounds shown on the screen.
- **Design Achievement 5**: I paid ridiculously high attention to detail, from error checking on prompts, to css for button toggling.
- **Design Achievement 6**: I modified the simple-sidebar bootstrap theme for the profile section of website. I decided to keep it minimal as a place
for users to look at documentation and learn more about the app.
Binary file added img/hydra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/piano.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/tone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.