Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
31f91d7
add requests form
Apr 2, 2022
80dac5e
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 2, 2022
bc13879
Improve new request form
filipsl Apr 2, 2022
06a2224
Merge remote-tracking branch 'origin/main'
filipsl Apr 2, 2022
3c72447
Add footer
pszemkor Apr 2, 2022
7ff08cb
proxy
Apr 2, 2022
d498fdc
Merge remote-tracking branch 'origin/main'
Apr 2, 2022
85a3fa7
Fix footer
pszemkor Apr 2, 2022
a14a5ed
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 2, 2022
21f838c
Add logo
pszemkor Apr 2, 2022
0a1dc0d
authenticate frontend against backend
arkadiuss Apr 2, 2022
0c795af
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 2, 2022
2ecc7e9
add gitlab ci
arkadiuss Apr 2, 2022
5af498f
login to corrent docker registry
arkadiuss Apr 2, 2022
163a577
change docker limits
arkadiuss Apr 2, 2022
d098ef0
final version of dockerfile
arkadiuss Apr 2, 2022
89d062f
Set global font
pszemkor Apr 2, 2022
a1e7407
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 2, 2022
8c841f4
Set global font
pszemkor Apr 2, 2022
55b77ea
Add missing asset
pszemkor Apr 2, 2022
a371516
Add global background
pszemkor Apr 2, 2022
96371c7
adding request probably works
Apr 2, 2022
b2549b7
Merge remote-tracking branch 'origin/main'
Apr 2, 2022
a8499b1
Add card css
pszemkor Apr 2, 2022
27df649
nginx fix root location
arkadiuss Apr 2, 2022
7ffc291
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 2, 2022
da14625
go back after saving request
Apr 2, 2022
106e63d
Merge remote-tracking branch 'origin/main'
Apr 2, 2022
b53e3ea
fix nginx
arkadiuss Apr 2, 2022
87d8cb7
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 2, 2022
8b2417f
icon and title
Apr 2, 2022
d8e2452
fix dockerfile copy
arkadiuss Apr 2, 2022
b496b13
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 2, 2022
bd72597
change config nginx
arkadiuss Apr 2, 2022
982807b
change config nginx
arkadiuss Apr 2, 2022
84ec553
nginx add missing slash
arkadiuss Apr 2, 2022
4258e62
Implement meeting details
filipsl Apr 3, 2022
37871e1
Merge branch 'main' into main-view-details
filipsl Apr 3, 2022
7f08462
add user id
Apr 3, 2022
a34502b
Add request details
filipsl Apr 3, 2022
6859df5
Merge remote-tracking branch 'origin/main'
filipsl Apr 3, 2022
6895abb
fix style 21
Apr 3, 2022
93096e8
Fix meeting details
filipsl Apr 3, 2022
05902ee
Merge remote-tracking branch 'origin/main'
filipsl Apr 3, 2022
32f1026
Add conditional formatting
pszemkor Apr 3, 2022
5d8c63e
Send email to backend
pszemkor Apr 3, 2022
c0b060f
fix style 26
Apr 3, 2022
8635f7b
add logic behind mettings on frontend
arkadiuss Apr 3, 2022
7faf4ab
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 3, 2022
11da55b
matched and notmatched
Apr 3, 2022
44da6f4
Improve styles :)
pszemkor Apr 3, 2022
708cafd
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 3, 2022
ffc2dc1
use backend requests logic
arkadiuss Apr 3, 2022
c2b10c4
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 3, 2022
4e63c3a
Add button and slider component for finishing meetings and ratings
filipsl Apr 3, 2022
1f01943
Update main view
pszemkor Apr 3, 2022
bda4b1e
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 3, 2022
873bbaa
timeout in snackbar
Apr 3, 2022
bacdfe2
Improve main
pszemkor Apr 3, 2022
9a12d14
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 3, 2022
f80b6a2
Add category key
pszemkor Apr 3, 2022
3568f12
Test service for slider
filipsl Apr 3, 2022
f57c33d
add rating functionality
arkadiuss Apr 3, 2022
19c9d7a
Fix negative sentiment
pszemkor Apr 3, 2022
15c5360
Merge remote-tracking branch 'origin/main' into main
pszemkor Apr 3, 2022
4bef682
fixes
Apr 3, 2022
d8dfddd
Merge remote-tracking branch 'origin/main'
Apr 3, 2022
5c4decd
fixes
Apr 3, 2022
decd2dd
Imporve requests view
pszemkor Apr 3, 2022
1dc8397
Add icon with warning
pszemkor Apr 3, 2022
3777ab9
style meeting details
arkadiuss Apr 3, 2022
3c741c4
Merge branch 'main' of gitlab.com:hacknarog2022/frontend
arkadiuss Apr 3, 2022
e11107d
unsaved files
arkadiuss Apr 3, 2022
2403067
Update README.md
pszemkor Apr 4, 2022
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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.angular
.vscode
node_modules
Dockerfile
34 changes: 22 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
services:
- docker:dind

stages:
- test
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
# - test
- build_publish

# sast:
# stage: test

# include:
# - template: Security/SAST.gitlab-ci.yml

variables:
CONTAINER_REGISTRY: hacknarog2022acr.azurecr.io

docker_build:
stage: build_publish
image: docker:latest
script:
- docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $CONTAINER_REGISTRY
- docker build -t $CONTAINER_REGISTRY/frontend:latest .
- docker push $CONTAINER_REGISTRY/frontend:latest
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:16 as build

WORKDIR /usr/local/app

COPY ./ /usr/local/app/

RUN npm ci

RUN npm run build

FROM nginx:latest

COPY --from=build /usr/local/app/dist/frontend/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
181 changes: 62 additions & 119 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,62 @@
# Frontend

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.0.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
# frontend



