Skip to content

Commit

Permalink
UI migrated to Vite, added code formatting, linter and lots of other …
Browse files Browse the repository at this point in the history
…cleanups (#10)
  • Loading branch information
lwitkowski authored Jul 31, 2024
1 parent c31859c commit c9ee6cf
Show file tree
Hide file tree
Showing 43 changed files with 5,927 additions and 10,552 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
- "*"

- package-ecosystem: 'npm'
directory: '/frontend'
directory: '/ui'
schedule:
interval: weekly

Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/cd-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches: [ main ]
paths:
- frontend/**
- ui/**
pull_request:
branches: [ main ]
paths:
- frontend/**
- ui/**
workflow_dispatch:

env:
Expand All @@ -33,20 +33,32 @@ jobs:
with:
path: |
**/node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-build-${{ hashFiles('ui/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: 'Install dependencies'
working-directory: ./frontend
working-directory: ./ui
run: npm install

- name: 'Check code formatting'
working-directory: ./ui
run: npx prettier . --check

- name: 'Static analysis (esLint)'
working-directory: ./ui
run: npm run lint

- name: 'Run tests'
working-directory: ./ui
run: CI=true npm run test:unit

- name: 'Build VueJS app'
working-directory: ./frontend
working-directory: ./ui
run: npm run build

- name: 'Build docker image'
working-directory: ./frontend
working-directory: ./ui
run: |
docker build . -t ${DOCKER_IMAGE}
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project aims at reviving www.aero-offers.com - invaluable source of price t
[![CD - Backend (api, jobs)](https://github.com/lwitkowski/aero-offers/actions/workflows/cd-backend.yaml/badge.svg)](https://github.com/lwitkowski/aero-offers/actions/workflows/cd-backend.yaml)

### Project structure (building blocks / deployment units)
- `frontend` - vue.js application deployed as dockerized static web app served by nginx
- `ui` - vue.js application deployed as dockerized static web app served by nginx
- `backend/api` - python flask app with few REST endpoints, reversed proxied by nginx serving frontend (not exposed directly to the internet).
- `backend/jobs` - python scripts triggered by scheduled job (e.g once a day). Please mind those jobs may be much much more resource heavy than API, and should not be triggered from within `api` container which is optimised to handle REST api traffic.
- `job_fetch_offers` - scans few portals (e.g. soaring.de) and stores new offers in the database (not yet classified)
Expand Down Expand Up @@ -36,7 +36,7 @@ Currently, the project is being onboarded to Azure Cloud (still WIP).
- [ ] use https://github.com/weglide/GliderList

### Running locally without Python nor NodeJS
`docker compose up --build` - starts postgres, python backend and frontend apps (http://localhost:8080/)
`docker compose up --build` - starts postgres, python backend and UI apps (http://localhost:8080/)

### Prerequisites for local development with hot reloads
- python 3.12+, pip3, flask
Expand Down Expand Up @@ -65,10 +65,10 @@ cd backend
./start_api.sh
```

Start frontend (vue app):
Start UI (vue app):
```
cd frontend
npm run serve
cd ui
npm run dev
```

Run crawlers/spiders & reclassifier:
Expand All @@ -84,7 +84,7 @@ cd backend
- Euro on y-axis
- Top 10 aircraft offered per category
- Add more spiders
- facebook marketplace
- Facebook Marketplace?
- https://www.aircraft24.de
- http://www.airplanemart.com
- http://www.aeronave.de/1-luftfahrzeuge/listings.html
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
ca-aerooffers-ui:
build: ./frontend
build: ./ui
ports:
- '8080:80'
depends_on:
Expand All @@ -9,7 +9,7 @@ services:
ca-aerooffers-api:
build: ./backend
ports:
- '8081:80' # exposed for debugging and local frontend development without python
- '8081:80' # exposed for debugging and local UI development without python
environment:
- DB_HOST=postgres
- DB_PORT=5432
Expand Down
7 changes: 0 additions & 7 deletions frontend/.editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.env.development

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.env.production

This file was deleted.

21 changes: 0 additions & 21 deletions frontend/.gitignore

This file was deleted.

Loading

0 comments on commit c9ee6cf

Please sign in to comment.