Skip to content

Commit

Permalink
Merge branch 'release/v1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Jan 30, 2020
2 parents 8afa70c + cedb174 commit 31712ee
Show file tree
Hide file tree
Showing 37 changed files with 1,254 additions and 77 deletions.
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
# 1.0.0 (2020-01-30)


### Bug Fixes

* **$Exercise:** correct exercise URL ([d10f297](https://github.com/johnnymillergh/exrx-net-crawler/commit/d10f2978ac42d643402b6d341e97326d65bd63e2))


### Build System

* **$exrx-net-crawler:** initial project ([8afa70c](https://github.com/johnnymillergh/exrx-net-crawler/commit/8afa70c3c033978699f412f48288becd0df427c7))


### Features

* **$Axios:** support multipart file upload ([1475feb](https://github.com/johnnymillergh/exrx-net-crawler/commit/1475feb16a438d1e2f1b54ab8c147315b3f6d69a))
* **$Exercise:** add exercise component ([0d8bfbe](https://github.com/johnnymillergh/exrx-net-crawler/commit/0d8bfbea39638ee65962e60d215d8042ddafc130))
* **$Exercise:** parse exercise's classification ([ce80fa9](https://github.com/johnnymillergh/exrx-net-crawler/commit/ce80fa92054caa5db47e25a66db4ddf76a63c7e4))
* **$Exercise:** parse exercise's related muscles ([995674e](https://github.com/johnnymillergh/exrx-net-crawler/commit/995674e39d0750500aa47826f143ca9cecbf9717))
* **$Exercise:** parse specific exercise ([6178b2a](https://github.com/johnnymillergh/exrx-net-crawler/commit/6178b2a0469b5d48960fe8a8ace939ba58a73cc4))
* **$Exercise, BodyPart:** parse exercise link which is sorted by body part ([65c5b3f](https://github.com/johnnymillergh/exrx-net-crawler/commit/65c5b3f0d1da5e81779e28ccbf24db3033c18eab))
* **$ExerciseClassification:** save exercise classification ([3bfee01](https://github.com/johnnymillergh/exrx-net-crawler/commit/3bfee0149c8e7c5cf93bbe287ab0475c128ad332))
* **$HelloWorld:** add social image ([5a8e7fa](https://github.com/johnnymillergh/exrx-net-crawler/commit/5a8e7facadd39c74258842b970858c81079213e9))
* **$Muscle:** get muscle data ([e73b7ac](https://github.com/johnnymillergh/exrx-net-crawler/commit/e73b7ac0ffcf14d2085f26a2c94252882336f5b4))
* **$Muscle:** parse muscle's link ([0db4f7f](https://github.com/johnnymillergh/exrx-net-crawler/commit/0db4f7f97fcf46be3cce85d605f9ebef985de0ba))
* **$Muscle:** restore muscle path to URL ([fcc4e60](https://github.com/johnnymillergh/exrx-net-crawler/commit/fcc4e60dc29e375cb0ff84851b4939b0f43ea690))
* **$Muscle:** save muscle info ([3b21aa5](https://github.com/johnnymillergh/exrx-net-crawler/commit/3b21aa5b79c840042d645e4653cc63659b7f401e))
* **$Muscle:** send request to update muscle details ([2c2f8a7](https://github.com/johnnymillergh/exrx-net-crawler/commit/2c2f8a7f6cf85e54f3472ea7a4eaa7c5a118270e))
* **$UI:** enhance UI - use MD style ([04516a4](https://github.com/johnnymillergh/exrx-net-crawler/commit/04516a4456fa2abe7c49fe2ec3c8bf46a90426cd))


### Performance Improvements

* **$Axios:** cancel timeout for inter communication ([662e6ac](https://github.com/johnnymillergh/exrx-net-crawler/commit/662e6ac58e9cd52eef3bcf0a4a95d2d2dce74208))
* **$Axios:** refine function `restorePathToUrl` ([4f4b68d](https://github.com/johnnymillergh/exrx-net-crawler/commit/4f4b68d776793eada628430dd2debe3eab633c3a))
* **$Axios:** support uploading multiple files ([83edc68](https://github.com/johnnymillergh/exrx-net-crawler/commit/83edc68e8cd9cc285ef270a6e0175a40ea42c0a8))
* **$Axios, FileUpload:** enhance Axios `GET` request ([bb46329](https://github.com/johnnymillergh/exrx-net-crawler/commit/bb463294cad23ac9b344010bd3ee81fdf66558be))
* **$Exercise:** prevent from generating empty exercise's classification list ([290579e](https://github.com/johnnymillergh/exrx-net-crawler/commit/290579e4e9791c7ccf5d01c229fb395ee6891c80))
* **$Exercise:** refine parsing exercise classification ([2809347](https://github.com/johnnymillergh/exrx-net-crawler/commit/28093470204a85836779bbb861594f197dd45ce6))
* **$Exercise:** refine regular expression of parsing exercise classification ([e473d31](https://github.com/johnnymillergh/exrx-net-crawler/commit/e473d31dea8893ac92fb821da082fd74d6638d45))
* **$exrx-net-crawler:** devide codes into components ([fbdd899](https://github.com/johnnymillergh/exrx-net-crawler/commit/fbdd899f7ed6787f2fec47891b03c4cfc96d4977))
* **$RegExp:** refine regular expression ([cd1d0e1](https://github.com/johnnymillergh/exrx-net-crawler/commit/cd1d0e1a91eadabce93a815ce5c5fd85599c489a))


### BREAKING CHANGES

* **$exrx-net-crawler:** abstract components
* **$Axios, FileUpload:** Support respond ArrayBuffer (byte array) as HTTP
response.
* **$exrx-net-crawler:** implemented infra web scraping



# [1.4.0](https://github.com/johnnymillergh/vuetify-typescript-playground/compare/v1.3.1...v1.4.0) (2020-01-07)


Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
![ExRx Net Crawler Feature Graphics](https://raw.githubusercontent.com/johnnymillergh/MaterialLibrary/master/exrx-net-crawler/exrx-net-crawler-social-image.png)

[![GitHub release](https://img.shields.io/github/release/johnnymillergh/vuetify-typescript-playground.svg)](https://github.com/johnnymillergh/vuetify-typescript-playground/releases)
[![Build Status](https://travis-ci.com/johnnymillergh/vuetify-typescript-playground.svg?branch=master)](https://travis-ci.com/johnnymillergh/typescript-playground)
[![GitHub issues](https://img.shields.io/github/issues/johnnymillergh/vuetify-typescript-playground)](https://github.com/johnnymillergh/vuetify-typescript-playground/issues)
[![GitHub forks](https://img.shields.io/github/forks/johnnymillergh/vuetiify-typescript-playground)](https://github.com/johnnymillergh/vuetify-typescript-playground/network)
[![GitHub stars](https://img.shields.io/github/stars/johnnymillergh/vuetiify-typescript-playground)](https://github.com/johnnymillergh/vuetify-typescript-playground/stargazers)
[![GitHub license](https://img.shields.io/github/license/johnnymillergh/vuetiify-typescript-playground)](https://github.com/johnnymillergh/vuetify-typescript-playground/blob/master/LICENSE)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/johnnymillergh/vuetiify-typescript-playground?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fjohnnymillergh%2Fvuetify-typescript-playground)
[![GitHub release](https://img.shields.io/github/release/johnnymillergh/exrx-net-crawler.svg)](https://github.com/johnnymillergh/exrx-net-crawler/releases)
[![Build Status](https://travis-ci.com/johnnymillergh/exrx-net-crawler.svg?branch=master)](https://travis-ci.com/johnnymillergh/typescript-playground)
[![GitHub issues](https://img.shields.io/github/issues/johnnymillergh/exrx-net-crawler)](https://github.com/johnnymillergh/exrx-net-crawler/issues)
[![GitHub forks](https://img.shields.io/github/forks/johnnymillergh/exrx-net-crawler)](https://github.com/johnnymillergh/exrx-net-crawler/network)
[![GitHub stars](https://img.shields.io/github/stars/johnnymillergh/exrx-net-crawler)](https://github.com/johnnymillergh/exrx-net-crawler/stargazers)
[![GitHub license](https://img.shields.io/github/license/johnnymillergh/exrx-net-crawler)](https://github.com/johnnymillergh/exrx-net-crawler/blob/master/LICENSE)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/johnnymillergh/exrx-net-crawler?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fjohnnymillergh%2Fexrx-net-crawler)

# ExRx.net Crawler

**ExRx.net Crawler** is a Vuetify tutorial project based on TypeScript.
**ExRx.net Crawler** ExRx.net Crawler is a Vue based crawling project for ExRx.net.

[Official Docker Image](https://hub.docker.com/r/ijohnnymiller/vuetify-typescript-playground-prod)
[Official Docker Image](https://hub.docker.com/r/ijohnnymiller/exrx-net-crawler-prod)

## Features

Expand All @@ -30,6 +30,12 @@ Here is the highlights of **ExRx.net Crawler**:
10. Lazy router.
11. Beatified noscript content.

## Roadmap

- [ ] Correct parsing stretch exercises. Such as: [Neck Retraction Stretch](https://exrx.net/Stretches/Sternocleidomastoid/NeckRetraction), [Neck Rotation Stretch](https://exrx.net/Stretches/Sternocleidomastoid/NeckRotation), etc.
- [ ] Support inputting or specifying exercise section to parse.
- [ ] Concurrency requesting and parsing DOMs.

## Usage

### Project Setup
Expand Down Expand Up @@ -108,7 +114,7 @@ Docker deployment can defer by environment. Here is the list of environments:

## Contributing

Feel free to dive in! [Open an issue](https://github.com/johnnymillergh/typescript-playground/issues/new).
Feel free to dive in! [Open an issue](https://github.com/johnnymillergh/exrx-net-crawler/issues/new).

### Contributors

Expand All @@ -120,11 +126,11 @@ This project exists thanks to all the people who contribute.

### Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](Become a sponsor)]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://github.com/johnnymillergh)]

## License

[Apache License](https://github.com/johnnymillergh/typescript-playground/blob/master/LICENSE) © Johnny Miller
[Apache License](https://github.com/johnnymillergh/exrx-net-crawler/blob/master/LICENSE) © Johnny Miller

2020 - Present

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exrx-net-crawler",
"version": "1.0.0-beta",
"version": "1.0.0",
"license": "Apache-2.0",
"description": "The Crawler for ExRx.net",
"author": {
Expand Down
14 changes: 14 additions & 0 deletions proxy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,19 @@ module.exports = {
pathRewrite: {
'^/body-part': `/${process.env.VUE_APP_BASE_API}/body-part`
}
},
'/muscle': {
target: `${process.env.VUE_APP_BASE_URL}`,
changeOrigin: true,
pathRewrite: {
'^/muscle': `/${process.env.VUE_APP_BASE_API}/muscle`
}
},
'/exercise': {
target: `${process.env.VUE_APP_BASE_URL}`,
changeOrigin: true,
pathRewrite: {
'^/exercise': `/${process.env.VUE_APP_BASE_API}/exercise`
}
}
}
Binary file added src/assets/exrx-net-crawler-social-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
<v-layout text-center wrap>
<v-flex xs12>
<!--suppress HtmlUnknownTarget -->
<v-img :src="require('@/assets/logo.svg')" class="my-3" contain height="200"/>
<v-img :src="require('@/assets/exrx-net-crawler-social-image.png')" class="my-3" contain height="400"/>
</v-flex>
<v-flex mb-4>
<h1 class="display-2 font-weight-bold mb-3">Welcome to Exrx Net Crawler</h1>
<p>Version: {{ version }}</p>
<p>Environment: {{ environment }}</p>
</v-flex>
</v-layout>
<v-divider style="margin-bottom: 24px"/>
<v-row>
<v-btn v-debounced-click="handelClickTest" block color="primary">Test Back-end Service</v-btn>
</v-row>
Expand All @@ -26,8 +27,8 @@
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { AppUtil } from '@/utils/app-util'
import { GetByIdPayload } from '@/requests/test-table/payload/get-by-id-payload'
import { testTableApi } from '@/requests/test-table/test-table-api'
import { GetByIdPayload } from '@/domain/test-table/get-by-id-payload'
import { testTableApi } from '@/requests/test-table-api'

@Component
export default class HelloWorld extends Vue {
Expand All @@ -38,7 +39,7 @@ export default class HelloWorld extends Vue {

async mounted () {
this.version = AppUtil.getVersionInfo()
this.environment = `Environment: ${process.env.NODE_ENV} (${process.env.VUE_APP_ENV})`
this.environment = `${process.env.NODE_ENV} (${process.env.VUE_APP_ENV})`
}

async handelClickTest (): Promise<void> {
Expand Down
78 changes: 78 additions & 0 deletions src/constants/exercise-related-classification-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* Enum
* @author Johnny Miller (鍾俊), e-mail: johnnysviva@outlook.com
* @date 1/26/20 3:17 PM
*/
export class Enum {
private readonly _description: string
private readonly _value: number

constructor (description: string, value: number) {
this._description = description
this._value = value
}

get description (): string {
return this._description
}

get value (): number {
return this._value
}
}

export const ExerciseRelatedClassificationType = {
/**
* Utility
*/
UTILITY: new Enum('Utility', 1),
/**
* Mechanics
*/
MECHANICS: new Enum('Mechanics', 2),
/**
* Force
*/
FORCE: new Enum('Force', 3),

/**
* Get array of Exercise Related Classification Type.
* @return {Array} an array of Exercise Related Classification Type.
*/
getArray: () => {
const array = [] as Enum[]
Object.keys(ExerciseRelatedClassificationType).forEach(enumKey => {
// @ts-ignore
if (ExerciseRelatedClassificationType[enumKey] instanceof Enum) {
// @ts-ignore
array.push(ExerciseRelatedClassificationType[enumKey])
}
})
return array
},

/**
* Get status by value.
* @param value {number} value
* @throws Enum
*/
getEnumByValue (value?: number): Enum {
if (!value) {
throw new Error(`Invalid code: ${value}.`)
}
let enumeration: Enum = new Enum('', -1)
Object.keys(ExerciseRelatedClassificationType).forEach(statusKey => {
// @ts-ignore
if (typeof ExerciseRelatedClassificationType[statusKey] !== 'function' && ExerciseRelatedClassificationType[statusKey].code === code) {
// @ts-ignore
enumeration = ExerciseRelatedClassificationType[statusKey]
}
})
if (enumeration.value === -1) {
throw new Error(`Enum not found! Given code: ${value}.`)
}
return enumeration
}
}

Object.freeze(ExerciseRelatedClassificationType)
104 changes: 104 additions & 0 deletions src/constants/exercise-related-muslce-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* Enum
* @author Johnny Miller (鍾俊), e-mail: johnnysviva@outlook.com
* @date 1/26/20 3:17 PM
*/
export class Enum {
private readonly _description: string
private readonly _value: number

constructor (description: string, value: number) {
this._description = description
this._value = value
}

get description (): string {
return this._description
}

get value (): number {
return this._value
}
}

// AGONIST("Agonist - a muscle that causes motion.", 1),
// ANTAGONIST("Antagonist - a muscle that can move the joint opposite to the movement produced by the agonist.", 2),
// TARGET("Target - the primary muscle intended for exercise.", 3),
// SYNERGIST("Synergist - a muscle that assists another muscle to accomplish a movement.", 4),
// STABILIZER("Stabilizer - a muscle that contracts with no significant movement to maintain a posture or fixate a " +
// "joint.", 5),
// DYNAMIC_STABILIZER("Dynamic Stabilizer - also known as Fixator, occurs during many compound movements.", 6),
// ANTAGONIST_STABILIZER("Antagonist Stabilizer - a muscle that contracts to maintain the tension potential of a " +
// "biarticulate muscle at the adjacent joint.", 7);

export const ExerciseRelatedMuscleType = {
/**
* Agonist - a muscle that causes motion.
*/
AGONIST: new Enum('Agonist', 1),
/**
* Antagonist - a muscle that can move the joint opposite to the movement produced by the agonist.
*/
ANTAGONIST: new Enum('Antagonist', 2),
/**
* Target - the primary muscle intended for exercise.
*/
TARGET: new Enum('Target', 3),
/**
* Synergist - a muscle that assists another muscle to accomplish a movement.
*/
SYNERGIST: new Enum('Synergist', 4),
/**
* Stabilizer - a muscle that contracts with no significant movement to maintain a posture or fixate a joint.
*/
STABILIZER: new Enum('Stabilizer', 5),
/**
* Dynamic Stabilizer - also known as Fixator, occurs during many compound movements.
*/
DYNAMIC_STABILIZER: new Enum('Dynamic Stabilizer', 6),
/**
* Antagonist Stabilizer - a muscle that contracts to maintain the tension potential of a biarticulate muscle at the adjacent joint.
*/
ANTAGONIST_STABILIZER: new Enum('Antagonist Stabilizer', 7),

/**
* Get array of Exercise Related Muscle Type.
* @return {Array} an array of Exercise Related Muscle Type.
*/
getArray: () => {
const array = [] as Enum[]
Object.keys(ExerciseRelatedMuscleType).forEach(enumKey => {
// @ts-ignore
if (ExerciseRelatedMuscleType[enumKey] instanceof Enum) {
// @ts-ignore
array.push(ExerciseRelatedMuscleType[enumKey])
}
})
return array
},

/**
* Get status by value.
* @param value {number} value
* @throws Enum
*/
getEnumByValue (value?: number): Enum {
if (!value) {
throw new Error(`Invalid code: ${value}.`)
}
let enumeration: Enum = new Enum('', -1)
Object.keys(ExerciseRelatedMuscleType).forEach(statusKey => {
// @ts-ignore
if (typeof ExerciseRelatedMuscleType[statusKey] !== 'function' && ExerciseRelatedMuscleType[statusKey].code === code) {
// @ts-ignore
enumeration = ExerciseRelatedMuscleType[statusKey]
}
})
if (enumeration.value === -1) {
throw new Error(`Enum not found! Given code: ${value}.`)
}
return enumeration
}
}

Object.freeze(ExerciseRelatedMuscleType)
4 changes: 4 additions & 0 deletions src/domain/body-part/exercise-link-sorted-by-body-part.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export class ExerciseLinkSortedByBodyPart {
bodyPartName?: string
link!: string
}
9 changes: 9 additions & 0 deletions src/domain/exercise/exercise-classification-payload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IsNotEmpty } from 'class-validator'

export class ExerciseClassificationPayload {
@IsNotEmpty()
name!: string

@IsNotEmpty()
description!: string
}
5 changes: 5 additions & 0 deletions src/domain/exercise/exercise-link-sorted-by-muscle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export class ExerciseLinkSortedByMuscle {
exerciseName!: string
link!: string
equipmentName?: string
}
Loading

0 comments on commit 31712ee

Please sign in to comment.