Skip to content
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,92 @@ After sshing into the server, cd into either prod or test project. Then run resp
## Backend Documentation

[Swagger Link](https://petstore.swagger.io/?url=https%3A%2F%2Fraw.githubusercontent.com%2FRIT-Software-Engineering%2FRIT-SE-Senior-Project%2Frefs%2Fheads%2Fdev%2Fui%2Fpublic%2Fapi-docs%2Fserver_doc.yaml)


## Dependencies
### root
`ajv`: seems to be unused, may be a subdependency. Compiles JSON schemas to JavaScript code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since ajv is flagged as “seems to be unused”, it might be worth explicitly noting whether it appears in dependencies vs devDependencies in package.json

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from a recent commit now note which of the packages are used as devDependencies.


`html-to-text`: converts HTML into formatted text. Unclear if this needs to be in root.

### server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really helpful addition to the README – having dependency intent documented will make future upgrades and removals much safer.

`@google/generative-ai`: SDK that provides access to gemini, currently deprecated. Strongly consider switching to `@google/genai`.

`cookie-parser`: reads data stored in cookies.

`cors`: handles CORS protocol.

`dotenv`: imports environment files in `server/main.js`.

`express`: web application framework that is used for routing.

`express-fileupload`: Express middleware for uploading files.

`express-session`: Express middleware for session data.

`express-validator`: Express middleware for the validator package.

`filesize-parser`: parses the size of files.

`fs-extra`: contains additional file system methods not covered by the `fs` module and allows for `fs` methods to return promises.

`html-to-text`: converts HTML into formatted text.

`memorystore`: stores sessions without leaking memory, unlike the MemoryStore in `express-session`.

`moment`: should be replaced with dayjs.

`nanoid`: creates random project and submission ids.

`node-fetch`: adds window.fetch() to Node, currently unused.

`nodemon`: automatically restarts a Node application when a file is changed, this is automatically run with the server 'start' script.

`passport`: authentication middleware for Express applications.

`passport-saml`: SAML identity provider for Passport, allows for SSO log-in.

`pdfkit`: used to generate PDF documents.

`sqlite3`: creates bindings to SQLite3 for Node, used to interact with the database.

### ui
**CodeMirror** - A rich text interface for editing code while on a website.

`@uiw/react-codemirror`: allows CodeMirror to be added as a react component.

`@uiw/codemirror-theme-eclipse`: adds theming to CodeMirror.

`@codemirror/lang-html`: adds auto-closing tags to HTML editing in CodeMirror.

**SemanticUI** - UI framework used across the entire website.

`semantic-ui-react`: provides Semantic UI React components.

`semantic-ui-css`: provides Semantic UI CSS stylization.

`@semantic-ui-react/css-patch`: patches semicolon issue with semantic (should have been fixed in an update of semanticUI?).

`@testing-library/jest-dom`: currently unused.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For @testing-library/jest-dom and @testing-library/user-event, it might be helpful to say “kept for future test expansion” or “candidate for removal” so it’s clear whether they’re intentionally retained.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A notice to keep these dependencies for now, has since been included.


`@testing-library/react`: currently only used once in `ui/src/App.test.js`.

`@testing-library/user-event`: currently unused.

`ajv`: seems to be unused, may be a subdependency. Compiles JSON schemas to JavaScript code.

`caniuse-lite`: seems to be unused, may be a subdependency. Lighter version of caniuse-db. This is a tool for showing

`Moment.js` and `Day.js` are both used for handling dates and time. Using both Day.js and Moment.js is redundant as Day.js is a moment alternative.

`comma-separated-values`: used in the Admin User Editor to parse data from users uploaded as CSV data.

`dangerously-set-html-content`: is used to allow for modifiable web pages through the edited html.

`DOMpurify`: is currently only used in tooltips as a way of limiting the usable tags in the custom HTML. It is a tool to combat cross-site scripting (XSS) attacks by sanitizing strings with HTML.

`he`: is used for the decode function in order to clean up incoming strings and replace any HTML character entity references with the correct characters (for example: &trade would be replaced with ™).

`html-entities`: is used for the same thing as `he`.

`prop-types`: a tool used for validating the data types of properties.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention whether the project is using PropTypes consistently in new components, or if this is mainly for legacy components.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now added more information about the components in which prop-types is used.