diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..28a804d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 7beed61..9e589f8 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,7 +1,12 @@
+
+
+
-
+
+
+
@@ -12,19 +17,180 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sty
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+ false
+ true
+ true
+
true
DEFINITION_ORDER
-
-
-
-
+
+
+
+
+
+
+
+
@@ -42,14 +208,83 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -63,6 +298,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -73,31 +333,80 @@
1510564330571
-
+
+
+
+
+ 1510584028365
+
+
+
+ 1510584028365
+
+
+ 1510584365912
+
+
+
+ 1510584365912
+
+
+ 1510657567471
+
+
+
+ 1510657567471
+
+
+ 1510658605515
+
+
+
+ 1510658605515
+
+ 1510669855121
+
+
+
+ 1510669855121
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -107,8 +416,360 @@
+
+
+
+
+
-
-
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/server/server.js
+ 27
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/src/app/sign-in-service.service.ts
+ 35
+
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/src/app/sign-in-service.service.ts
+ 38
+
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/src/app/sign-in-service.service.ts
+ 23
+
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/server/server.js
+ 35
+
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/server/server.js
+ 37
+
+
+
+
+ file://$PROJECT_DIR$/client-side-chat/server/server.js
+ 38
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/client-side-chat/.angular-cli.json b/client-side-chat/.angular-cli.json
new file mode 100644
index 0000000..3eb20d4
--- /dev/null
+++ b/client-side-chat/.angular-cli.json
@@ -0,0 +1,61 @@
+{
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
+ "project": {
+ "name": "client-side-chat"
+ },
+ "apps": [
+ {
+ "root": "src",
+ "outDir": "dist",
+ "assets": [
+ "assets",
+ "favicon.ico"
+ ],
+ "index": "index.html",
+ "main": "main.ts",
+ "polyfills": "polyfills.ts",
+ "test": "test.ts",
+ "tsconfig": "tsconfig.app.json",
+ "testTsconfig": "tsconfig.spec.json",
+ "prefix": "app",
+ "styles": [
+ "../node_modules/bootstrap/dist/css/bootstrap.min.css",
+ "styles.css"
+ ],
+ "scripts": [],
+ "environmentSource": "environments/environment.ts",
+ "environments": {
+ "dev": "environments/environment.ts",
+ "prod": "environments/environment.prod.ts"
+ }
+ }
+ ],
+ "e2e": {
+ "protractor": {
+ "config": "./protractor.conf.js"
+ }
+ },
+ "lint": [
+ {
+ "project": "src/tsconfig.app.json",
+ "exclude": "**/node_modules/**"
+ },
+ {
+ "project": "src/tsconfig.spec.json",
+ "exclude": "**/node_modules/**"
+ },
+ {
+ "project": "e2e/tsconfig.e2e.json",
+ "exclude": "**/node_modules/**"
+ }
+ ],
+ "test": {
+ "karma": {
+ "config": "./karma.conf.js"
+ }
+ },
+ "defaults": {
+ "styleExt": "css",
+ "component": {}
+ }
+}
diff --git a/client-side-chat/package.json b/client-side-chat/package.json
new file mode 100644
index 0000000..e8260fd
--- /dev/null
+++ b/client-side-chat/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "client-side-chat",
+ "version": "0.0.0",
+ "license": "MIT",
+ "scripts": {
+ "ng": "ng",
+ "start": "ng serve",
+ "build": "ng build",
+ "test": "ng test",
+ "lint": "ng lint",
+ "e2e": "ng e2e"
+ },
+ "private": true,
+ "dependencies": {
+ "@angular/animations": "^5.0.0",
+ "@angular/common": "^5.0.0",
+ "@angular/compiler": "^5.0.0",
+ "@angular/core": "^5.0.0",
+ "@angular/forms": "^5.0.0",
+ "@angular/http": "^5.0.0",
+ "@angular/platform-browser": "^5.0.0",
+ "@angular/platform-browser-dynamic": "^5.0.0",
+ "@angular/router": "^5.0.0",
+ "body-parser": "^1.18.2",
+ "bootstrap": "^3.3.7",
+ "core-js": "^2.4.1",
+ "cors": "^2.8.4",
+ "file-system": "^2.2.2",
+ "rxjs": "^5.5.2",
+ "zone.js": "^0.8.14"
+ },
+ "devDependencies": {
+ "@angular/cli": "1.5.0",
+ "@angular/compiler-cli": "^5.0.0",
+ "@angular/language-service": "^5.0.0",
+ "@types/jasmine": "~2.5.53",
+ "@types/jasminewd2": "~2.0.2",
+ "@types/node": "~6.0.60",
+ "codelyzer": "~3.2.0",
+ "express": "^4.16.2",
+ "jasmine-core": "~2.6.2",
+ "jasmine-spec-reporter": "~4.1.0",
+ "karma": "~1.7.0",
+ "karma-chrome-launcher": "~2.1.1",
+ "karma-cli": "~1.0.1",
+ "karma-coverage-istanbul-reporter": "^1.2.1",
+ "karma-jasmine": "~1.1.0",
+ "karma-jasmine-html-reporter": "^0.2.2",
+ "protractor": "~5.1.2",
+ "ts-node": "~3.2.0",
+ "tslint": "~5.7.0",
+ "typescript": "~2.4.2"
+ }
+}
diff --git a/client-side-chat/server/data/users.json b/client-side-chat/server/data/users.json
new file mode 100644
index 0000000..a148f0a
--- /dev/null
+++ b/client-side-chat/server/data/users.json
@@ -0,0 +1,18 @@
+[
+ {
+ "username": "Mr. Nice",
+ "password": 1237
+ },
+ {
+ "username": "leon",
+ "password": 1
+ },
+ {
+ "username": "aviv",
+ "password": 1234
+ },
+ {
+ "username": "tealterMashoo",
+ "password": 5555
+ }
+]
diff --git a/client-side-chat/server/routes/api.js b/client-side-chat/server/routes/api.js
new file mode 100644
index 0000000..6bd0243
--- /dev/null
+++ b/client-side-chat/server/routes/api.js
@@ -0,0 +1,9 @@
+const express = require('express');
+const router = express.Router();
+
+/* GET api listing. */
+router.get('/', (req, res) => {
+ res.send('api works');
+});
+
+module.exports = router;
diff --git a/client-side-chat/server/server.js b/client-side-chat/server/server.js
new file mode 100644
index 0000000..1eb3589
--- /dev/null
+++ b/client-side-chat/server/server.js
@@ -0,0 +1,69 @@
+// Get dependencies
+
+const express = require('express');
+const path = require('path');
+const http = require('http');
+const bodyParser = require('body-parser');
+var file = require('file-system');
+var fs = require('fs');
+var cors = require('cors');
+
+// Get our API routes
+const api = require('./routes/api');
+
+const app = express();
+
+app.use(cors());
+// Parsers for POST data
+app.use(bodyParser.json());
+app.use(bodyParser.urlencoded({extended: false}));
+
+// Point static path to dist
+app.use(express.static(path.join(__dirname, 'dist')));
+// Set our api routes
+app.use('/api', api);
+
+// Catch all other routes and return the index file
+app.get('/validate/:username', (req, res) => {
+ if (doesUserExist(req.params.username))
+ res.send(jsonUsers.find(user => user.username === req.params.username));
+ else
+ res.send('user doesnt exist!');
+});
+
+app.post('/validate', (req, res) => {
+
+ if (doesUserExist(req.body.username)) {
+ let tempUser = jsonUsers.find(user => user.username === req.body.username);
+ if (tempUser.password === parseInt(req.body.password))
+ res.send(tempUser);
+ else
+ send('username or password incorrect, please try again');
+ }
+ else
+ res.send('user doesnt exist!');
+});
+
+/**
+ * Get port from environment and store in Express.
+ */
+const port = process.env.PORT || '3000';
+app.set('port', port);
+
+/**
+ * Create HTTP server.
+ */
+const server = http.createServer(app);
+
+/**
+ * Listen on provided port, on all network interfaces.
+ */
+server.listen(port, () => console.log(`API running on localhost:${port}`));
+
+var jsonUsers = JSON.parse(fs.readFileSync('C:\\Users\\Jbt\\WebstormProjects\\angular-team-chat-aviv\\client-side-chat\\server\\data\\users.json'), 'utf-8');
+
+function doesUserExist(username) {
+ return jsonUsers.filter(user => user.username === username).length === 1;
+}
+
+//sfsadfgsd
diff --git a/client-side-chat/src/app/app.component.css b/client-side-chat/src/app/app.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/client-side-chat/src/app/app.component.html b/client-side-chat/src/app/app.component.html
new file mode 100644
index 0000000..c819405
--- /dev/null
+++ b/client-side-chat/src/app/app.component.html
@@ -0,0 +1,10 @@
+
+
+
+ Welcome to {{title}}!
+
+
+
+
+
+
diff --git a/client-side-chat/src/app/app.component.spec.ts b/client-side-chat/src/app/app.component.spec.ts
new file mode 100644
index 0000000..bcbdf36
--- /dev/null
+++ b/client-side-chat/src/app/app.component.spec.ts
@@ -0,0 +1,27 @@
+import { TestBed, async } from '@angular/core/testing';
+import { AppComponent } from './app.component';
+describe('AppComponent', () => {
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [
+ AppComponent
+ ],
+ }).compileComponents();
+ }));
+ it('should create the app', async(() => {
+ const fixture = TestBed.createComponent(AppComponent);
+ const app = fixture.debugElement.componentInstance;
+ expect(app).toBeTruthy();
+ }));
+ it(`should have as title 'app'`, async(() => {
+ const fixture = TestBed.createComponent(AppComponent);
+ const app = fixture.debugElement.componentInstance;
+ expect(app.title).toEqual('app');
+ }));
+ it('should render title in a h1 tag', async(() => {
+ const fixture = TestBed.createComponent(AppComponent);
+ fixture.detectChanges();
+ const compiled = fixture.debugElement.nativeElement;
+ expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
+ }));
+});
diff --git a/client-side-chat/src/app/app.component.ts b/client-side-chat/src/app/app.component.ts
new file mode 100644
index 0000000..7b0f672
--- /dev/null
+++ b/client-side-chat/src/app/app.component.ts
@@ -0,0 +1,10 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-root',
+ templateUrl: './app.component.html',
+ styleUrls: ['./app.component.css']
+})
+export class AppComponent {
+ title = 'app';
+}
diff --git a/client-side-chat/src/app/app.module.ts b/client-side-chat/src/app/app.module.ts
new file mode 100644
index 0000000..6868333
--- /dev/null
+++ b/client-side-chat/src/app/app.module.ts
@@ -0,0 +1,46 @@
+import { BrowserModule } from '@angular/platform-browser';
+import { FormsModule } from '@angular/forms';
+import { NgModule } from '@angular/core';
+import { HttpClientModule } from '@angular/common/http';
+import { RouterModule, Routes } from '@angular/router';
+import { AppComponent } from './app.component';
+import { SignInComponentComponent } from './sign-in-component/sign-in-component.component';
+import { RoomsComponentComponent } from './rooms-component/rooms-component.component';
+
+const appRoutes: Routes = [
+ { path: 'crisis-center', component: CrisisListComponent },
+ { path: 'hero/:id', component: HeroDetailComponent },
+ {
+ path: 'heroes',
+ component: HeroListComponent,
+ data: { title: 'Heroes List' }
+ },
+ { path: '',
+ redirectTo: '/users',
+ pathMatch: 'full'
+ },
+ { path: '**', component: PageNotFoundComponent }
+];
+
+
+@NgModule({
+ imports: [
+ BrowserModule,
+ FormsModule,
+ HttpClientModule,
+ RouterModule,
+ // RouterModule.forRoot(
+ // // appRoutes,
+ // { enableTracing: true } // <-- debugging purposes only
+ // )
+ ],
+
+ declarations: [
+ AppComponent,
+ SignInComponentComponent,
+ RoomsComponentComponent
+ ],
+ providers: [],
+ bootstrap: [AppComponent]
+})
+export class AppModule { }
diff --git a/client-side-chat/src/app/rooms-component/rooms-component.component.css b/client-side-chat/src/app/rooms-component/rooms-component.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/client-side-chat/src/app/rooms-component/rooms-component.component.html b/client-side-chat/src/app/rooms-component/rooms-component.component.html
new file mode 100644
index 0000000..b1d7466
--- /dev/null
+++ b/client-side-chat/src/app/rooms-component/rooms-component.component.html
@@ -0,0 +1,3 @@
+
+ rooms-component works!
+
diff --git a/client-side-chat/src/app/rooms-component/rooms-component.component.spec.ts b/client-side-chat/src/app/rooms-component/rooms-component.component.spec.ts
new file mode 100644
index 0000000..c836a3e
--- /dev/null
+++ b/client-side-chat/src/app/rooms-component/rooms-component.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { RoomsComponentComponent } from './rooms-component.component';
+
+describe('RoomsComponentComponent', () => {
+ let component: RoomsComponentComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ RoomsComponentComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(RoomsComponentComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/client-side-chat/src/app/rooms-component/rooms-component.component.ts b/client-side-chat/src/app/rooms-component/rooms-component.component.ts
new file mode 100644
index 0000000..5e52c5e
--- /dev/null
+++ b/client-side-chat/src/app/rooms-component/rooms-component.component.ts
@@ -0,0 +1,16 @@
+import { Component, OnInit, ViewEncapsulation } from '@angular/core';
+
+@Component({
+ selector: 'app-rooms-component',
+ templateUrl: './rooms-component.component.html',
+ styleUrls: ['./rooms-component.component.css'],
+ encapsulation: ViewEncapsulation.None
+})
+export class RoomsComponentComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/client-side-chat/src/app/sign-in-component/sign-in-component.component.css b/client-side-chat/src/app/sign-in-component/sign-in-component.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/client-side-chat/src/app/sign-in-component/sign-in-component.component.html b/client-side-chat/src/app/sign-in-component/sign-in-component.component.html
new file mode 100644
index 0000000..ddb9760
--- /dev/null
+++ b/client-side-chat/src/app/sign-in-component/sign-in-component.component.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Sign In
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/client-side-chat/src/app/sign-in-component/sign-in-component.component.spec.ts b/client-side-chat/src/app/sign-in-component/sign-in-component.component.spec.ts
new file mode 100644
index 0000000..6058c4e
--- /dev/null
+++ b/client-side-chat/src/app/sign-in-component/sign-in-component.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SignInComponentComponent } from './sign-in-component.component';
+
+describe('SignInComponentComponent', () => {
+ let component: SignInComponentComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SignInComponentComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SignInComponentComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/client-side-chat/src/app/sign-in-component/sign-in-component.component.ts b/client-side-chat/src/app/sign-in-component/sign-in-component.component.ts
new file mode 100644
index 0000000..3b30491
--- /dev/null
+++ b/client-side-chat/src/app/sign-in-component/sign-in-component.component.ts
@@ -0,0 +1,26 @@
+import { Component, OnInit, ViewEncapsulation } from '@angular/core';
+import { User } from '../user';
+import { SignInService } from '../sign-in-service.service';
+
+@Component({
+ selector: 'app-sign-in-component',
+ templateUrl: './sign-in-component.component.html',
+ styleUrls: ['./sign-in-component.component.css'],
+ providers: [SignInService],
+ encapsulation: ViewEncapsulation.None
+})
+export class SignInComponentComponent implements OnInit {
+
+ user: User = {username:"", password:null};
+
+ constructor(private signInService: SignInService) {
+ }
+
+ ngOnInit() {
+ }
+
+ submit(){
+ this.signInService.loginUser(this.user.username,this.user.password).subscribe((res) => console.log(res));
+ }
+
+}
diff --git a/client-side-chat/src/app/sign-in-service.service.spec.ts b/client-side-chat/src/app/sign-in-service.service.spec.ts
new file mode 100644
index 0000000..e97718c
--- /dev/null
+++ b/client-side-chat/src/app/sign-in-service.service.spec.ts
@@ -0,0 +1,15 @@
+import { TestBed, inject } from '@angular/core/testing';
+
+import { SignInService } from './sign-in-service.service';
+
+describe('SignInService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [SignInService]
+ });
+ });
+
+ it('should be created', inject([SignInService], (service: SignInService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/client-side-chat/src/app/sign-in-service.service.ts b/client-side-chat/src/app/sign-in-service.service.ts
new file mode 100644
index 0000000..8134ba4
--- /dev/null
+++ b/client-side-chat/src/app/sign-in-service.service.ts
@@ -0,0 +1,50 @@
+import { Injectable } from '@angular/core';
+import { User } from './user';
+import { Observable } from 'rxjs/Observable';
+import { HttpClient } from '@angular/common/http';
+
+import { of } from 'rxjs/observable/of';
+import { catchError, map, tap } from 'rxjs/operators';
+
+@Injectable()
+export class SignInService {
+
+ constructor(private http: HttpClient) { }
+
+ // loginUser (userName: string): Observable {
+ // return this.http.get("http://localhost:3000/validate/" + userName)
+ // .pipe(
+ // tap(users => this.log(`fetched users`)),
+ // catchError(this.handleError('getUsers', []))
+ // );
+ // }
+
+
+ loginUser (userName: string,password:number) {
+ let body = {username: userName,password : password};
+ return this.http.post("http://localhost:3000/validate/",body)
+ .pipe(
+ tap(users => this.log(`fetched users`)),
+ catchError(this.handleError('getUsers', []))
+ );
+ }
+
+ private handleError (operation = 'operation', result?: T) {
+ return (error: any): Observable => {
+
+ // TODO: send the error to remote logging infrastructure
+ console.log(error.toString()); // log to console instead
+
+ // TODO: better job of transforming error for user consumption
+ this.log(`${operation} failed: ${error.message}`);
+
+ // Let the app keep running by returning an empty result.
+ return of(result as T);
+ };
+ }
+
+ private log(message: string) {
+ }
+
+}
+
diff --git a/client-side-chat/src/app/user.ts b/client-side-chat/src/app/user.ts
new file mode 100644
index 0000000..ae5b950
--- /dev/null
+++ b/client-side-chat/src/app/user.ts
@@ -0,0 +1,4 @@
+export class User{
+ username : string;
+ password : number;
+}
diff --git a/client-side-chat/src/assets/.gitkeep b/client-side-chat/src/assets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/client-side-chat/src/environments/environment.prod.ts b/client-side-chat/src/environments/environment.prod.ts
new file mode 100644
index 0000000..3612073
--- /dev/null
+++ b/client-side-chat/src/environments/environment.prod.ts
@@ -0,0 +1,3 @@
+export const environment = {
+ production: true
+};
diff --git a/client-side-chat/src/environments/environment.ts b/client-side-chat/src/environments/environment.ts
new file mode 100644
index 0000000..b7f639a
--- /dev/null
+++ b/client-side-chat/src/environments/environment.ts
@@ -0,0 +1,8 @@
+// The file contents for the current environment will overwrite these during build.
+// The build system defaults to the dev environment which uses `environment.ts`, but if you do
+// `ng build --env=prod` then `environment.prod.ts` will be used instead.
+// The list of which env maps to which file can be found in `.angular-cli.json`.
+
+export const environment = {
+ production: false
+};
diff --git a/client-side-chat/src/favicon.ico b/client-side-chat/src/favicon.ico
new file mode 100644
index 0000000..8081c7c
Binary files /dev/null and b/client-side-chat/src/favicon.ico differ
diff --git a/client-side-chat/src/index.html b/client-side-chat/src/index.html
new file mode 100644
index 0000000..aa59f15
--- /dev/null
+++ b/client-side-chat/src/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+ ClientSideChat
+
+
+
+
+
+
+
+
+
+
diff --git a/client-side-chat/src/main.ts b/client-side-chat/src/main.ts
new file mode 100644
index 0000000..91ec6da
--- /dev/null
+++ b/client-side-chat/src/main.ts
@@ -0,0 +1,12 @@
+import { enableProdMode } from '@angular/core';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
+import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
+
+platformBrowserDynamic().bootstrapModule(AppModule)
+ .catch(err => console.log(err));
diff --git a/client-side-chat/src/polyfills.ts b/client-side-chat/src/polyfills.ts
new file mode 100644
index 0000000..20d4075
--- /dev/null
+++ b/client-side-chat/src/polyfills.ts
@@ -0,0 +1,76 @@
+/**
+ * This file includes polyfills needed by Angular and is loaded before the app.
+ * You can add your own extra polyfills to this file.
+ *
+ * This file is divided into 2 sections:
+ * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
+ * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
+ * file.
+ *
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
+ *
+ * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
+ */
+
+/***************************************************************************************************
+ * BROWSER POLYFILLS
+ */
+
+/** IE9, IE10 and IE11 requires all of the following polyfills. **/
+// import 'core-js/es6/symbol';
+// import 'core-js/es6/object';
+// import 'core-js/es6/function';
+// import 'core-js/es6/parse-int';
+// import 'core-js/es6/parse-float';
+// import 'core-js/es6/number';
+// import 'core-js/es6/math';
+// import 'core-js/es6/string';
+// import 'core-js/es6/date';
+// import 'core-js/es6/array';
+// import 'core-js/es6/regexp';
+// import 'core-js/es6/map';
+// import 'core-js/es6/weak-map';
+// import 'core-js/es6/set';
+
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
+// import 'classlist.js'; // Run `npm install --save classlist.js`.
+
+/** IE10 and IE11 requires the following for the Reflect API. */
+// import 'core-js/es6/reflect';
+
+
+/** Evergreen browsers require these. **/
+// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
+import 'core-js/es7/reflect';
+
+
+/**
+ * Required to support Web Animations `@angular/platform-browser/animations`.
+ * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
+ **/
+// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
+
+
+
+/***************************************************************************************************
+ * Zone JS is required by Angular itself.
+ */
+import 'zone.js/dist/zone'; // Included with Angular CLI.
+
+
+
+/***************************************************************************************************
+ * APPLICATION IMPORTS
+ */
+
+/**
+ * Date, currency, decimal and percent pipes.
+ * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
+ */
+// import 'intl'; // Run `npm install --save intl`.
+/**
+ * Need to import at least one locale-data with intl.
+ */
+// import 'intl/locale-data/jsonp/en';
diff --git a/client-side-chat/src/styles.css b/client-side-chat/src/styles.css
new file mode 100644
index 0000000..ad5ea64
--- /dev/null
+++ b/client-side-chat/src/styles.css
@@ -0,0 +1,2 @@
+/* You can add global styles to this file, and also import other style files */
+@import "~bootstrap/dist/css/bootstrap.min.css";
diff --git a/client-side-chat/src/test.ts b/client-side-chat/src/test.ts
new file mode 100644
index 0000000..cd612ee
--- /dev/null
+++ b/client-side-chat/src/test.ts
@@ -0,0 +1,32 @@
+// This file is required by karma.conf.js and loads recursively all the .spec and framework files
+
+import 'zone.js/dist/long-stack-trace-zone';
+import 'zone.js/dist/proxy.js';
+import 'zone.js/dist/sync-test';
+import 'zone.js/dist/jasmine-patch';
+import 'zone.js/dist/async-test';
+import 'zone.js/dist/fake-async-test';
+import { getTestBed } from '@angular/core/testing';
+import {
+ BrowserDynamicTestingModule,
+ platformBrowserDynamicTesting
+} from '@angular/platform-browser-dynamic/testing';
+
+// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
+declare const __karma__: any;
+declare const require: any;
+
+// Prevent Karma from running prematurely.
+__karma__.loaded = function () {};
+
+// First, initialize the Angular testing environment.
+getTestBed().initTestEnvironment(
+ BrowserDynamicTestingModule,
+ platformBrowserDynamicTesting()
+);
+// Then we find all the tests.
+const context = require.context('./', true, /\.spec\.ts$/);
+// And load the modules.
+context.keys().map(context);
+// Finally, start Karma to run the tests.
+__karma__.start();
diff --git a/client-side-chat/src/tsconfig.app.json b/client-side-chat/src/tsconfig.app.json
new file mode 100644
index 0000000..39ba8db
--- /dev/null
+++ b/client-side-chat/src/tsconfig.app.json
@@ -0,0 +1,13 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../out-tsc/app",
+ "baseUrl": "./",
+ "module": "es2015",
+ "types": []
+ },
+ "exclude": [
+ "test.ts",
+ "**/*.spec.ts"
+ ]
+}
diff --git a/client-side-chat/src/tsconfig.spec.json b/client-side-chat/src/tsconfig.spec.json
new file mode 100644
index 0000000..63d89ff
--- /dev/null
+++ b/client-side-chat/src/tsconfig.spec.json
@@ -0,0 +1,20 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../out-tsc/spec",
+ "baseUrl": "./",
+ "module": "commonjs",
+ "target": "es5",
+ "types": [
+ "jasmine",
+ "node"
+ ]
+ },
+ "files": [
+ "test.ts"
+ ],
+ "include": [
+ "**/*.spec.ts",
+ "**/*.d.ts"
+ ]
+}
diff --git a/client-side-chat/src/typings.d.ts b/client-side-chat/src/typings.d.ts
new file mode 100644
index 0000000..ef5c7bd
--- /dev/null
+++ b/client-side-chat/src/typings.d.ts
@@ -0,0 +1,5 @@
+/* SystemJS module definition */
+declare var module: NodeModule;
+interface NodeModule {
+ id: string;
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..9d26a07
--- /dev/null
+++ b/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "angular-team-chat-aviv",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/WebCourse3/team-chat-angular-aviv2.git"
+ },
+ "author": "",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/WebCourse3/team-chat-angular-aviv2/issues"
+ },
+ "homepage": "https://github.com/WebCourse3/team-chat-angular-aviv2#readme",
+ "dependencies": {
+ "bootstrap": "^3.3.7",
+ "express": "^4.16.2"
+ }
+}