## Getting started

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!

## Add your files

- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:

```
cd existing_repo
git remote add origin https://gitlab.com/hacknarog2022/frontend.git
git branch -M main
git push -uf origin main
```

## Integrate with your tools

- [ ] [Set up project integrations](https://gitlab.com/hacknarog2022/frontend/-/settings/integrations)

## Collaborate with your team

- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)

## Test and Deploy

Use the built-in continuous integration in GitLab.

- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)

***

# Editing this README

When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.

## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.

## Name
Choose a self-explaining name for your project.

## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.

## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.

## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.

## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.

## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.

## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.

## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.

## Contributing
State if you are open to contributions and what your requirements are for accepting them.

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.

## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.

## License
For open source projects, say how it is licensed.

## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
Tired of your filter bubble? Want to meet someone with different opinion anywhere in the world? Let's create new reality of open-minded people. Select a topic and start a conversation with a stranger.

Demo: https://youtu.be/EwzhlJrdkys

## Inspiration
We asked ourselves a question - what is the "new reality"? For us the answers were:
- we live in a filter bubble wanting to talk only with people with the same opinions
- pandemic really limited the possibility to exchange ideas
- we started to travel again across the world and want to talk with locals
- diversity became an important topic and new standards are needed

Forseti (the name of the app) comes from Norse mythology (as well as the font used in the app) and it's the name of the god of justice and peace and reconciliation.

## What it does
As a response to the points from previous section our app lets people to find other ones interested in
similar topics with different or the same level of domain knowledge and exchange ideas through a meeting. Moreover it suggests questions and readings to make conversation more fluent and natural. We don't ask about gender, age, religion, nationality and your beliefs, we just want you to reach people from all around the world and exchange ideas.

Tenets:
- make people more open
- promote diversity
- expand our knowledge
- broaden your horizons

so in 4 words: Go beyond your reality!

Usage is so simple:
- Create a request about what you want to talk
- Wait for a person matching your request
- Write an email, discuss and meet!

Stay safe! Our app prevents from receiving hostile message with the use of AI (hostile requests are blocked) and users rating system.

## How we built it
Leveraging knowledge from many widely-known, big IT companies, state-of-the-art technologies, endless discussions and what's most important - teamwork and pair programming

## Challenges we ran into
- frontend development when you you didn't touch it for a while
- granular permissions of Azure B2C
- B2C is easy for ASP .NET - we wanted to make it for Spring

## Accomplishments that we're proud of
- we would really see it as real-life solution
- monetization idea (sponsored suggested places to meet, sponsored topics to discuss, premium account - allows for having more than 5 meetings in a month and 5 concurrent requests)
- probably the only app in the hackaton that has fully operating users management system (Azure B2C)
- app is fully deployed (continuous delivery!): https://forsetihacknarog.azurewebsites.net. We are not afraid - feel free to try it out. Create a user and meet!
- it looks well, having in mind that was designed by 4 typical programmers

## What we learned
In our field of study continuous development is of significant importance, this weekend the points are:
- Azure B2C is pretty powerful, has really granular permissions and it's painful to forget about even one
- rediscovered how to center a button in html (sentiment analysis was easier)
- despite each of us works in a different technology daily we realized that Java is the one that everyone knows quite well
- wide range of ML services provided by the clouds
- 4 typical backend programmers (in flannel shirts) can create not so bad UI

## What's next for Forseti
- wide database of materials, reading, experts, questions, topics
- tests if you are really a domain expert
- security and verification of users

## Tech Stack
Because of awesomeness of cloud computing we decided to heavily leverage Azure cloud services: business-2-customers (B2C), sentiment analysis, database, deployment. Because of the limited time we used widely known Spring backend and Angular frontend, with which everyone was a bit familiar. But despite a short time we didn't abandoned software engineering basics like CI/CD. Architecture is pretty easy - a single frontend and a scalable backend.
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumWarning": "1mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
Expand Down
31 changes: 31 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server {
listen 80;

server_name localhost;
#access_log logs/host.access.log main;
root /usr/share/nginx/html/;

location / {
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location /api {
proxy_pass http://api:8080;
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng serve --proxy-config src/proxy.conf.json",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
Expand Down
16 changes: 6 additions & 10 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

<div class="toolbar-spacer"></div>

<a mat-button routerLink='main' routerLinkActive='active'><h1>Forseti</h1></a>
<a mat-button routerLink='main' routerLinkActive='active'><h1 style="font-family: norse-fat">Forseti</h1></a>
<span class="example-fill-remaining-space"></span>

<button mat-raised-button *ngIf="!loginDisplay" (click)="login()">Login</button>
<button class=button_right mat-raised-button color="accent" *ngIf="loginDisplay" (click)="logout()">Logout</button>
<button style="font-family: norse-fat;" class="button_right button-color" mat-raised-button *ngIf="loginDisplay" (click)="logout()">Logout</button>
</mat-toolbar>

<div class="center-align">
<div class="center-align bg">
<!-- <button mat-raised-button (click)="requests()">Tests User</button>-->
<!--This is to avoid reload during acquireTokenSilent() because of hidden iframe -->
<router-outlet *ngIf="loginDisplay"></router-outlet>
<app-entry *ngIf="!loginDisplay"></app-entry>
</div>
<app-footer></app-footer>

<footer *ngIf="loginDisplay">
<div class="center-align" fxLayout="column" fxLayoutGap="10px" fxLayoutAlign="space-around center">
<mat-card>
<mat-card-content> Go beyond your reality</mat-card-content>
</mat-card>
</div>
</footer>
2 changes: 1 addition & 1 deletion src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
}

.center-align {
display: flex; justify-content:center; align-items:center;
display: flex; justify-content:center;
}
Loading