Coder Social home page Coder Social logo

krishnaclouds / dsof-patch-chat-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snyk-workshops/dsof-patch-chat-app

0.0 0.0 0.0 799 KB

License: MIT License

JavaScript 14.02% Java 41.10% Groovy 11.36% Vue 33.01% Dockerfile 0.29% Procfile 0.22%

dsof-patch-chat-app's Introduction

multiroom-chat-goof

A purposely vulnerable, multiroom chat application with Java, Spring, WebSocket on the backend and Vue, Vuex, Nuxt.js on the frontend.

Overview

This project is based off the excellent work of kojotdev. Read more about it here.

The project is organized in such a way that it can easily be run locally and be deployed for demonstration.

NOTE: The project has known vulnerabilities in it for demonstration purposes. PLEASE do not attempt to use in any production environment.

multiroom-chatspring-vue-websocket-live-example

Run - local, separated

Launch the backend with:

mvn clean install
mvn spring-boot:run

The backend will launch on port 8080

Launch the frontend with:

cd src/frontend
npm install
npm run dev

The frontend will launch on port 3000

You can then browse to: http://localhost:3000

Any changes you make to the frontend will trigger an automatic re-build of the frontend.

Run - local, unified

When you run mvn clean install, in addition to building the Java code, it performs the following for the frontend app:

  • builds the nuxt app
  • generates a static version of the nuxt app
  • copies the static frontend into src/main/resources/public

The last step is what enables the frontend app to be served by the spring boot app.

You can run the spring boot app as before:

mvn spring-boot:run

Now, you can access the frontend at: http://localhost:8080 and it will automatically connect with backend.

Run - remote, unified

The combination of the Procfile and system.properties files makes the app easily deployable to Heroku.

NOTE: In order for the frontend to properly connect to the backend, you'll need to set an environment variable called: BASE_URL.

Do the following to deploy to heroku using the cli too:

heroku apps:create my-great-app
heroku config:set BASE_URL=https://my-great-app.herokuapp.com
git push heroku main

This will push the code to heroku and run the unified build process. Once complete, you can access the app at the name you gave it (ex: https://my-great-app.herokuapp.com)

dsof-patch-chat-app's People

Contributors

dogeared avatar krishnaclouds avatar snyk-bot avatar vermava avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.