Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0dd761f
feat(angular-app): add front end functionality
gus-code Jan 8, 2024
ab5d158
feat(api): add crud operations for category
gus-code Jan 8, 2024
4f3b735
feat(api): add router
gus-code Jan 8, 2024
1ed6633
feat(api): refactor crud operations to new file
gus-code Jan 8, 2024
41fcc8f
refactor(api): move logic from route to controller
gus-code Jan 8, 2024
00de1c7
Merge branch 'main' into node/template
gus-code Jan 8, 2024
8c5d449
Merge branch 'node/template' into node/session-01
gus-code Jan 8, 2024
024c94e
Merge branch 'node/session-01' into node/session-02
gus-code Jan 8, 2024
b801647
chore(api): remove .gitkeep from controllers
gus-code Jan 8, 2024
081c58a
feat(api): create user model
gus-code Jan 8, 2024
26140e1
feat(api): create auth controller
gus-code Jan 8, 2024
18cc352
feat(api): create auth route
gus-code Jan 8, 2024
505f334
feat(api): add route to main file
gus-code Jan 8, 2024
8b9a89a
Merge branch 'main' into node/template
gus-code Jan 8, 2024
d67968b
feat(api): add basic configuration
gus-code Jan 8, 2024
5e198de
Merge branch 'node/session-00' into node/session-01
gus-code Jan 8, 2024
0d88039
Merge branch 'node/session-01' into node/session-02
gus-code Jan 8, 2024
3489c85
Merge branch 'node/session-02' into node/session-03
gus-code Jan 8, 2024
fd41638
Merge branch 'main' into node/template
gus-code Jan 9, 2024
a06be55
Merge branch 'node/template' into node/session-00
gus-code Jan 9, 2024
59aadea
Merge branch 'node/session-00' into node/session-01
gus-code Jan 9, 2024
842cf0d
Merge branch 'node/session-01' into node/session-02
gus-code Jan 9, 2024
19adf89
Merge branch 'node/session-02' into node/session-03
gus-code Jan 9, 2024
7c1b48f
feat(api): add verify token middleware
gus-code Jan 9, 2024
e839cf4
Merge branch 'main' into node/template
gus-code Jan 9, 2024
7735cec
Merge branch 'node/template' into node/session-00
gus-code Jan 9, 2024
d329c84
fix(api): relocate cors config
gus-code Jan 9, 2024
65ac083
fix(api): cors issue for local development
gus-code Jan 9, 2024
400c5b4
Merge branch 'node/session-00' into node/session-01
gus-code Jan 9, 2024
0e0a99d
Merge branch 'node/session-01' into node/session-02
gus-code Jan 9, 2024
54350d8
Merge branch 'node/session-02' into node/session-03
gus-code Jan 9, 2024
0aec367
feat(api): add error handler middleware
gus-code Jan 9, 2024
ca4222e
chore(api): remove .gitkeep file from config
gus-code Jan 9, 2024
3f6aa24
Merge branch 'node/session-00' into node/session-01
gus-code Jan 9, 2024
fe8d8ec
Merge branch 'node/session-01' into node/session-02
gus-code Jan 9, 2024
e67a741
Merge branch 'node/session-02' into node/session-03
gus-code Jan 9, 2024
bc2077c
Merge branch 'node/session-03' into node/session-04
gus-code Jan 9, 2024
05c4fbd
feat(api): add connection to MongoDB
gus-code Jan 9, 2024
837ac4c
feat(api): create category model
gus-code Jan 9, 2024
2eec543
refactor(api): update required property in model
gus-code Jan 9, 2024
78a1a00
refactor(api): connect controller with model
gus-code Jan 9, 2024
e9d93c3
Merge branch 'main' into node/template
gus-code Jan 9, 2024
d8a9e9b
Merge branch 'node/template' into node/session-00
gus-code Jan 9, 2024
e2ab88b
Merge branch 'node/session-00' into node/session-01
gus-code Jan 9, 2024
4e2e2b7
chore(api): add session 01 challenges
gus-code Jan 9, 2024
86384c8
Merge branch 'node/session-01' into node/session-02
gus-code Jan 9, 2024
bedf059
chore(api): add session 02 challenges
gus-code Jan 9, 2024
540d70c
Merge branch 'node/session-02' into node/session-03
gus-code Jan 9, 2024
ee6fae4
chore(api): add session 03 challenges
gus-code Jan 9, 2024
1feb2d8
Merge branch 'node/session-03' into node/session-04
gus-code Jan 9, 2024
072672f
chore(api): add session 04 challenges
gus-code Jan 9, 2024
90fa78a
Merge branch 'node/session-04' into node/session-05
gus-code Jan 9, 2024
230782f
chore(api): add session 05 challenges
gus-code Jan 9, 2024
901ea24
fix(api): refactor getCategory for future use
gus-code Jan 11, 2024
2dadc90
Merge branch 'node/session-01' into node/session-02
gus-code Jan 11, 2024
33a0024
Merge branch 'node/session-02' into node/session-03
gus-code Jan 11, 2024
e08e0be
Merge branch 'node/session-03' into node/session-04
gus-code Jan 11, 2024
1d0c662
refactor(api): update findByIdAndUpdate options
gus-code Jan 11, 2024
8e01bfa
feat(angular-app): add front end functionality
gus-code Jan 8, 2024
26fd431
Merge branch 'node/template' of https://github.com/gus-code/mfee-proj…
gus-code Jan 11, 2024
a1d7341
Merge branch 'node/template' into node/session-00
gus-code Jan 11, 2024
98c49b0
Merge branch 'node/session-00' into node/session-01
gus-code Jan 11, 2024
1498260
Merge branch 'node/session-01' into node/session-02
gus-code Jan 11, 2024
3fca0e2
Merge branch 'node/session-02' into node/session-03
gus-code Jan 11, 2024
5eb29eb
fix(api): add message to 409 error in auth register
gus-code Jan 11, 2024
38ed6d0
Merge branch 'node/session-03' into node/session-04
gus-code Jan 11, 2024
0e64cad
Merge branch 'node/session-04' into node/session-05
gus-code Jan 11, 2024
a988515
Merge remote-tracking branch 'origin/node/session-00' into david.d.he…
DavidEHA Aug 27, 2024
3caabd1
Merge remote-tracking branch 'origin/node/session-01' into david.d.he…
DavidEHA Aug 27, 2024
5b2a374
Merge remote-tracking branch 'origin/node/session-05' into david.d.he…
DavidEHA Sep 14, 2024
4a4b658
Project completed
DavidEHA Sep 19, 2024
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
1 change: 1 addition & 0 deletions apps/angular-app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<mfee-header></mfee-header>
<router-outlet></router-outlet>
4 changes: 3 additions & 1 deletion apps/angular-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';

