Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Задание выполнено #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ФИО: Старостенков Андрей Андреевич
E-mail: [email protected]
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# FrontTask

Для имитации взаимодейтсвия с БД (сервером) был использован [JSON Server](https://github.com/typicode/json-server#getting-started)

>Инструкция по запуску приложения
(предварительно установить node.js | Angular CLI)
1) В корне проекта запутить терминал и выполнить следующие команды:
```
npm install
npm install -g json-server
json-server --watch db.json --routes routes.json
```
2) Открыть ещё один терминал в корне проекта и выполнить команду:
```
ng serve --open
```


>В корне проекта лежит файл <b>db.json</b> - он и будет условной БД.

>Наша БД будет доступна по ссылке http://localhost:3000/

##СКРИНЫ
![img](./pic1.png)
![img](./pic2.png)

# Angular Test Task

## Порядок выполнения
Expand Down
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": {
"front-task": {
"projectType": "application",
"schematics": {
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:component": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:interceptor": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:resolver": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/front-task",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/custom-theme.scss",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "front-task:build:production"
},
"development": {
"browserTarget": "front-task:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "front-task: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": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"defaultProject": "front-task"
}
112 changes: 112 additions & 0 deletions db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"theses": [
{
"id": 1,
"mainAuthor": {
"firstName": "Hue",
"lastName": "Jackman",
"middleName": "Wong",
"workplace": "string"
},
"contactEmail": "[email protected]",
"otherAuthors": [
{
"firstName": "string",
"lastName": "string",
"middleName": "string",
"workplace": "string"
}
],
"topic": "string",
"content": "string",
"created": "2022-02-08T09:35:50.2249116Z",
"updated": "2022-02-14T19:21:12.0075602Z"
},
{
"id": 2,
"mainAuthor": {
"firstName": "Сидор",
"lastName": "Сидоров",
"middleName": "Сидорович",
"workplace": "Организация 3"
},
"contactEmail": "[email protected]",
"otherAuthors": [],
"topic": "Тезис 3",
"content": "Бла-бла-бла",
"created": "2022-02-08T09:36:01.5817133Z",
"updated": "2022-02-08T09:36:01.5820846Z"
},
{
"id": 3,
"mainAuthor": {
"firstName": "Петр",
"lastName": "Петров",
"middleName": "Петрович",
"workplace": "Организация 2"
},
"contactEmail": "[email protected]",
"otherAuthors": [],
"topic": "Тезис 2",
"content": "Бла-бла-бла",
"created": "2022-02-08T09:36:06.1213099Z",
"updated": "2022-02-08T09:36:06.1213357Z"
},
{
"id": 4,
"mainAuthor": {
"firstName": "Иван",
"lastName": "Иванов",
"middleName": "Иванович",
"workplace": "Организация 1"
},
"contactEmail": "[email protected]",
"otherAuthors": [],
"topic": "Тезис 1",
"content": "Бла-бла-бла",
"created": "2022-02-08T09:36:11.1514756Z",
"updated": "2022-02-08T09:36:11.1515041Z"
},
{
"id": 5,
"mainAuthor": {
"firstName": "string",
"lastName": "string",
"middleName": "string",
"workplace": "string"
},
"contactEmail": "[email protected]",
"otherAuthors": [
{
"firstName": "string",
"lastName": "string",
"middleName": "string",
"workplace": "string"
}
],
"topic": "string",
"content": "string",
"created": "2022-02-14T19:19:10.3026299Z",
"updated": "2022-02-14T19:19:10.30269Z"
},
{
"mainAuthor": {
"lastName": "Пронин",
"firstName": "Виталий",
"middleName": "Александрович",
"workPlace": "WorkPLACEEEEEE"
},
"contactEmail": "[email protected]",
"otherAuthors": [
{
"lastName": "Ivanov",
"firstName": "Alex",
"middleName": "Sergeevich"
}
],
"topic": "While all in house",
"content": "intresting TV",
"id": 6
}
]
}
44 changes: 44 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/front-task'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
Loading