Discourse-java is a platform where users can freely discuss on topics they want to, and like-minded people can join in and contribute

Overview

Discourse is the 100% open source discussion platform built for the next decade of the Internet. Use it as a:

  • mailing list
  • discussion forum
  • long-form chat room

Prominent features

  1. Multiple discussion threads on home page which can be filtered based on categories.
  2. Rich text editor integrated to create and update posts (supports HTML snippets and image uploads).
  3. User can search for topics or posts and identify similar posts using Elastic Search.
  4. Users can create topics for different categories and add tags to the topics or select a similar topic from the suggestions provided.
  5. Users can like and reply to topics and posts and edit or delete their own posts.
  6. Supports nested replies to topics/posts.
  7. Users can sort posts in a topic based on like or reply counts.
  8. Users can send private messages to admin.
  9. Admin can create categories and announcements.
  10. Announcements can be viewed by non-logged in users also in landing page.
  11. Admin can moderate posts and hide/delete posts of any user.
  12. Offensive posts get auto-hidden using text-classifier to detect toxicity.
  13. Users get push notifications when they receive a reply to their post, or when someone creates a post in their topic or when their post is hidden/deleted by system/admin.
  14. User can register and log in to the platform using Key Cloak registration or social login (Google, Facebook, Github).

This application was generated using JHipster 6.10.5, you can find documentation and help at https://www.jhipster.tech/documentation-archive/v6.10.5.

Development

Before you can build this project, you must install and configure the following dependencies on your machine:

  1. Node.js: We use Node to run a development web server and build the project. Depending on your system, you can install Node either from source or as a pre-packaged bundle.

After installing Node, you should be able to run the following command to install development tools. You will only need to run this command when dependencies change in package.json.

npm install

We use npm scripts and Webpack as our build system.

Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive.


./mvnw


npm start

Npm is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by specifying a newer version in package.json. You can also run npm update and npm install to manage dependencies. Add the help flag on any command to see how you can use it. For example, npm help update.

The npm run command will list all of the scripts available to run for this project.

OAuth 2.0 / OpenID Connect

Congratulations! You've selected an excellent way to secure your JHipster application. If you're not sure what OAuth and OpenID Connect (OIDC) are, please see What the Heck is OAuth?

To log in to your app, you'll need to have Keycloak up and running. The JHipster Team has created a Docker container for you that has the default users and roles. Start Keycloak using the following command.

docker-compose -f src/main/docker/keycloak.yml up

The security settings in src/main/resources/config/application.yml are configured for this image.

spring:
  ...
  security:
    oauth2:
      client:
        provider:
          oidc:
            issuer-uri: http://localhost:9080/auth/realms/jhipster
        registration:
          oidc:
            client-id: web_app
            client-secret: web_app

Okta

If you'd like to use Okta instead of Keycloak, you'll need to change a few things. First, you'll need to create a free developer account at https://developer.okta.com/signup/. After doing so, you'll get your own Okta domain, that has a name like https://dev-123456.okta.com.

Modify src/main/resources/config/application.yml to use your Okta settings.

spring:
  ...
  security:
    oauth2:
      client:
        provider:
          oidc:
            issuer-uri: https://{yourOktaDomain}/oauth2/default
        registration:
          oidc:
            client-id: {clientId}
            client-secret: {clientSecret}
security:

Create an OIDC App in Okta to get a {clientId} and {clientSecret}. To do this, log in to your Okta Developer account and navigate to Applications > Add Application. Click Web and click the Next button. Give the app a name you’ll remember, specify http://localhost:8080 as a Base URI, and http://localhost:8080/login/oauth2/code/oidc as a Login Redirect URI. Click Done, then Edit and add http://localhost:8080 as a Logout redirect URI. Copy and paste the client ID and secret into your application.yml file.

Create a ROLE_ADMIN and ROLE_USER group and add users into them. Modify e2e tests to use this account when running integration tests. You'll need to change credentials in src/test/javascript/e2e/account/account.spec.ts and src/test/javascript/e2e/admin/administration.spec.ts.

Navigate to API > Authorization Servers, click the Authorization Servers tab and edit the default one. Click the Claims tab and Add Claim. Name it "groups", and include it in the ID Token. Set the value type to "Groups" and set the filter to be a Regex of .*.

After making these changes, you should be good to go! If you have any issues, please post them to Stack Overflow. Make sure to tag your question with "jhipster" and "okta".

PWA Support

