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
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"mybatis"
]
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

# about houko's PR
[README](https://github.com/houko/FullStackEngineerChallenge)

# Full Stack Developer Challenge
This is an interview challengs. Please feel free to fork. Pull Requests will be ignored.
This is an interview challenges. Please feel free to fork. Pull Requests will be ignored.

## Requirements
Design a web application that allows employees to submit feedback toward each other's performance review.
Expand Down
58 changes: 58 additions & 0 deletions README_PR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# quick start
1. server
- db file: /employee-server/db.sql
- api base url: http://localhost:8090
- swagger api: http://localhost:8090

2. client
- `yarn` or `npm install`
- `yarn dev`
- default url: http://localhost:8080

# quick see
1. [swagger api](https://employee.xiaomo.info/swagger-ui.html#/employ_manager)
2. [admin online](https://houko-employee.netlify.app/)

# language and framework
1. server
- java 11
- mysql 8
- spring boot 2.3.5
- lombok
- swagger UI
- mybatis plus

2. client
- nodejs 12
- typescript 3
- vue 2
- vue-admin-template-ts

# feature
- api(restful)
![](/screenshots/api.jpg)
- user login (mock api)
![](/screenshots/login.jpg)
- user profile (mock api)
![](/screenshots/user_profile.jpg)
- user logout (mock api)
![](/screenshots/logout.jpg)
- employee list
![](/screenshots/employee_list.jpg)
- add employee
![](/screenshots/add_employee.jpg)
![](/screenshots/add_employee_success.jpg)
- edit employee
![](/screenshots/edit_employee.jpg)
- delete employee
![](/screenshots/delete_employee_confirm.jpg)
- comment employee
![](/screenshots/comment_employee.jpg)
- employee comment list
![](/screenshots/edit_employee.jpg)
- export employee excel data
- export employee comment excel data

# need improve
- real user system and auth
- api getway(filter the illegal request)
3 changes: 3 additions & 0 deletions employee-client/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
35 changes: 35 additions & 0 deletions employee-client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# http://editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Indentation override for js(x), ts(x) and vue files
[*.{js,jsx,ts,tsx,vue}]
indent_size = 2
indent_style = space

# Indentation override for css related files
[*.{css,styl,scss,less,sass}]
indent_size = 2
indent_style = space

# Indentation override for html files
[*.html]
indent_size = 2
indent_style = space

# Trailing space override for markdown file
[*.md]
trim_trailing_whitespace = false

# Indentation override for config files
[*.{json,yml}]
indent_size = 2
indent_style = space
2 changes: 2 additions & 0 deletions employee-client/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VUE_APP_BASE_API = 'http://localhost:8090/'
VUE_APP_BASE_API_PROD = 'https://employee.xiaomo.info/'
3 changes: 3 additions & 0 deletions employee-client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/*.js
src/assets
tests/unit/coverage
51 changes: 51 additions & 0 deletions employee-client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/member-delimiter-style': ['error',
{
multiline: {
delimiter: 'none'
},
singleline: {
delimiter: 'comma'
}
}],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-before-function-paren': ['error', 'never'],
'vue/array-bracket-spacing': 'error',
'vue/arrow-spacing': 'error',
'vue/block-spacing': 'error',
'vue/brace-style': 'error',
'vue/camelcase': 'error',
'vue/comma-dangle': 'error',
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'vue/eqeqeq': 'error',
'vue/key-spacing': 'error',
'vue/match-component-file-name': 'error',
'vue/object-curly-spacing': 'error'
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
]
}
]
}
23 changes: 23 additions & 0 deletions employee-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Empty file added employee-client/README.md
Empty file.
5 changes: 5 additions & 0 deletions employee-client/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}
76 changes: 76 additions & 0 deletions employee-client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "employee-manage-system-ts",
"version": "1.0.0",
"private": true,
"author": "xiaomo <xiaomo@xiaomo.info>",
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"svg": "vsvg -s ./src/icons/svg -t ./src/icons/components --ext ts --es6",
"test:unit": "jest --clearCache && vue-cli-service test:unit"
},
"dependencies": {
"@types/clipboard": "^2.0.1",
"@types/file-saver": "^2.0.1",
"@types/lodash": "^4.14.165",
"axios": "^0.21.0",
"clipboard": "^2.0.6",
"element-ui": "^2.14.0",
"file-saver": "^2.0.2",
"js-cookie": "^2.2.1",
"lodash": "^4.17.20",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.0",
"register-service-worker": "^1.7.1",
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.0.2",
"vue-router": "^3.4.8",
"vue-svgicon": "^3.2.9",
"vuex": "^3.5.1",
"vuex-module-decorators": "^1.0.1",
"xlsx": "^0.16.8"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/js-cookie": "^2.2.6",
"@types/node": "^14.14.6",
"@types/nprogress": "^0.2.0",
"@types/webpack-env": "^1.15.3",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"@vue/cli-plugin-babel": "^4.5.8",
"@vue/cli-plugin-eslint": "^4.5.8",
"@vue/cli-plugin-pwa": "^4.5.8",
"@vue/cli-plugin-router": "^4.5.8",
"@vue/cli-plugin-typescript": "^4.5.8",
"@vue/cli-plugin-unit-jest": "^4.5.8",
"@vue/cli-plugin-vuex": "^4.5.8",
"@vue/cli-service": "^4.5.8",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^7.0.0",
"@vue/test-utils": "^1.1.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"eslint": "^7.12.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.2",
"eslint-plugin-vue": "^7.1.0",
"fibers": "^5.0.0",
"jest": "^26.6.3",
"sass": "^1.28.0",
"sass-loader": "^10.0.4",
"style-resources-loader": "^1.3.3",
"ts-jest": "^26.4.3",
"typescript": "^4.0.5",
"vue-cli-plugin-element": "^1.0.1",
"vue-cli-plugin-style-resources-loader": "^0.1.4",
"vue-template-compiler": "^2.6.12",
"webpack": "^5.3.2"
}
}
5 changes: 5 additions & 0 deletions employee-client/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}
Binary file added employee-client/public/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added employee-client/public/img/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added employee-client/public/img/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions employee-client/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
2 changes: 2 additions & 0 deletions employee-client/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
14 changes: 14 additions & 0 deletions employee-client/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<div id="app">
<router-view />
</div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'

@Component({
name: 'App'
})
export default class extends Vue {}
</script>
54 changes: 54 additions & 0 deletions employee-client/src/api/employees.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { IComment, IEmployee } from './types.d'
import request from '@/utils/request'

export const getEmployees = (params: any) =>
request({
url: '/employee/',
method: 'get',
params
})

export const createEmployee = (params: any) =>
request({
url: '/employee/',
method: 'put',
data: params
})

export const updateEmployee = (id:number, params: any) =>
request({
url: `/employee/${id}`,
method: 'post',
data: params
})

export const deleteEmployee = (id: number) =>
request({
url: `/employee/${id}`,
method: 'delete'
})

export const commentEmployee = (id:number, params: any) =>
request({
url: `/employee/comment/${id}`,
method: 'PUT',
data: params
})

export const findEmployeeComments = (id:number) =>
request({
url: `/employee/comment/${id}`,
method: 'GET'
})

export const defaultEmployeeData :IEmployee = {
id: 0,
name: ''
}

export const defaultCommentData:IComment = {
id: 0,
star: 5,
content: '',
commentBy: ''
}
13 changes: 13 additions & 0 deletions employee-client/src/api/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

export interface IComment{
id: number
star: number
content:string
commentBy:string
}

export interface IEmployee {
id: number
name: string
comments?: IComment[]
}
Loading