diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e3ed7d1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ac13efe --- /dev/null +++ b/.env.example @@ -0,0 +1,66 @@ +#Laravel Backend +APP_NAME=PGP +APP_ENV=production +APP_KEY= +APP_DEBUG=false +APP_URL=https://api.bewerben.c3fl.space + +LOG_CHANNEL=stack +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=database +DB_PORT=3306 +DB_DATABASE=database +DB_USERNAME=secret +DB_PASSWORD=secret + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +FILESYSTEM_DISK=local +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +MEMCACHED_HOST=127.0.0.1 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=mailpit +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_HOST= +PUSHER_PORT=443 +PUSHER_SCHEME=https +PUSHER_APP_CLUSTER=mt1 + +VITE_APP_NAME="${APP_NAME}" +VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +VITE_PUSHER_HOST="${PUSHER_HOST}" +VITE_PUSHER_PORT="${PUSHER_PORT}" +VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" +VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +# Database +MYSQL_RANDOM_ROOT_PASSWORD=true +MYSQL_DATABASE=databse +MYSQL_USER=secret +MYSQL_PASSWORD=secret diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 9e15662..34e093e 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -1,8 +1,8 @@ -name: Build and deploy +name: Build and deploy V2 on: push: - branches: ["main"] + branches: ["v2-customize-things"] concurrency: group: ${{ github.ref }} @@ -29,21 +29,26 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build + - name: Build Frontend uses: docker/build-push-action@v3 with: - context: . - file: Dockerfile + context: frontend + file: frontend/Dockerfile push: true - tags: "ghcr.io/${{ github.repository }}:latest" - build-args: | - "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" - "SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }}" - - - name: pull and start new image - uses: appleboy/ssh-action@master + tags: "ghcr.io/${{ github.repository }}/frontend:latest" + + - name: Build Backend + uses: docker/build-push-action@v3 with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USER_NAME }} - key: ${{ secrets.PRIVATE_KEY}} - script: cd ccs-proposal && docker compose pull && docker compose up -d + context: backend + file: backend/Dockerfile + push: true + tags: "ghcr.io/${{ github.repository }}/backend:latest" + + # - name: pull and start new image + # uses: appleboy/ssh-action@master + # with: + # host: ${{ secrets.HOST }} + # username: ${{ secrets.USER_NAME }} + # key: ${{ secrets.PRIVATE_KEY}} + # script: cd pretty-good-proposal-v2 && docker compose pull && docker compose up -d diff --git a/.gitignore b/.gitignore index c6bba59..870f442 100644 --- a/.gitignore +++ b/.gitignore @@ -1,130 +1,3 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files .env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* +frontend/.env +backend/.env diff --git a/.vscode/settings.json b/.vscode/settings.json index 48eeb2c..db81fea 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", @@ -10,14 +10,6 @@ "[html]": { "editor.defaultFormatter": "vscode.html-language-features" }, - "deno.enable": true, - "deno.enablePaths": [ - "./supabase" - ], - "deno.unstable": true, - "[typescript]": { - "editor.defaultFormatter": "denoland.vscode-deno" - }, "[json]": { "editor.defaultFormatter": "vscode.json-language-features" } diff --git a/README.md b/README.md index 4dc171c..e27ec1f 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,47 @@ -# PGP - Pretty good Proposal +# PGP - Pretty Good Proposal V2 -Purpose build for [Chaotic Catalyst Scholarships (CCS)](https://ccs.chaostreff-flensburg.de/). This is a web application to create and manage proposals for the CCS. [License](./LICENSE) +Mange different proposals tracks with a simple web application [License](./LICENSE). -You can see a running version [bewerben.ccs.chaostreff-flensburg.de](https://bewerben.ccs.chaostreff-flensburg.de/#/). You can find a very [short talk (2:40 Minutes) from cccamp23 on youtube](https://youtu.be/y4a9_POxGws?si=DWvt5urfD1hWnc-6) +First build to manage [Chaotic Catalyst Scholarships (CCS)](https://ccs.chaostreff-flensburg.de/). + +You can see a running version [bewerben.c3fl.de](https://bewerben.c3fl.de). You can find a very [short talk (2:40 Minutes) from cccamp23 on youtube](https://youtu.be/y4a9_POxGws?si=DWvt5urfD1hWnc-6) ## Features + +- Create Tracks - Create proposals -- Encyrpt proposals with [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API). For more infomration please have a look at the [lib](./src/lib/) Folder and different files. -- Save encrypted proposals to a database. In this case to supabase +- Encyrpt proposals with [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API). For more infomration please have a look at the [lib](./src/lib/) Folder and different files. +- Save encrypted proposals to a database. - Only advisary board can decrypt proposals (with a manuel shared private) - Advisary board can vote and decide on proposals +- Every Track has a custom URL and public key +- A root user can create tracks, users (advisary board) and connect them both +- You can easily export all track data as json -> This is a work in progress. The application is not ready for easy setup for other projects. +> This is a work in progress. The application could be setup for other projects. Please be aware that this is a very early version. There is no guarantee that this application is secure. Only use it if encrytion is a nice to have feature!!! ## Technical Setup + ### Frontend -#### Vue 3 + Vite -This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` + \ No newline at end of file diff --git a/frontend/src/components/CreateTrack.vue b/frontend/src/components/CreateTrack.vue new file mode 100644 index 0000000..3a1890a --- /dev/null +++ b/frontend/src/components/CreateTrack.vue @@ -0,0 +1,80 @@ + +