JHipster ships with PWA (Progressive Web App) support, and it's turned off by default. One of the main components of a PWA is a service worker.

The service worker initialization code is commented out by default. To enable it, uncomment the following code in src/main/webapp/index.html:

<script>
  if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('./service-worker.js').then(function () {
      console.log('Service Worker Registered');
    });
  }
</script>

Note: Workbox powers JHipster's service worker. It dynamically generates the service-worker.js file.

Managing dependencies

For example, to add Leaflet library as a runtime dependency of your application, you would run following command:

npm install --save --save-exact leaflet

To benefit from TypeScript type definitions from DefinitelyTyped repository in development, you would run following command:

npm install --save-dev --save-exact @types/leaflet

Then you would import the JS and CSS files specified in library's installation instructions so that Webpack knows about them: Edit src/main/webapp/app/vendor.ts file:

import 'leaflet/dist/leaflet.js';

Edit src/main/webapp/content/scss/vendor.scss file:

@import '~leaflet/dist/leaflet.css';

Note: There are still a few other things remaining to do for Leaflet that we won't detail here.

For further instructions on how to develop with JHipster, have a look at Using JHipster in development.

Using Angular CLI

You can also use Angular CLI to generate some custom client code.

For example, the following command:

ng generate component my-component

will generate few files:

create src/main/webapp/app/my-component/my-component.component.html
create src/main/webapp/app/my-component/my-component.component.ts
update src/main/webapp/app/app.module.ts

Building for production

Packaging as jar

To build the final jar and optimize the discourse application for production, run:


./mvnw -Pprod clean verify


This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files. To ensure everything worked, run:


