Skip to content

Commit a188b9e

Browse files
authored
Merge pull request #231 from Seluj78/229-add-vue-container
229: replace react frontend with vue container
2 parents 52ac09b + 873a3d4 commit a188b9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+10469
-15469
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ install: pip install -r backend/requirements.txt
1515

1616
jobs:
1717
include:
18-
- stage: build
19-
script: make build
18+
# - stage: build
19+
# script: make build
2020
- stage: lint
21-
script: make lint
21+
script: black --check backend
22+
# script: make lint
2223
# - stage: tests
2324
# before_script:
2425
# - wget https://repo.mysql.com//mysql-apt-config_0.8.14-1_all.deb

Makefile

Lines changed: 0 additions & 113 deletions
This file was deleted.

backend/PyMatcha/__init__.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from dotenv import load_dotenv
2626
from flask import Flask
2727
from flask import jsonify
28-
from flask import send_from_directory
2928
from flask_cors import CORS
3029
from flask_jwt_extended import JWTManager
3130
from flask_mail import Mail
@@ -59,7 +58,7 @@
5958
if os.getenv("ENABLE_LOGGING") == "True":
6059
setup_logging()
6160

62-
application = Flask(__name__, static_folder=os.getenv("FRONT_STATIC_FOLDER"))
61+
application = Flask(__name__)
6362

6463
if os.getenv("FLASK_DEBUG", "false") == "true" or os.getenv("FLASK_DEBUG", "false") == "1":
6564
application.debug = True
@@ -224,20 +223,6 @@ def check_if_token_is_revoked(decrypted_token):
224223
application.register_blueprint(debug_bp)
225224

226225

227-
logging.debug("Registering serve route for REACT")
228-
229-
230-
# Serve React App
231-
@application.route("/", defaults={"path": ""})
232-
@application.route("/<path:path>")
233-
def serve(path):
234-
logging.debug("Serving {}.".format(path))
235-
if path != "" and os.path.exists(application.static_folder + "/" + path):
236-
return send_from_directory(application.static_folder, path)
237-
else:
238-
return send_from_directory(application.static_folder, "index.html")
239-
240-
241226
@jwt.unauthorized_loader
242227
def no_jwt_callback(error_message):
243228
return (

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ services:
8888
- redis-net
8989
- mysql-net
9090

91+
frontend:
92+
container_name: frontend
93+
build:
94+
context: ./frontend
95+
dockerfile: Dockerfile
96+
volumes:
97+
- './frontend:/frontend'
98+
- '/frontend/node_modules'
99+
ports:
100+
- '4242:8080'
101+
91102
phpmyadmin:
92103
image: phpmyadmin/phpmyadmin
93104
container_name: dev_pma

frontend/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.git
3+
.gitignore

frontend/.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
insert_final_newline = true
7+
max_line_length = 100

frontend/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# Editor directories and files
17+
.idea
18+
.vscode
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?

frontend/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:12.2.0-alpine
2+
3+
WORKDIR /frontend
4+
5+
ENV PATH /frontend/node_modules/.bin:$PATH
6+
7+
COPY package.json /frontend/package.json
8+
RUN yarn install
9+
RUN yarn global add @vue/cli
10+
11+
CMD ["yarn", "serve"]

frontend/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# client
2+
3+
## Project setup
4+
```
5+
yarn install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
yarn serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
yarn build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
yarn lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

frontend/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset',
4+
],
5+
};

0 commit comments

Comments
 (0)