diff options
| author | Kamen Mladenov <kamen.d.mladenov@protonmail.com> | 2021-04-09 19:55:59 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-09 19:55:59 +0300 |
| commit | f849e37ccdd6fd48f83119a3b3b65cdd8b765dc3 (patch) | |
| tree | 83b88a773bb7dc053bb3aced35bce302264ec925 /docs | |
| parent | bcd88af53b1a920d728ec98b45daa9ac2e2c0917 (diff) | |
| parent | c13889759d70687de6833c505221c203f65fedb8 (diff) | |
| download | DevHive-Angular-main.tar DevHive-Angular-main.tar.gz DevHive-Angular-main.zip | |
Second Stage: Complete
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/Components.md | 178 | ||||
| -rw-r--r-- | docs/File-Structure.md | 60 | ||||
| -rw-r--r-- | docs/Privacy-Policy.md | 23 |
3 files changed, 261 insertions, 0 deletions
diff --git a/docs/Components.md b/docs/Components.md new file mode 100644 index 0000000..84557ef --- /dev/null +++ b/docs/Components.md @@ -0,0 +1,178 @@ +The Angular DevHive front-end contains a lot of components. We can separate them in two groups: + +[Pages](#pages) - components that make up a whole page +- [`post-page`](#post-page) +- [`comment-page`](#comment-page) +- [`feed`](#feed) +- [`login`](#login) +- [`register`](#register) +- [`not-found`](#not-found) +- [`profile`](#profile) +- [`profile-settings`](#profile-settings) +- [`admin-panel-page`](#admin-panel-page) + +Elements - components, that are added inside an existing page +- `post` +- `post-attachment` +- `comment` +- `error-bar` +- `success-bar` +- `loading` + +Refer to the API and [API Endpoints](https://github.com/Team-Kaleidoscope/DevHive/wiki/API-Endpoints#getposts) wiki page for more info on how many of the components function. + +# Pages + +## post-page + +The post-page is used to contain a whole post, it's comments and post editing buttons. + +It's routed to `post/:id`, meaning links look like: `http://localhost:4200/post/850d0655-72cb-4477-b69b-35e8645db266`. +- You can access it, even if you aren't logged in +- If a given post doesn't exist (the id in the link is invalid), the user gets redirected to the `not-found` page + +The component fetches the post with the id in the link, then fetches all comments, and finally, if the user is logged in and is the creator of the post, it shows the edit and delete buttons. +- With the edit button you can change the post's attachments and message. Submitting an edit is done by pressing the `Edit Post` button again or pressing enter in the `New Message` field. +- The delete button doesn't have a warning message, **so be careful when deleting a post!** + +<details> +<summary><i>Screenshots</i></summary> + + + + +</details> + +## comment-page + +The comment-page is used for containing a comment and it's editing buttons. This is the only place where you can edit a comment (if it's made by you). + +It's routing is configured to `comment/:id`, meaning you go to it via links like: `http://localhost:4200/comment/1cc9773f-8d9a-4bfd-83ca-2099dc787a39`. +- Users can access it, even if not logged in +- On invalid id, the user gets redirected to `not-found` + +The component fetches the comment with the id from the link and if the user is logged in and is it's creator, shows the edit and delete buttons. +- You can edit a comments message and submitting the change is done by either pressing `Edit Comment` again or pressing enter in the `New Message` field. +- Deletion doesn't have a warning message, **so be careful when deciding to delete a comment!** + +<details> +<summary><i>Screenshots</i></summary> + + + +</details> + +## feed + +The feed is the main page of the application. It contains the feed posts: the latest posts of your friends. Here you also make your posts and can view and logout from your profile. + +It's routed to the website root ` `, meaning it's located at `http://localhost:4200` (you can also have a last forward-slash: `http://localhost:4200/`). +- If you aren't logged in, you're gonna get redirected to the login page + +The feed fetches the user info, showing it on the left side bar, or showing just the profile icon next to the create post field, and fetches his feed. +- Creating a post is done by typing in your message and (optionally) adding attachments to it via the paperclip (button). To submit your new post, you need to press enter in the `What's on your mind?` input field. + +<details> +<summary><i>Screenshots</i></summary> + + + + +</details> + +## login + +This page is used for logging into your account. It also has a button redirect to the register page and has an error bar that shows up when you've entered bad credentials. + +It's routed to `login`, meaning you access it from `http://localhost:4200/login` +- It can be accessed by anyone and everyone + +The login page [sends a request](https://github.com/Team-Kaleidoscope/DevHive/wiki/API-Endpoints#login) to the API, and if it returns a successful result, the result [token](https://github.com/Team-Kaleidoscope/DevHive/wiki/Authentication) is stored in session storage and you get redirected to the feed. +- You can log in another account, while already logged in. The session storage token just gets overwritten. +- On unsuccessful login, you get shown an error bar and don't get redirected + +<details> +<summary><i>Screenshots</i></summary> + + + +</details> + +## register + +This page is used for registering a new account. It also has a button to redirect to the login page and has an error bar that shows up when you've entered bad values. + +It's routed to `register`, meaning you access it from `http://localhost:4200/register` +- It can be accessed by anyone and everyone + +The register page [sends a request](https://github.com/Team-Kaleidoscope/DevHive/wiki/API-Endpoints#register) to the API, and if it returns a successful result, the result [token](https://github.com/Team-Kaleidoscope/DevHive/wiki/Authentication) is stored in session storage and you get redirected to the feed. +- You can register another account, while already logged in. The session storage token just gets overwritten. +- On unsuccessful register, you get shown an error bar and don't get redirected + +<details> +<summary><i>Screenshots</i></summary> + + + +</details> + +## not-found + +The "not-found" page is a static page that is shown when trying to access a nonexistent link, or by being redirect to it's page. + +This component has two routings: `not-found` and `**`, meaning you access it from `http://localhost:4200/not-found` or from any invalid link +- Some page components redirect you to this page, if they couldn't load something from API + +## profile + +This page is used for showing a profile's info and/or action buttons. + +It's routed to `profile/:username`, meaning you access it from `http://localhost:4200/profile/test` +- It can be access by anyone and everyone +- If a given profile doesn't exist (the username in the link is invalid), the user gets redirected to the `not-found` page + +The profile page [sends a request](https://github.com/Team-Kaleidoscope/DevHive/wiki/API-Endpoints#getuser) to the API, and if it returns a successful result, the result user is shown. +- You can log in another account, while already logged in. The session storage token just gets overwritten. +- On unsuccessful login, you get shown an error bar and don't get redirected +- If you are on the profile page of the logged in user, you're gonna get access to + +<details> +<summary><i>Screenshots</i></summary> + + + + +</details> + +## profile-settings + +This page is used for showing a profile's settings and for doing changes to the profile. + +It's routed to `profile/:username/settings`, meaning you access it from `http://localhost:4200/profile/test/settings` +- It can only be accessed if the logged-in user and the username in the link match + +When you've made your profile modifications, it [sends a request](https://github.com/Team-Kaleidoscope/DevHive/wiki/API-Endpoints#update-user-by-id) to the API. If it returns a successful result, in some cases the page reloads (to show you the new values for your profile), but usually it just shows you the success bar. + +<details> +<summary><i>Screenshots</i></summary> + + + + +</details> + +## profile-settings + +This page is used for showing the admin DevHive settings and for doing changes to the whole database. + +It's routed to `admin-panel`, meaning you access it from `http://localhost:4200/admin-panel` +- It can only be accessed if the logged-in user is an admin + +Here you can mainly edit technologies and languages: you can add, update and delete them. You can also delete posts, users and comments. + +<details> +<summary><i>Screenshots</i></summary> + + + +</details>
\ No newline at end of file diff --git a/docs/File-Structure.md b/docs/File-Structure.md new file mode 100644 index 0000000..7f46c53 --- /dev/null +++ b/docs/File-Structure.md @@ -0,0 +1,60 @@ +DevHive has a lot of files and it can be hard to really see the whole structure of everything from a first glance. In this document, all of the important/notable files and folders are represented in a tree structure. + +``` +└── DevHive.Angular + ├── angular.json + ├── karma.conf.js + ├── package.json + ├── package-lock.json + └── src + ├── app + │ ├── app.component.html + │ ├── app-constants.module.ts + │ ├── app.module.ts + │ ├── app-routing.module.ts + │ ├── components + │ │ ├── admin-panel-page + │ │ ├── comment + │ │ ├── comment-page + │ │ ├── error-bar + │ │ ├── feed + │ │ ├── loading + │ │ ├── login + │ │ ├── not-found + │ │ ├── post + │ │ ├── post-attachment + │ │ ├── post-page + │ │ ├── profile + │ │ ├── profile-settings + │ │ ├── register + │ │ └── success-bar + │ └── services + │ ├── cloudinary.service.ts + │ ├── comment.service.ts + │ ├── feed.service.ts + │ ├── language.service.ts + │ ├── post.service.ts + │ ├── technology.service.ts + │ ├── token.service.ts + │ └── user.service.ts + ├── assets + │ └── images + ├── favicon.ico + ├── index.html + ├── interfaces + │ ├── api-error.ts + │ ├── jwt-payload.ts + │ └── user-credentials.ts + ├── main.ts + ├── models + │ ├── comment.ts + │ ├── identity + │ │ ├── friend.ts + │ │ ├── role.ts + │ │ └── user.ts + │ ├── language.ts + │ ├── post-comment.ts + │ ├── post.ts + │ └── technology.ts + └── styles.css +``` diff --git a/docs/Privacy-Policy.md b/docs/Privacy-Policy.md new file mode 100644 index 0000000..c338763 --- /dev/null +++ b/docs/Privacy-Policy.md @@ -0,0 +1,23 @@ +DevHive **doesn't collect any user data, that you haven't personally submitted** (there is no telemetry), and that won't ever change! + +The only potentially sensitive that that could be stored is your profile (first and last name, email, ..) and your posts (if you've shared anything sensitive), but in both cases you've personally given this information. + +## Data on the server + +All data is stored in the database and isn't shared with anyone. The entity that is hosting an instance of the application could expose data to unknown third parties, but DevHive doesn't do anything of the sorts by itself! + +## Data on your machine + +On your computer, the only thing that is saved is your [authentication token](https://github.com/Team-Kaleidoscope/DevHive/wiki/Authentication) in session storage. This is done so you could stay logged in the website in the current tab, and after closing it, the data gets deleted. + +In the future we could add a cookie to your computer storage, but that will still only hold the token for authentication purposes, so you can reopen your browser and still be logged in. **Tracking and third-party cookies are *never* going to be implemented!** + +## Telemetry by tools + +DevHive itself doesn't collect any type of telemetry, but that isn't the same for the tools it uses. + +The `dotnet` CLI tool is used to run the API, and `dotnet` does [`collect telemetry`](https://docs.microsoft.com/en-us/dotnet/core/tools/telemetry). [The same](https://angular.io/cli/usage-analytics-gathering) can be said for the Angular CLI (`ng`). + +Thankfully in both cases, you can opt out. Ask the administrator(s) of the instance you're using whether they have disabled telemetry. + +**Although**, it's important to mention that **this telemetry might not be collecting your data**, but the data of the server that uses it. Do your own research!
\ No newline at end of file |
