API & Client: refactor (rename mpwo to fittrackee)
@ -28,7 +28,7 @@ before_install:
|
|||||||
- sudo mv docker-compose /usr/local/bin
|
- sudo mv docker-compose /usr/local/bin
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- export DATABASE_TEST_URL=postgres://postgres:@localhost:5432/mpwo_test
|
- export DATABASE_TEST_URL=postgres://postgres:@localhost:5432/fittrackee_test
|
||||||
- export APP_SETTINGS=fittrackee_api.config.TestingConfig
|
- export APP_SETTINGS=fittrackee_api.config.TestingConfig
|
||||||
- export REACT_APP_API_URL=http://127.0.0.1
|
- export REACT_APP_API_URL=http://127.0.0.1
|
||||||
- export NODE_ENV=development
|
- export NODE_ENV=development
|
||||||
|
@ -22,5 +22,5 @@ PYTEST = $(VENV)/bin/py.test
|
|||||||
COV = $(VENV)/bin/python-codacy-coverage
|
COV = $(VENV)/bin/python-codacy-coverage
|
||||||
|
|
||||||
# Node env
|
# Node env
|
||||||
NODE_MODULES = $(PWD)/mpwo_client/node_modules
|
NODE_MODULES = $(PWD)/fittrackee_client/node_modules
|
||||||
NPM ?= yarn --modules-folder mpwo_client/node_modules/
|
NPM ?= yarn --modules-folder fittrackee_client/node_modules/
|
||||||
|
@ -2,8 +2,8 @@ version: '3.3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
mpwo-db:
|
fittrackee-db:
|
||||||
container_name: mpwo-db
|
container_name: fittrackee-db
|
||||||
build: https://github.com/SamR1/mpwo.git#master:fittrackee_api/db
|
build: https://github.com/SamR1/mpwo.git#master:fittrackee_api/db
|
||||||
ports:
|
ports:
|
||||||
- 5435:5432
|
- 5435:5432
|
||||||
@ -11,36 +11,36 @@ services:
|
|||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
|
|
||||||
mpwo-api:
|
fittrackee-api:
|
||||||
container_name: mpwo-api
|
container_name: fittrackee-api
|
||||||
build: https://github.com/SamR1/mpwo.git#master:fittrackee_api
|
build: https://github.com/SamR1/mpwo.git#master:fittrackee_api
|
||||||
ports:
|
ports:
|
||||||
- 5001:5000
|
- 5001:5000
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo
|
- DATABASE_URL=postgres://postgres:postgres@fittrackee-db:5432/fittrackee
|
||||||
- DATABASE_TEST_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo_test
|
- DATABASE_TEST_URL=postgres://postgres:postgres@fittrackee-db:5432/fittrackee_test
|
||||||
- FLASK_APP=server.py
|
- FLASK_APP=server.py
|
||||||
- FLASK_DEBUG=1
|
- FLASK_DEBUG=1
|
||||||
- APP_SETTINGS=fittrackee_api.config.TestingConfig
|
- APP_SETTINGS=fittrackee_api.config.TestingConfig
|
||||||
depends_on:
|
depends_on:
|
||||||
- mpwo-db
|
- fittrackee-db
|
||||||
links:
|
links:
|
||||||
- mpwo-db
|
- fittrackee-db
|
||||||
|
|
||||||
mpwo-client:
|
fittrackee-client:
|
||||||
container_name: mpwo-client
|
container_name: fittrackee-client
|
||||||
build:
|
build:
|
||||||
context: https://github.com/SamR1/mpwo.git
|
context: https://github.com/SamR1/mpwo.git
|
||||||
dockerfile: ./mpwo_client/Dockerfile
|
dockerfile: ./fittrackee_client/Dockerfile
|
||||||
args:
|
args:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
- REACT_APP_API_URL=${REACT_APP_API_URL}
|
- REACT_APP_API_URL=${REACT_APP_API_URL}
|
||||||
ports:
|
ports:
|
||||||
- 3007:3000
|
- 3007:3000
|
||||||
depends_on:
|
depends_on:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
links:
|
links:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
@ -49,7 +49,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
depends_on:
|
depends_on:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
- mpwo-client
|
- fittrackee-client
|
||||||
links:
|
links:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
|
@ -2,8 +2,8 @@ version: '3.3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
mpwo-db:
|
fittrackee-db:
|
||||||
container_name: mpwo-db
|
container_name: fittrackee-db
|
||||||
build: ./fittrackee_api/db
|
build: ./fittrackee_api/db
|
||||||
ports:
|
ports:
|
||||||
- 5435:5432
|
- 5435:5432
|
||||||
@ -11,36 +11,36 @@ services:
|
|||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
|
|
||||||
mpwo-api:
|
fittrackee-api:
|
||||||
container_name: mpwo-api
|
container_name: fittrackee-api
|
||||||
build: ./fittrackee_api
|
build: ./fittrackee_api
|
||||||
ports:
|
ports:
|
||||||
- 5001:5000
|
- 5001:5000
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo
|
- DATABASE_URL=postgres://postgres:postgres@fittrackee-db:5432/fittrackee
|
||||||
- DATABASE_TEST_URL=postgres://postgres:postgres@mpwo-db:5432/mpwo_test
|
- DATABASE_TEST_URL=postgres://postgres:postgres@fittrackee-db:5432/fittrackee_test
|
||||||
- FLASK_APP=server.py
|
- FLASK_APP=server.py
|
||||||
- FLASK_DEBUG=1
|
- FLASK_DEBUG=1
|
||||||
- APP_SETTINGS=fittrackee_api.config.DevelopmentConfig
|
- APP_SETTINGS=fittrackee_api.config.DevelopmentConfig
|
||||||
depends_on:
|
depends_on:
|
||||||
- mpwo-db
|
- fittrackee-db
|
||||||
links:
|
links:
|
||||||
- mpwo-db
|
- fittrackee-db
|
||||||
|
|
||||||
mpwo-client:
|
fittrackee-client:
|
||||||
container_name: mpwo-client
|
container_name: fittrackee-client
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: ./mpwo_client/Dockerfile
|
dockerfile: ./fittrackee_client/Dockerfile
|
||||||
args:
|
args:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
- REACT_APP_API_URL=${REACT_APP_API_URL}
|
- REACT_APP_API_URL=${REACT_APP_API_URL}
|
||||||
ports:
|
ports:
|
||||||
- 3007:3000
|
- 3007:3000
|
||||||
depends_on:
|
depends_on:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
links:
|
links:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
@ -49,7 +49,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
depends_on:
|
depends_on:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
- mpwo-client
|
- fittrackee-client
|
||||||
links:
|
links:
|
||||||
- mpwo-api
|
- fittrackee-api
|
||||||
|
4
fittrackee_client/package.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "fittrackee_client",
|
||||||
|
"version": "0.1.0"
|
||||||
|
}
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
@ -27,7 +27,7 @@
|
|||||||
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
|
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
|
||||||
crossorigin=""
|
crossorigin=""
|
||||||
>
|
>
|
||||||
<title>mpwo</title>
|
<title>FitTrackee</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
@ -1,7 +1,7 @@
|
|||||||
import { parse } from 'date-fns'
|
import { parse } from 'date-fns'
|
||||||
|
|
||||||
import mpwoGenericApi from '../mwpoApi'
|
import FitTrackeeGenericApi from '../fitTrackeeApi'
|
||||||
import mpwoApi from '../mwpoApi/activities'
|
import FitTrackeeApi from '../fitTrackeeApi/activities'
|
||||||
import { history } from '../index'
|
import { history } from '../index'
|
||||||
import { formatChartData } from '../utils'
|
import { formatChartData } from '../utils'
|
||||||
import { setError, setLoading } from './index'
|
import { setError, setLoading } from './index'
|
||||||
@ -27,7 +27,7 @@ export const setChartData = chartData => ({
|
|||||||
chartData,
|
chartData,
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addActivity = form => dispatch => mpwoApi
|
export const addActivity = form => dispatch => FitTrackeeApi
|
||||||
.addActivity(form)
|
.addActivity(form)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'created') {
|
if (ret.status === 'created') {
|
||||||
@ -48,7 +48,7 @@ export const addActivity = form => dispatch => mpwoApi
|
|||||||
.catch(error => dispatch(setError(`activities: ${error}`)))
|
.catch(error => dispatch(setError(`activities: ${error}`)))
|
||||||
|
|
||||||
|
|
||||||
export const addActivityWithoutGpx = form => dispatch => mpwoApi
|
export const addActivityWithoutGpx = form => dispatch => FitTrackeeApi
|
||||||
.addActivityWithoutGpx(form)
|
.addActivityWithoutGpx(form)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'created') {
|
if (ret.status === 'created') {
|
||||||
@ -63,7 +63,7 @@ export const addActivityWithoutGpx = form => dispatch => mpwoApi
|
|||||||
|
|
||||||
export const getActivityGpx = activityId => dispatch => {
|
export const getActivityGpx = activityId => dispatch => {
|
||||||
if (activityId) {
|
if (activityId) {
|
||||||
return mpwoApi
|
return FitTrackeeApi
|
||||||
.getActivityGpx(activityId)
|
.getActivityGpx(activityId)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -80,7 +80,7 @@ export const getActivityGpx = activityId => dispatch => {
|
|||||||
|
|
||||||
export const getActivityChartData = activityId => dispatch => {
|
export const getActivityChartData = activityId => dispatch => {
|
||||||
if (activityId) {
|
if (activityId) {
|
||||||
return mpwoApi
|
return FitTrackeeApi
|
||||||
.getActivityChartData(activityId)
|
.getActivityChartData(activityId)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -95,7 +95,7 @@ export const getActivityChartData = activityId => dispatch => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const deleteActivity = id => dispatch => mpwoGenericApi
|
export const deleteActivity = id => dispatch => FitTrackeeGenericApi
|
||||||
.deleteData('activities', id)
|
.deleteData('activities', id)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 204) {
|
if (ret.status === 204) {
|
||||||
@ -108,7 +108,7 @@ export const deleteActivity = id => dispatch => mpwoGenericApi
|
|||||||
.catch(error => dispatch(setError(`activities: ${error}`)))
|
.catch(error => dispatch(setError(`activities: ${error}`)))
|
||||||
|
|
||||||
|
|
||||||
export const editActivity = form => dispatch => mpwoGenericApi
|
export const editActivity = form => dispatch => FitTrackeeGenericApi
|
||||||
.updateData('activities', form)
|
.updateData('activities', form)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -122,7 +122,7 @@ export const editActivity = form => dispatch => mpwoGenericApi
|
|||||||
.catch(error => dispatch(setError(`activities: ${error}`)))
|
.catch(error => dispatch(setError(`activities: ${error}`)))
|
||||||
|
|
||||||
|
|
||||||
export const getMoreActivities = page => dispatch => mpwoGenericApi
|
export const getMoreActivities = page => dispatch => FitTrackeeGenericApi
|
||||||
.getData('activities', { page })
|
.getData('activities', { page })
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -135,7 +135,8 @@ export const getMoreActivities = page => dispatch => mpwoGenericApi
|
|||||||
})
|
})
|
||||||
.catch(error => dispatch(setError(`activities: ${error}`)))
|
.catch(error => dispatch(setError(`activities: ${error}`)))
|
||||||
|
|
||||||
export const getMonthActivities = (start, end) => dispatch => mpwoGenericApi
|
export const getMonthActivities = (start, end) => dispatch =>
|
||||||
|
FitTrackeeGenericApi
|
||||||
.getData('activities', { start, end, order: 'asc', per_page: 100 })
|
.getData('activities', { start, end, order: 'asc', per_page: 100 })
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
@ -1,4 +1,4 @@
|
|||||||
import mpwoApi from '../mwpoApi/index'
|
import FitTrackeeApi from '../fitTrackeeApi/index'
|
||||||
import { history } from '../index'
|
import { history } from '../index'
|
||||||
|
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ export const getData = (target, data) => dispatch => {
|
|||||||
if (data && data.id && isNaN(data.id)) {
|
if (data && data.id && isNaN(data.id)) {
|
||||||
return dispatch(setError(target, `${target}: Incorrect id`))
|
return dispatch(setError(target, `${target}: Incorrect id`))
|
||||||
}
|
}
|
||||||
return mpwoApi
|
return FitTrackeeApi
|
||||||
.getData(target, data)
|
.getData(target, data)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -33,7 +33,7 @@ export const getData = (target, data) => dispatch => {
|
|||||||
.catch(error => dispatch(setError(`${target}: ${error}`)))
|
.catch(error => dispatch(setError(`${target}: ${error}`)))
|
||||||
}
|
}
|
||||||
|
|
||||||
export const addData = (target, data) => dispatch => mpwoApi
|
export const addData = (target, data) => dispatch => FitTrackeeApi
|
||||||
.addData(target, data)
|
.addData(target, data)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'created') {
|
if (ret.status === 'created') {
|
||||||
@ -48,7 +48,7 @@ export const updateData = (target, data) => dispatch => {
|
|||||||
if (isNaN(data.id)) {
|
if (isNaN(data.id)) {
|
||||||
return dispatch(setError(target, `${target}: Incorrect id`))
|
return dispatch(setError(target, `${target}: Incorrect id`))
|
||||||
}
|
}
|
||||||
return mpwoApi
|
return FitTrackeeApi
|
||||||
.updateData(target, data)
|
.updateData(target, data)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -64,7 +64,7 @@ export const deleteData = (target, id) => dispatch => {
|
|||||||
if (isNaN(id)) {
|
if (isNaN(id)) {
|
||||||
return dispatch(setError(target, `${target}: Incorrect id`))
|
return dispatch(setError(target, `${target}: Incorrect id`))
|
||||||
}
|
}
|
||||||
return mpwoApi
|
return FitTrackeeApi
|
||||||
.deleteData(target, id)
|
.deleteData(target, id)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 204) {
|
if (ret.status === 204) {
|
@ -1,7 +1,7 @@
|
|||||||
import mpwoApi from '../mwpoApi/stats'
|
import FitTrackeeApi from '../fitTrackeeApi/stats'
|
||||||
import { setData, setError } from './index'
|
import { setData, setError } from './index'
|
||||||
|
|
||||||
export const getStats = (userId, type, data) => dispatch => mpwoApi
|
export const getStats = (userId, type, data) => dispatch => FitTrackeeApi
|
||||||
.getStats(userId, type, data)
|
.getStats(userId, type, data)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
@ -1,4 +1,4 @@
|
|||||||
import mpwoApiUser from '../mwpoApi/user'
|
import FitTrackeeApi from '../fitTrackeeApi/user'
|
||||||
import { history } from '../index'
|
import { history } from '../index'
|
||||||
import { generateIds } from '../utils'
|
import { generateIds } from '../utils'
|
||||||
import { getData } from './index'
|
import { getData } from './index'
|
||||||
@ -36,7 +36,7 @@ export const updateProfileFormData = (target, value) => ({
|
|||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getProfile = () => dispatch => mpwoApiUser
|
export const getProfile = () => dispatch => FitTrackeeApi
|
||||||
.getProfile()
|
.getProfile()
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -50,7 +50,7 @@ export const getProfile = () => dispatch => mpwoApiUser
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export const register = formData => dispatch => mpwoApiUser
|
export const register = formData => dispatch => FitTrackeeApi
|
||||||
.register(
|
.register(
|
||||||
formData.username,
|
formData.username,
|
||||||
formData.email,
|
formData.email,
|
||||||
@ -68,7 +68,7 @@ export const register = formData => dispatch => mpwoApiUser
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export const login = formData => dispatch => mpwoApiUser
|
export const login = formData => dispatch => FitTrackeeApi
|
||||||
.login(formData.email, formData.password)
|
.login(formData.email, formData.password)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -137,7 +137,7 @@ export const handleProfileFormSubmit = event => (dispatch, getState) => {
|
|||||||
'Password and password confirmation don\'t match.'
|
'Password and password confirmation don\'t match.'
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
return mpwoApiUser
|
return FitTrackeeApi
|
||||||
.updateProfile(state.formProfile.formProfile)
|
.updateProfile(state.formProfile.formProfile)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -156,7 +156,7 @@ export const uploadPicture = event => dispatch => {
|
|||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append('file', event.target.picture.files[0])
|
form.append('file', event.target.picture.files[0])
|
||||||
event.target.reset()
|
event.target.reset()
|
||||||
return mpwoApiUser
|
return FitTrackeeApi
|
||||||
.updatePicture(form)
|
.updatePicture(form)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
@ -169,7 +169,7 @@ export const uploadPicture = event => dispatch => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const deletePicture = () => dispatch => mpwoApiUser
|
export const deletePicture = () => dispatch => FitTrackeeApi
|
||||||
.deletePicture()
|
.deletePicture()
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
@ -27,7 +27,7 @@ class ActivityAddEdit extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - {activity
|
<title>FitTrackee - {activity
|
||||||
? 'Edit a workout'
|
? 'Edit a workout'
|
||||||
: 'Add a workout'}
|
: 'Add a workout'}
|
||||||
</title>
|
</title>
|
@ -45,7 +45,7 @@ class ActivityDisplay extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className="activity-page">
|
<div className="activity-page">
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - {title}</title>
|
<title>FitTrackee - {title}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
{message ? (
|
{message ? (
|
||||||
<code>{message}</code>
|
<code>{message}</code>
|
@ -13,7 +13,7 @@ function Activity () {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Admin</title>
|
<title>FitTrackee - Admin</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
{isLoggedIn() ? (
|
{isLoggedIn() ? (
|
||||||
<Switch>
|
<Switch>
|
@ -6,7 +6,7 @@ export default function AdminMenu () {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Admin</title>
|
<title>FitTrackee - Admin - Sports</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">Administration</h1>
|
<h1 className="page-title">Administration</h1>
|
||||||
<div className="container">
|
<div className="container">
|
@ -14,7 +14,7 @@ class AdminSportsAdd extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Admin</title>
|
<title>FitTrackee - Admin - Add Sport</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">
|
<h1 className="page-title">
|
||||||
Administration - Sport
|
Administration - Sport
|
@ -28,7 +28,7 @@ class AdminDetail extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Admin</title>
|
<title>FitTrackee - Admin</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">
|
<h1 className="page-title">
|
||||||
Administration - {title}
|
Administration - {title}
|
@ -20,7 +20,7 @@ export default function AdminPage(props) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Admin</title>
|
<title>FitTrackee - Admin</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">
|
<h1 className="page-title">
|
||||||
Administration - {title}
|
Administration - {title}
|
@ -16,7 +16,7 @@ function Admin (props) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Admin</title>
|
<title>FitTrackee - Admin</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
{isLoggedIn() ? (
|
{isLoggedIn() ? (
|
||||||
user.isAdmin ? (
|
user.isAdmin ? (
|
@ -13,7 +13,7 @@ export default function UserStatistics (props) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-9 text-right">
|
<div className="col-9 text-right">
|
||||||
<div className="huge">{user.nbActivities}</div>
|
<div className="huge">{user.nbActivities}</div>
|
||||||
<div>{`workout${user.nbActivities !== 1 && 's'}`}</div>
|
<div>{`workout${user.nbActivities === 1 ? '' : 's'}`}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -34,7 +34,7 @@ class DashBoard extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Dashboard</title>
|
<title>FitTrackee - Dashboard</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
{message ? (
|
{message ? (
|
||||||
<code>{message}</code>
|
<code>{message}</code>
|
@ -10,7 +10,7 @@ function NavBar(props) {
|
|||||||
<header>
|
<header>
|
||||||
<nav className="navbar navbar-expand-lg navbar-light bg-light">
|
<nav className="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<span className="navbar-brand">mpwo</span>
|
<span className="navbar-brand">FitTrackee</span>
|
||||||
<button
|
<button
|
||||||
className="navbar-toggler"
|
className="navbar-toggler"
|
||||||
type="button"
|
type="button"
|
@ -5,7 +5,7 @@ export default function AccessDenied () {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - Access denied</title>
|
<title>FitTrackee - Access denied</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">Access denied</h1>
|
<h1 className="page-title">Access denied</h1>
|
||||||
<p className="App-center">
|
<p className="App-center">
|
@ -5,7 +5,7 @@ export default function NotFound () {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - 404</title>
|
<title>fittrackee - 404</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">Page not found</h1>
|
<h1 className="page-title">Page not found</h1>
|
||||||
</div>
|
</div>
|
@ -5,7 +5,7 @@ export default function Form (props) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - {props.formType}</title>
|
<title>FitTrackee - {props.formType}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">{props.formType}</h1>
|
<h1 className="page-title">{props.formType}</h1>
|
||||||
<div className="container">
|
<div className="container">
|
@ -11,7 +11,7 @@ function Profile ({ message, onDeletePicture, onUploadPicture, user }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - {user.username} - Profile</title>
|
<title>FitTrackee - {user.username} - Profile</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
{ message !== '' && (
|
{ message !== '' && (
|
||||||
<code>{message}</code>
|
<code>{message}</code>
|
@ -24,7 +24,7 @@ class ProfileEdit extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>mpwo - {user.username} - Edit Profile</title>
|
<title>FitTrackee - {user.username} - Edit Profile</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
{ message !== '' && (
|
{ message !== '' && (
|
||||||
<code>{message}</code>
|
<code>{message}</code>
|
@ -1,6 +1,6 @@
|
|||||||
import { apiUrl, createRequest } from '../utils'
|
import { apiUrl, createRequest } from '../utils'
|
||||||
|
|
||||||
export default class MpwoApi {
|
export default class FitTrackeeApi {
|
||||||
|
|
||||||
static addActivity(formData) {
|
static addActivity(formData) {
|
||||||
const params = {
|
const params = {
|
@ -1,6 +1,6 @@
|
|||||||
import { apiUrl, createRequest } from '../utils'
|
import { apiUrl, createRequest } from '../utils'
|
||||||
|
|
||||||
export default class MpwoApi {
|
export default class FitTrackeeApi {
|
||||||
|
|
||||||
static getData(target,
|
static getData(target,
|
||||||
data = {}) {
|
data = {}) {
|
@ -1,6 +1,6 @@
|
|||||||
import { apiUrl, createRequest } from '../utils'
|
import { apiUrl, createRequest } from '../utils'
|
||||||
|
|
||||||
export default class MpwoApi {
|
export default class FitTrackeeApi {
|
||||||
|
|
||||||
static getStats(userID, type, data = {}) {
|
static getStats(userID, type, data = {}) {
|
||||||
let url = `${apiUrl}stats/${userID}/${type}`
|
let url = `${apiUrl}stats/${userID}/${type}`
|
@ -1,6 +1,6 @@
|
|||||||
import { apiUrl, createRequest } from '../utils'
|
import { apiUrl, createRequest } from '../utils'
|
||||||
|
|
||||||
export default class MpwoApiUser {
|
export default class FitTrackeeApi {
|
||||||
|
|
||||||
static login(email, password) {
|
static login(email, password) {
|
||||||
const params = {
|
const params = {
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "mpwo_client",
|
|
||||||
"version": "0.1.0"
|
|
||||||
}
|
|
@ -3,7 +3,7 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://mpwo-client:3000;
|
proxy_pass http://fittrackee-client:3000;
|
||||||
proxy_redirect default;
|
proxy_redirect default;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
@ -12,7 +12,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location /api {
|
location /api {
|
||||||
proxy_pass http://mpwo-api:5000;
|
proxy_pass http://fittrackee-api:5000;
|
||||||
proxy_redirect default;
|
proxy_redirect default;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "mpwo_client",
|
"name": "fittrackee_client",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
|
12
package.json
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "mpwo_client",
|
"name": "fittrackee_client",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -22,11 +22,11 @@
|
|||||||
"redux-thunk": "^2.2.0"
|
"redux-thunk": "^2.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cd mpwo_client && react-scripts start",
|
"start": "cd fittrackee_client && react-scripts start",
|
||||||
"build": "cd mpwo_client && react-scripts build",
|
"build": "cd fittrackee_client && react-scripts build",
|
||||||
"test": "cd mpwo_client && testcafe firefox e2e",
|
"test": "cd fittrackee_client && testcafe firefox e2e",
|
||||||
"eject": "cd mpwo_client && react-scripts eject",
|
"eject": "cd fittrackee_client && react-scripts eject",
|
||||||
"lint": "eslint --cache --ext .jsx --ext .js mpwo_client/src"
|
"lint": "eslint --cache --ext .jsx --ext .js fittrackee_client/src"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^8.2.3",
|
"babel-eslint": "^8.2.3",
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
[pytest]
|
[pytest]
|
||||||
norecursedirs = mpwo_api/venv
|
norecursedirs = fittrackee_api/venv
|
||||||
|
8
test.sh
@ -8,13 +8,13 @@ inspect() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
docker-compose -f docker-compose-ci.yml run mpwo-api py.test mpwo_api
|
docker-compose -f docker-compose-ci.yml run fittrackee-api py.test fittrackee_api
|
||||||
inspect $? api
|
inspect $? api
|
||||||
|
|
||||||
docker-compose -f docker-compose-ci.yml run mpwo-api flask db upgrade
|
docker-compose -f docker-compose-ci.yml run fittrackee-api flask db upgrade
|
||||||
docker-compose -f docker-compose-ci.yml run mpwo-api flask init_data
|
docker-compose -f docker-compose-ci.yml run fittrackee-api flask init_data
|
||||||
|
|
||||||
testcafe chrome mpwo_client/e2e
|
testcafe chrome fittrackee_client/e2e
|
||||||
inspect $? e2e
|
inspect $? e2e
|
||||||
|
|
||||||
if [ -n "${fails}" ];
|
if [ -n "${fails}" ];
|
||||||
|