java -jar target/*.jar


Then navigate to http://localhost:8080 in your browser.

Refer to Using JHipster in production for more details.

Packaging as war

To package your application as a war in order to deploy it to an application server, run:


./mvnw -Pprod,war clean verify


Testing

To launch your application's tests, run:

./mvnw verify

Client tests

Unit tests are run by Jest and written with Jasmine. They're located in src/test/javascript/ and can be run with:

npm test

For more information, refer to the Running tests page.

Code quality

Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:

docker-compose -f src/main/docker/sonar.yml up -d

You can run a Sonar analysis with using the sonar-scanner or by using the maven plugin.

Then, run a Sonar analysis:

./mvnw -Pprod clean verify sonar:sonar

If you need to re-run the Sonar phase, please be sure to specify at least the initialize phase since Sonar properties are loaded from the sonar-project.properties file.

./mvnw initialize sonar:sonar

For more information, refer to the Code quality page.

Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.

For example, to start a postgresql database in a docker container, run:

docker-compose -f src/main/docker/postgresql.yml up -d

To stop it and remove the container, run:

docker-compose -f src/main/docker/postgresql.yml down

You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running:

./mvnw -Pprod verify jib:dockerBuild

Then run:

docker-compose -f src/main/docker/app.yml up -d

For more information refer to Using Docker and Docker-Compose, this page also contains information on the docker-compose sub-generator (jhipster docker-compose), which is able to generate docker configurations for one or several JHipster applications.

Continuous Integration (optional)

To configure CI for your project, run the ci-cd sub-generator (jhipster ci-cd), this will let you generate configuration files for a number of Continuous Integration systems. Consult the Setting up Continuous Integration page for more information.

You might also like...

Literally just adds milk, to act as a bridge for any other mods that want to do the same.

Milk lib Literally just adds milk, to act as a bridge for any other mods that want to do the same. See the Milk class for customisation; It allows for

Oct 17, 2022

You want to go to a cafe but don't know where to go. Let cafe hub support you. Ok let's go

You want to go to a cafe but don't know where to go. Let cafe hub support you. Ok let's go

cafe-hub You want to go to a cafe but don't know where to go. Let cafe hub support you. Ok let's go Architecture: Domain Driven Design (DDD) LDM Insta

Nov 12, 2022

Users can create and sign up for giveaways which, upon expiring, will select a random winner from the pool of entries

PROJECT NAME Readaway Project Description Users can create and sign up for giveaways which, upon expiring, will select a random winner from the pool o

Apr 4, 2022

This app based on Java to make the life of firefighters easier by implementing features which they need in their day-to-day life

This app based on Java to make the life of firefighters easier by implementing features which they need in their day-to-day life

Fire Rescue App This app based on Java to make the life of firefighters easier by implementing features which they need in their day-to-day life. Scre

Jul 24, 2022

An Android library for managing images and the memory they use.

An Android library for managing images and the memory they use.

Fresco Fresco is a powerful system for displaying images in Android applications. Fresco takes care of image loading and display, so you don't have to

Jan 3, 2023

When it is snowing leaves will slowly turn white, and when it is not they will turn back to normal

SnowyLeavesPlus In Bedrock Edition, leaves turn white when it is snowing. SnowyLeavesPlus brings this feature to Java Edition! When it is snowing leav

Nov 26, 2022

Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in.

JoinMessages Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in or leave.

Aug 30, 2022

Titanium is a plugin meant to block harmful packets before they're received by the Minecraft packet handler.

Titanium Titanium is a plugin meant to block harmful packets before they're received by the Minecraft packet handler. Report Bug · Request Feature Tab

Dec 7, 2022

A mod that delays your chat messages so that they are delayed in reports

A mod that delays your chat messages so that they are delayed in reports

A mod that delays your chat messages so that they are delayed in reports. Making it harder for Mojang to validate, and hopefully a temporary solution to Fabricated chat reports

Aug 16, 2022
Comments
  • Build issues when running the project locally

    Build issues when running the project locally

    Hi Team,

    Thanks for open sourcing the source code. I have been trying to run the app locally and get a build time error. Below is the stack trace of the error. https://pastecode.io/s/yqsvdbdo Please let me know if I am being silly h Before reaching this stage I had to create a db discourse-dev else there were issues in the build this too. I think this step could be add to the README or added directly to the build.

    opened by Ashish-Dobhal 4
Owner
Infosys Ltd
Global leader in technology services and consulting
Infosys Ltd
An Auction website. Users can Put up items for sale, bid on currently active auctions and write reviews for items that they have won in the auctions.

Auction-Project An Auction website. Users can Put up items for sale, bid on currently active auctions and write reviews for items that they have won i

Nika Salia 3 Sep 7, 2021
"Some" Utilities you can use for your Java projects "freely"! Files are compiled with Java-8 and above, but mostly Java-11.

✨ Java-SomeUtils ?? "Some" Utilities you can use for your Java projects "freely"! *"Freely"* forcing you to include the license into your program. Fil

JumperBot_ 2 Jan 6, 2023
An 24x7 active repo for your contribution feel free to contribute:)

Hacktoberfest2021 Hacktoberfest is a month-long celebration of open source software sponsored by Digital Ocean, Intel, and DEV. Do push your code in a

Vishnudas 13 Sep 14, 2022
Translating texts via Youdao eco-freely in only one class

Youdao4J Translating texts via Youdao Translator by one class. Need GSON. Usage Youdao4J did lots of works in the background. DO NOT create morr Youda

iceBear 8 Dec 11, 2022
InterfaceMaker is a modern plugin to handle and customize join items, hotbars and menus with a developer and administrator friendly API.

Interface Maker InterfaceMaker is a modern plugin to handle and customize join items, hotbars and menus with a developer friendly API. Features Simple

2LStudios - Minecraft 10 Nov 27, 2022
A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users.

Flowable (V6) Maven Central: Docker Images: License: Homepage: https://www.flowable.org/ flowable / flowəb(ə)l / a compact and highly efficient workfl

Flowable 6k Jan 7, 2023
Welcome to the EHS robotics club's GitHub repository, this will also be used as our primary community center and means of communication. Also be sure to join our remind for on the go updates @EHSFTC21

NOTICE This repository contains the public FTC SDK for the Ultimate Goal (2020-2021) competition season. Formerly this software project was hosted her

null 5 Feb 25, 2022
Parallel programming quick sort and parallel sum examples with Fork-join, RecursiveTask, RecursiveAction

QuickSortMultiThreading Parallel programming quick sort and parallel sum examples with Fork-join, RecursiveTask<T>, RecursiveAction Fork-Join Fork-Joi

Güven TUNCAY 4 Jun 12, 2022
A near-real-time Mesh Join Algorithm Implementation provided with a Complete Data warehouse for METRO

Mesh Join Algorithm and Data Warehouse A complete Mesh-Join Algorithm Implementation as provided in the paper R-MESHJOIN . This is demonstrated by the

null 3 Aug 11, 2022
A Minecraft Plugin For 1.8.8 - 1.19.2 For Giving A Player A Custom Item On Join Which Executes A Command On Right Click

PixelPlayz Custom Item A Minecraft Plugin For 1.8.8 - 1.19.2 For Giving A Player A Custom Item On Join Which Executes A Command On Right Click Install

null 2 Sep 9, 2022