import { HeaderComponent } from './components/header/header.component';

@Component({
standalone: true,
imports: [RouterModule],
imports: [HeaderComponent, RouterModule],
selector: 'mfee-project-root',
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
Expand Down
3 changes: 2 additions & 1 deletion apps/angular-app/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { provideHttpClient } from '@angular/common/http';
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';

import { appRoutes } from './app.routes';

export const appConfig: ApplicationConfig = {
providers: [provideRouter(appRoutes)]
providers: [provideRouter(appRoutes), provideHttpClient()]
};
21 changes: 20 additions & 1 deletion apps/angular-app/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
import { Route } from '@angular/router';

export const appRoutes: Route[] = [];
import { HomeComponent } from './views/home/home.component';
import { PageNotFoundComponent } from './views/page-not-found/page-not-found.component';
import { PostComponent } from './views/post/post.component';

export const appRoutes: Route[] = [
{
path: '',
pathMatch: 'full',
component: HomeComponent
},
{
path: 'post/:id',
component: PostComponent
},
{
path: '**',
component: PageNotFoundComponent
}
];

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<button class="mfee-add-post-button" (click)="addPost()" title="Add post">
<i class="material-icons">edit</i>
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.mfee-add-post-button {
position: fixed;
width: 3rem;
height: 3rem;
border-radius: 99px;
background-color: orange;
border: none;
right: 1rem;
top: 3rem;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
cursor: pointer;
color: white;
display: flex;
align-items: center;
justify-content: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AddPostComponent } from './add-post.component';

describe('AddPostComponent', () => {
let component: AddPostComponent;
let fixture: ComponentFixture<AddPostComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AddPostComponent],
}).compileComponents();

fixture = TestBed.createComponent(AddPostComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
19 changes: 19 additions & 0 deletions apps/angular-app/src/app/components/add-post/add-post.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Output } from '@angular/core';

@Component({
selector: 'mfee-add-post',
standalone: true,
imports: [CommonModule],
templateUrl: './add-post.component.html',
styleUrl: './add-post.component.scss'
})
export class AddPostComponent {
@Output() clickAction: EventEmitter<void> = new EventEmitter<void>();

constructor() {}

public addPost(): void {
this.clickAction.emit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<section class="mfee-category-container">
<ul class="mfee-category">
<li class="mfee-category__item" *ngFor="let category of categories" (click)="setCategory(category.id)"
[class.mfee-category__item--active]="selectedCategory === category.id">
{{ category.name }}
</li>
</ul>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.mfee-category-container {
display: flex;
justify-content: center;
}

.mfee-category {
list-style: none;
display: flex;
padding: 0;

@media (max-width: 767px) {
flex-direction: column;
width: 95%;
}

&__item {
padding: 0.6rem 1.2rem;
border: 1px solid #ccc;
border-bottom: none;
cursor: pointer;

&:last-of-type {
border-bottom: 1px solid #ccc;
}

@media (min-width: 767px) {
border-right: none;
border-bottom: 1px solid #ccc;

&:first-of-type {
border-top-left-radius: 0.2rem;
border-bottom-left-radius: 0.2rem;
}

&:last-of-type {
border-right: 1px solid #ccc;
border-top-right-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
}

&--active,
&:hover {
background-color: #ccc;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CategoriesComponent } from './categories.component';

describe('CategoriesComponent', () => {
let component: CategoriesComponent;
let fixture: ComponentFixture<CategoriesComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [CategoriesComponent]
}).compileComponents();

fixture = TestBed.createComponent(CategoriesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core';

import { Category } from '../../models/Category';

@Component({
selector: 'mfee-categories',
standalone: true,
imports: [CommonModule],
templateUrl: './categories.component.html',
styleUrl: './categories.component.scss'
})
export class CategoriesComponent {
@Input() selectedCategory: string;
@Input() categories: Array<Category>;
@Output() categoryChange: EventEmitter<string> = new EventEmitter<string>();

setCategory(categoryId: string) {
this.categoryChange.emit(categoryId)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<header class="mfee-header">
<div class="mfee-header__slogan">
<span class="mfee-header__slogan-icon">[</span>
<label>Making your Life Easier</label>
<span class="mfee-header__slogan-icon">]</span>
</div>
<h1 class="mfee-header__title">Discovering the World</h1>
</header>
22 changes: 22 additions & 0 deletions apps/angular-app/src/app/components/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.mfee-header {
display: flex;
flex-direction: column;
align-items: center;
padding: 1.5rem 0;
text-align: center;

&__slogan {
color: orange;
font-size: 0.8rem;
}

&__slogan-icon {
font-size: 2em;
padding: 0 0.5rem;
}

&__title {
margin: 0;
font-size: 2.5rem;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HeaderComponent } from './header.component';

describe('HeaderComponent', () => {
let component: HeaderComponent;
let fixture: ComponentFixture<HeaderComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HeaderComponent],
}).compileComponents();

fixture = TestBed.createComponent(HeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
11 changes: 11 additions & 0 deletions apps/angular-app/src/app/components/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
selector: 'mfee-header',
standalone: true,
imports: [CommonModule],
templateUrl: './header.component.html',
styleUrl: './header.component.scss',
})
export class HeaderComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<section class="mfee-grid-container">
<div class="mfee-grid-post" *ngFor="let post of posts" [ngStyle]="{ 'background-image': 'url(' + post.image + ')' }" (click)="onClick($event, post.id)">
<h2 class="mfee-grid-post__title">{{ post.title }}</h2>
<span class="mfee-grid-post__comments">{{ post.comments.count }} Comments
<i class="material-icons">forum</i></span>
<p class="mfee-grid-post__description">{{ post.description }}</p>
<div class="mfee-grid-post__footer">
<label class="mfee-grid-post__tag">{{ post.category.name }}</label>
<ul class="mfee-grid-post__actions">
<li class="mfee-grid-post__actions-item" title="Edit" (click)="onEditPost(post.id)">
<i class="material-icons">edit</i>
</li>
<li class="mfee-grid-post__actions-item" title="Delete" (click)="onDeletePost(post.id)">
<i class="material-icons">delete</i>
</li>
</ul>
</div>
</div>
</section>
Loading