Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
109 changes: 108 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,111 @@ To give you an idea what we expect from the implementation of the assignment we
* How much effort is taken into making the app look nice.
* Is user experience taken into consideration.
* How was the UI implemented.
* Does the application work on all devices.
* Does the application work on all devices.



## Assignment Documentation by Batu

### Chapter 0
Hello,

Well, for the assignment. I will be guiding you much as possible via documentation and side notes.

I use Angular, RxJS, Material Design. There is not necessity to use them of course, however I want to display
my knowledge related to application since the vacancy is for Angular.

I try to keep things simple much as possible,
initial steps that I took:
- use Angular-ClI to create angular enviroment in a default way possible
- add Material design via Angular-CLI
- add RxJS library
- Generate vehicle component via Angular-CLI

Personally I prefer to strict myself to not use external dependencies, only super popular things that everybody knows
like Angular, React, RxJs, NgRx, Material design.

And whenever I use them, I try to keep them simple possible for anybody who never used any of them should understand
simply by checking the official docs.

I spent 16 hours more and less.

### Getting Started
#####Dependencies:
- Node@12
- Npm

Then simply install dependencies by
```
npm install
```
#####
To serve the application: http://localhost:4200/

```
npm run start
```

#####
To run unit tests

```
npm run test
```

#####
Additionally I make something fun for showcase reason.
This is not for integration test purposes, it is just for magic :)
```
npm run e2e
```

#####


### Details

* app.module is to check all the dependencies or modules we are importing

* normally I would go for layout module for application layout, since this is demo I didn't want to go overkill
Therefore layout is also party happening in vehicle.component

* app.component.ts I am using matIconRegistry to use Sytac's Logo for better UI (that part is totally copy paste from internet)

* I create the service file as a first thing to extract data,
to do that, I create a singleton file as vehicle.service.ts,
create a subject vehicles$, to feed that subject I created a fetchVehicles method to use fetchData from trafficMeister.
So whenever we fetchdata our vehicles$ subject will be emit value

* Since we have the data correspondingly, I start building the layout and vehicle component together. As a design I thought
sidenav would be nice for both desktop and mobile views. And also application is something like media asset management.
So for UX purposes more space for Images would be great.

* As you can see fetchServices && ResetFilter buttons in vehicle.component is to help debug the app, I thought
It also could be helpful for you guys to test and check edge cases too thats why I keep it

* For the view parts, there is nothing super fancy, I follow default way of material-design. For responnsiveness and sizing
I use media decorators with flex-box see -> vehile.component.scss

* I think the most complex part is the pipes within the app, I wanted to use Angular Pipe's for filtering
I find it quite reusable, My personal critism for that part could be more readable perhaps.

* I write unit test after I finish the coding but I am able to go TDD as well.

* For the broken Images, I choose blue-screen for windows for fun :)

* In E2E I actually wanted to write integration tests too however I am really tired to be honest, instead I make a little
showcase demo to make it up :)



### Summary

Well, It was fun a bit stressful for me because of the time. I actually ask 3 weeks but unexpected problems happen
couldn't able to spare time as I've expected.

I like the assignment overall, thanks for review in advance.

Good Luck,
Best,
Batu
132 changes: 132 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"Angular-xecron": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/Angular-xecron",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "Angular-xecron:build"
},
"configurations": {
"production": {
"browserTarget": "Angular-xecron:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "Angular-xecron:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "Angular-xecron:serve"
},
"configurations": {
"production": {
"devServerTarget": "Angular-xecron:serve:production"
}
}
}
}
}
},
"defaultProject": "Angular-xecron"
}
Binary file removed assets/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
32 changes: 32 additions & 0 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
Loading