Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
hasta pronto
Browse files Browse the repository at this point in the history
- API endpoints not longer available, now it is required to login via
  m365 oauth
- Added banner and /login /home routes disabled
- Serverless app stopped
  • Loading branch information
sjdonado committed Aug 3, 2024
1 parent dac4d36 commit c6cc1d2
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 61 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# 📆 Mi horario UN

> Since 2020 more than 7k schedules have been imported to Google Calendar!
| API | Web Page |
| -----| --------- |
| ![Uptime Badge](https://uptime.donado.co/api/badge/6/uptime/24?labelPrefix=API%20&labelSuffix=h) ![Uptime Badge](https://uptime.donado.co/api/badge/6/ping/24?labelPrefix=API%20) | ![Uptime Badge](https://uptime.donado.co/api/badge/5/uptime/24?labelPrefix=Web%20Page%20&labelSuffix=h) ![Uptime Badge](https://uptime.donado.co/api/badge/5/ping/24?labelPrefix=Web%20Page%20) |
<!-- | API | Web Page | -->
<!-- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -->
<!-- | ![Uptime Badge](https://uptime.donado.co/api/badge/6/uptime/24?labelPrefix=API%20&labelSuffix=h) ![Uptime Badge](https://uptime.donado.co/api/badge/6/ping/24?labelPrefix=API%20) | ![Uptime Badge](https://uptime.donado.co/api/badge/5/uptime/24?labelPrefix=Web%20Page%20&labelSuffix=h) ![Uptime Badge](https://uptime.donado.co/api/badge/5/ping/24?labelPrefix=Web%20Page%20) | -->

<img width="1400" alt="image" src="https://user-images.githubusercontent.com/27580836/233056842-b706ca7f-fd7d-46bc-bf75-725ced66937d.png">

## Disclaimer

**This application is an open-source project, and it is not associated or officially supported by the Universidad del Norte.**

## Contribute

Want to fix a bug, contribute, or improve documentation? Awesome! Check out the [guidelines](https://github.com/sjdonado/quevent/blob/master/CONTRIBUTING.md).

## How to run?

1. Create the oauth credentials/app [here](https://support.google.com/cloud/answer/6158849)
2. Run the server + client

2. Run server

```bash
npm install
npm run --prefix server dev
npm run --prefix client start
bun dev
```

3. Run client

```bash
NODE_OPTIONS=--openssl-legacy-provider bun start
```

## Inspiration

First version was made by [krthr](https://github.com/krthr)
Binary file added client/bun.lockb
Binary file not shown.
44 changes: 22 additions & 22 deletions client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './components/login/login.component';
import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component';
import { IndexComponent } from './components/index/index.component';
import { HelpComponent } from './components/help/help.component';
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { LoginComponent } from "./components/login/login.component";
import { PrivacyPolicyComponent } from "./components/privacy-policy/privacy-policy.component";
import { IndexComponent } from "./components/index/index.component";
import { HelpComponent } from "./components/help/help.component";

const routes: Routes = [
{
path: '',
component: IndexComponent
path: "",
component: IndexComponent,
},
// {
// path: 'login',
// component: LoginComponent
// },
{
path: 'login',
component: LoginComponent
path: "privacy-policy",
component: PrivacyPolicyComponent,
},
{
path: 'privacy-policy',
component: PrivacyPolicyComponent
path: "help",
component: HelpComponent,
},
{
path: 'help',
component: HelpComponent
},
{
path: 'home',
loadChildren: () => import('./components/home/home.module').then(m => m.HomeModule),
},
{ path: '**', redirectTo: '/' },
// {
// path: 'home',
// loadChildren: () => import('./components/home/home.module').then(m => m.HomeModule),
// },
{ path: "**", redirectTo: "/" },
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class AppRoutingModule { }
16 changes: 12 additions & 4 deletions client/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<router-outlet ></router-outlet>
<router-outlet></router-outlet>
<footer fxLayout="row" fxLayoutAlign="center center">
<p class="link" routerLink="/help">Ayuda</p>
<p>|</p>
<p class="link" routerLink="/privacy-policy">Política de privacidad</p>
<p>|</p>
<p><a href="https://uptime.donado.co/status/apps" target="_blank" aria-label="Estado de la aplicación" rel="noopener">Estado de la aplicación</a></p>
<p>|</p>
<p><a href="https://github.com/sjdonado/mihorario" target="_blank" aria-label="Código fuente" rel="noopener">Código fuente</a></p>
<!-- <p><a href="https://uptime.donado.co/status/apps" target="_blank" aria-label="Estado de la aplicación" rel="noopener">Estado de la aplicación</a></p> -->
<!-- <p>|</p> -->
<p>
<a
href="https://github.com/sjdonado/mihorario"
target="_blank"
aria-label="Código fuente"
rel="noopener"
>Código fuente</a
>
</p>
</footer>
52 changes: 45 additions & 7 deletions client/src/app/components/index/index.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px" class="wrapper">
<div fxLayout="column" fxLayoutAlign="center center" fxLayoutGap="5px" class="container" fxFlex>
<div
fxLayout="row"
fxLayoutAlign="center center"
fxLayoutGap="5px"
class="wrapper"
>
<div
fxLayout="column"
fxLayoutAlign="center center"
fxFlex="100"
class="banner"
>
<h2>Hasta pronto</h2>
<p>
Lamentamos informarte que esta aplicación ha dejado de funcionar debido a
cambios de seguridad implementados por la Universidad.
</p>
<p>
Te invitamos a acceder a tu horario a través de la aplicación oficial
disponible
<a href="https://apps.apple.com/de/app/uninorteco/id6499095907">aquí</a>.
</p>
</div>
<div
fxLayout="column"
fxLayoutAlign="center center"
fxLayoutGap="5px"
class="container"
fxFlex
>
<h1 class="app-name" fxFlex="30">{{ title }}</h1>
<div fxLayout="column" fxLayoutGap="5px" class="features" fxFlex="40">
<div fxLayout="row">
Expand All @@ -8,26 +36,36 @@ <h1 class="app-name" fxFlex="30">{{ title }}</h1>
</div>
<div fxLayout="row">
<mat-icon>sync</mat-icon>
<p>Sincronizalo con Google Calendar.</p>
<p>Sincronízalo con Google Calendar.</p>
</div>
<div fxLayout="row">
<mat-icon>alarm</mat-icon>
<p>Recibe notificaciones.</p>
</div>
<div fxLayout="row">
<mat-icon>done_all</mat-icon>
<p #counter class="counter">...</p>
<p>horarios han sido exportados!</p>
<p #counter class="counter"></p>
<p>horarios fueron exportados.</p>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="center center" fxFlex="10">
<div fxLayout="row" fxLayoutAlign="center center" class="button" routerLink="/login">
<div
fxLayout="row"
fxLayoutAlign="center center"
class="button disabled"
routerLink="/login"
>
<p>Entrar</p>
<mat-icon>arrow_right_alt</mat-icon>
</div>
</div>
</div>
<div fxLayout="row" fxHide.lt-md fxFlex="50">
<img src="/assets/screens.svg" width="500" height="200" alt="Mi horario screens">
<img
src="/assets/screens.svg"
width="500"
height="200"
alt="Mi horario screens"
/>
</div>
</div>
52 changes: 47 additions & 5 deletions client/src/app/components/index/index.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@
}

.features {
p, mat-icon {

p,
mat-icon {
color: white;
}

p {
margin: 4px;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

div {
padding-left: 20px;
}

.counter {
margin-right: 0;
}
Expand All @@ -33,6 +38,7 @@
.link {
cursor: pointer;
text-align: center;

&:hover {
text-decoration: underline;
}
Expand All @@ -43,9 +49,10 @@
width: 160px;
margin: auto;
border-radius: 20px;
box-shadow: 0 2px 30px rgba(black, .2);
box-shadow: 0 2px 30px rgba(black, 0.2);

p, mat-icon {
p,
mat-icon {
color: rgb(29, 29, 29);
}

Expand All @@ -55,13 +62,48 @@
}

&:hover {
box-shadow: 0 2px 30px rgba(black, .4);
box-shadow: 0 2px 30px rgba(black, 0.4);
}

transition: 0.5s;
}

.button.disabled {
pointer-events: none;
opacity: 0.5;
cursor: not-allowed;
}

.banner {
position: absolute;
top: 0;
left: 0;
background-color: #ffcccb;
padding: 10px;
margin-bottom: 10px;
font-size: 0.9em;
width: 100%;
color: #d8000c;
}

.banner h2 {
letter-spacing: 0.4em !important;
font-weight: normal !important;
}

.banner p {
width: 100%;
margin: 0;
text-align: left;
margin: 4px 0;
}

.banner a {
text-decoration: underline;
}

@media all and (max-width: 767px) {
.container {
height: 85%;
}
}
}
33 changes: 18 additions & 15 deletions client/src/app/components/index/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { AppComponent } from 'src/app/app.component';
import { StatisticsService } from 'src/app/services/statistics.service';
import { Component, ElementRef, OnInit, ViewChild } from "@angular/core";
import { AppComponent } from "src/app/app.component";
import { StatisticsService } from "src/app/services/statistics.service";

@Component({
selector: 'app-index',
templateUrl: './index.component.html',
styleUrls: ['./index.component.scss']
selector: "app-index",
templateUrl: "./index.component.html",
styleUrls: ["./index.component.scss"],
})
export class IndexComponent implements OnInit {

public title: string;
@ViewChild('counter') counter: ElementRef;
@ViewChild("counter") counter: ElementRef;

constructor(
private appComponent: AppComponent,
Expand All @@ -19,13 +18,17 @@ export class IndexComponent implements OnInit {

ngOnInit() {
this.title = this.appComponent.title;
this.statisticsService.getStatistics().subscribe(
(response: any) => {
this.animateValue(this.counter.nativeElement, 0, response.data.totalUsersCounter, 5000);
}, (err) => {
console.log('Error: ' + err);
},
);
}

ngAfterViewInit() {
// this.statisticsService.getStatistics().subscribe(
// (response: any) => {
// this.animateValue(this.counter.nativeElement, 0, response.data.totalUsersCounter, 5000);
// }, (err) => {
// console.log('Error: ' + err);
// },
// );
this.animateValue(this.counter.nativeElement, 0, 7833, 1000);
}

animateValue(obj, start, end, duration) {
Expand Down
Binary file added server/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"dev": "serverless offline --printOutput",
"dev": "serverless offline",
"test": "PINO_LEVEL=error jest --coverage --testTimeout 7000",
"test:debug": "PINO_LEVEL=error node --inspect-brk node_modules/.bin/jest --coverage --runInBand",
"deploy": "serverless deploy"
Expand Down

0 comments on commit c6cc1d2

Please sign in to comment.