Skip to content

Commit

Permalink
Refactor/separate backend (#13)
Browse files Browse the repository at this point in the history
* reading pages work from external server

* api und media base from .env

* runtime config step 1

* step 2

* first working version

* adapt ignore files - finsh menu

* cypres

* first cypress suite of tests

* set branch for action

* jest as depenency

* test without wait

* t2

* start be in background but wait

* build nuxt  first

* build in previous step

* waiton ip

* no waiton

* statics

* login tests

* prototype to improve testing stability

* test automated for new podcast - incl. api auth

* e2e podcast related testing

* first tests for new-episode

* bug new name for composable

* dark mode

* dark mode and styles (open bug with logo asset)

* dark mode fixes

* logo fix

* logo ressource from be

* testcases new-episode

* remove yarn.lock

* series route changed

* first test for episode submenu - fixing auth

* chmod skript for starting be in action

* switch of be recorder

* podcast and episode cover for test data

* making tests more stable

* auth refactored and series tested

* disable logger

* change podcast func

* improving tests

* set password and invitation

* log recorder disabled

* run in docker, using env and reverse nginx

* tests adapted

* startbe shell script returns

* logfile removed

* retry

* retry 2

* build image action for refactor branch

* yml bug

* workflow

* rename action

* bug - no reload when slug changed in episode, podcast, serie

* adding umami analytics

* tests fixed

* nav bar backgroud light - bug fixed

* search bar refactoring, bug fixes

* series list without login

* description is sufficient

* series missing in new episode bug fixed

* series in new-episode - use loading flag to fix bug

* spinner im login

* series update, image filename url safe

* test und bug fixes

* bug on image change fixed, update at for podcast set for sorting

* docker

* image upload bug, because of empty series

* cover img for tests

* update umami to version 2

* fixing event for umami

* Create branch-image.yml (#12)

* rename action

* external menu feature

* branche image

* Create branch-image.yml (#12)

* rename action

* Create branch-image.yml (#12)

* rename action

* Create branch-image.yml (#12)
  • Loading branch information
AlexRoehm authored Aug 9, 2024
1 parent bc98674 commit 50f7bf2
Show file tree
Hide file tree
Showing 266 changed files with 6,472 additions and 4,402 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ tests
.github
.env
public/s
backend/public/s
frontend
public-docker
temp
tmp
.tmp
settings.json
docker/runtime
docker/log
old
archiv
24 changes: 24 additions & 0 deletions .github/workflows/cypresss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: End-to-end tests
on:
push:
branches: [ "refactor/separate-backend" ]
workflow_dispatch:
jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run backend
uses: actions/setup-node@v4
with:
node-version: 18
- run: |
yarn &&
yarn build &&
chmod a+x startbe.sh &&
./startbe.sh
- name: Run E2E tests
uses: cypress-io/github-action@v6
with:
start: yarn preview
56 changes: 36 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
.idea/
.vscode/
node_modules/
build/
tmp/
temp/
.tmp/
.nuxt
dist
# Nuxt dev/build outputs
.output
*.log*
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
*.lock
upload/
coverage
secret
.env.*
!.env.example

cypress/e2e/screenshots
cypress/e2e/logs
cypress/screenshots
cypress/logs

public/s
public-docker
org.*
settings.json
docker-compose.yml
docker/runtime
archiv
backend/node_modules
backend/public/s
backend/dist
backend/data/*.sqlite
backend/yarn.lock
backend/.env

frontend

yarn.lock
35 changes: 0 additions & 35 deletions .kanbn/index.md

This file was deleted.

10 changes: 0 additions & 10 deletions .kanbn/tasks/admin-als-super-admin-delete-podcast-und-import.md

This file was deleted.

14 changes: 0 additions & 14 deletions .kanbn/tasks/analytics.md

This file was deleted.

9 changes: 0 additions & 9 deletions .kanbn/tasks/autor-aus-enum-liste-oder-eingeben.md

This file was deleted.

10 changes: 0 additions & 10 deletions .kanbn/tasks/bibelstelle-video-editierbar.md

This file was deleted.

9 changes: 0 additions & 9 deletions .kanbn/tasks/drag-n-drop-image.md

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions .kanbn/tasks/injecting-menu-for-integration-in-website.md

This file was deleted.

10 changes: 0 additions & 10 deletions .kanbn/tasks/login-passwort-change.md

This file was deleted.

9 changes: 0 additions & 9 deletions .kanbn/tasks/move-episode-to-other-podcast.md

This file was deleted.

12 changes: 0 additions & 12 deletions .kanbn/tasks/paging-for-episodes-client-server.md

This file was deleted.

9 changes: 0 additions & 9 deletions .kanbn/tasks/podcast-slug-uniqueness-prüfen.md

This file was deleted.

10 changes: 0 additions & 10 deletions .kanbn/tasks/refresh-bug.md

This file was deleted.

9 changes: 0 additions & 9 deletions .kanbn/tasks/uat-test-suite.md

This file was deleted.

3 changes: 2 additions & 1 deletion .nuxtignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ tmp
temp
data
docker
archiv
old
archiv
63 changes: 38 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,59 @@
FROM node:16 as builder
FROM node:18
LABEL authors="Alex Roehm"
# update dependencies and install curl
ARG BUILDTIME
ARG VERSION
ARG BUILDTIME
ARG REVISION
ARG NUXT_PUBLIC_URL
ARG NUXT_PUBLIC_UMAMI_HOST
ARG NUXT_PUBLIC_UMAMI_ID
ARG NUXT_PUBLIC_SKIN
ARG NUXT_PUBLIC_ENABLE_DARK_MODE
ARG NUXT_PUBLIC_LOGO
ARG NUXT_PUBLIC_LOGO_DARK
ARG NUXT_PUBLIC_EXT_MENU_DE

# Create app directory
WORKDIR /build
COPY . .
RUN echo export const VERSION=\"${VERSION}\" > version.ts
RUN echo export const BUILDTIME=\"${BUILDTIME}\" >> version.ts
RUN echo export const REVISION=\"${REVISION}\" >> version.ts

# update each dependency in package.json to the latest version
RUN yarn
ENV DATABASE_PATH=/data
ENV DATABASE_FILE=podcasts.sqlite
ENV DATA_PATH=/var/www

# If you are building your code for production
RUN yarn build

FROM node:16
LABEL authors="Alex Roehm"

RUN apt-get update && apt-get install -y \
curl dumb-init logrotate nginx\
curl dumb-init logrotate nginx vim \
&& rm -rf /var/lib/apt/lists/*

COPY ./docker/nginx/startup.sh /startup.sh
RUN chmod u+x /startup.sh

# prepare nginx
COPY ./docker/nginx/default /etc/nginx/sites-available/default
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/nginx/logrotate /etc/logrotate/nginx

COPY --from=builder --chown=node:node /build/.output /var/www
RUN chown -R node:node /etc/nginx /var/log/nginx /var/lib/nginx
RUN chmod go-w /etc/logrotate/nginx
RUN chown -R node:node /var/www /etc/nginx /var/log/nginx /var/lib/nginx
RUN chmod a+w /run

WORKDIR /var/www
WORKDIR /data
RUN chown node:node .

WORKDIR /app
RUN chown node:node .
COPY --chown=node:node . .
USER node

# install startup script
RUN cp docker/nginx/startup.sh .
RUN chmod a+x startup.sh

# prepare backend
RUN cd ./backend && yarn

# Prepare Versioning
RUN printf 'export const BUILDTIME= "'$BUILDTIME'"\n' > version.ts
RUN printf 'export const REVISION= "'$REVISION'"\n' >> version.ts
RUN printf 'export const VERSION = "'$VERSION'"\n' >> version.ts

# update each dependency in package.json to the latest version
RUN yarn

EXPOSE 80

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD [ "/startup.sh" ]
CMD [ "./startup.sh" ]
Loading

0 comments on commit 50f7bf2

Please sign in to comment.