Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
9c1520a
refactor
nishant23122000 Feb 10, 2022
9f23e72
Merge branch 'master' of https://github.com/RocketChat/RC4Community i…
nishant23122000 Feb 16, 2022
ca58c55
fetch from strapi
nishant23122000 Feb 17, 2022
d0bae71
removed unused var
nishant23122000 Feb 17, 2022
a661f44
Add first version of inappchat component for virtual conference (#78)
sidmohanty11 Feb 21, 2022
492bc52
Add features (finally)
Sing-Li Feb 22, 2022
c86e4b0
fix minor typos
Sing-Li Feb 22, 2022
a8727bd
typo fix
Sing-Li Feb 22, 2022
da92deb
hype statements added
Sing-Li Feb 22, 2022
6a091db
fix phrasing
Sing-Li Feb 22, 2022
64329e1
fix typo
Sing-Li Feb 23, 2022
16a3230
README(.,cms): use environment variable to change strapi port (#55)
debdutdeb Feb 23, 2022
154b9b0
[FIX]Refactor Leaderboard (#76)
samad-yar-khan Feb 24, 2022
304ed53
[NEW] Mainstage Speakers Conference Page (#83)
sidmohanty11 Mar 1, 2022
bac5553
Add initial Virtual Conference Greenroom - Jitsi broadcaster support
Sing-Li Mar 1, 2022
a6b9dd9
Initial InApp Chat setup docs
sidmohanty11 Mar 12, 2022
a6e9464
Add In-App Chat into greenroom
sidmohanty11 Mar 12, 2022
d345ac7
Wire InAppChat via latest RocketChat-JS-SDK
sidmohanty11 Mar 12, 2022
508b2b7
Add a flexible forms creator "kit"
Dnouv Mar 12, 2022
50f7da2
open source IDM support via OpenID Connect - keycloak
abhinavkrin Mar 13, 2022
140f0ad
[FIX] Remove Typos in JSX, Add Unique Keys to props and Add id field …
samad-yar-khan Mar 17, 2022
2a31cab
[FIX] Re-rendering of InAppChat (#93)
sidmohanty11 Mar 18, 2022
0930180
Add GitHub Component Kit
samad-yar-khan Mar 26, 2022
4e0e128
Set default oauth to RocketChat OAuth authentication for RC4Community
abhinavkrin Mar 28, 2022
637ede7
Last minute update of callback URL
Sing-Li Mar 28, 2022
54d6bbd
Fix Dublicate Column Error (#104)
samad-yar-khan Mar 28, 2022
be23250
Re-Add MdPreview Component (#106)
samad-yar-khan Mar 29, 2022
4beb2e4
[FIX] handling error and not showing InputBox when not authenticated …
sidmohanty11 Mar 29, 2022
a0b495c
remove-console.log-rcauth (#109)
abhinavkrin Mar 29, 2022
8b32f11
mainstage design with coutdown, local date showtime and speakers
sidmohanty11 Mar 30, 2022
1283817
Adds GSOC 2022 Alumni Summit data (#115)
dudanogueira Apr 1, 2022
fac9731
[IMPROVE] Inappchat improvements and fixes (#112)
sidmohanty11 Apr 1, 2022
8344bf2
Add jitsi sdk to package.json
debdutdeb Apr 1, 2022
44c9e44
Add firebase-admin for app dependency
debdutdeb Apr 1, 2022
49f1af7
Make seperate commands for build and export
debdutdeb Apr 1, 2022
7d80e8f
wip: build and deploy workflow
debdutdeb Apr 1, 2022
17e4df9
Add pm2 config
debdutdeb Apr 1, 2022
bbb9a54
wip cicd workflow
debdutdeb Apr 1, 2022
8c920af
Possible workflow syntax fix
debdutdeb Apr 1, 2022
39621a4
Use single quotes in conditionals
debdutdeb Apr 1, 2022
2779f1b
Cancel running jobs if pr is updated
debdutdeb Apr 1, 2022
8651407
Add app/package-lock
debdutdeb Apr 1, 2022
dc97756
Add Jitsi component and support for Alumni Summit
Dnouv Apr 1, 2022
d3de9b2
Fixed speaker data
samad-yar-khan Apr 2, 2022
3993188
[ADD] emoji animations (#111)
irffanasiff Apr 2, 2022
b92330a
Remove duplicate import (#117)
abhinavkrin Apr 2, 2022
975b224
fix: build test deploy workflow (#119)
RonLek Apr 2, 2022
9d3297a
fix: build test deploy workflow
Apr 2, 2022
db9ada9
[FIX][IMPROVE] Tweaks on greenroom page (#116)
Dnouv Apr 2, 2022
49a3bbb
Use custom action for deployment because existing one was very annoying
debdutdeb Apr 2, 2022
0c11f05
cd update
debdutdeb Apr 2, 2022
6296663
Change download artifact path
debdutdeb Apr 2, 2022
4d6c7a8
Upload build iff it's a push to master
debdutdeb Apr 2, 2022
6541e17
Add next config to prod archive
debdutdeb Apr 3, 2022
79fde95
[FIX] Footer logo (#123)
samad-yar-khan Apr 3, 2022
4ccb6fd
[FIX] Add intro, networking and final notes slot to GSOC 2022 Summit …
dudanogueira Apr 4, 2022
33a649f
[FIX] Add Rudrank as Speaker, remove unnecessary content (#127)
dudanogueira Apr 4, 2022
39202ef
[IMPROVE] Change minor UI for mainstage (#124)
Dnouv Apr 4, 2022
37dc0de
Use environment variable for videostreamer source
debdutdeb Apr 4, 2022
f205791
Stop app before building archive
debdutdeb Apr 4, 2022
8780fb3
Fix fonts and layout
irffanasiff Apr 5, 2022
9e1cb9a
[IMPROVE] realtime emoji animation (#118)
sidmohanty11 Apr 5, 2022
d7c98d2
[NEW] Add Stream Source allocation based on IP region (#125)
Dnouv Apr 5, 2022
d3c064c
Favicon and Meta Data Update (#129)
samad-yar-khan Apr 5, 2022
e497a01
Welcome new contributor :) -- First NETWORKING slot with wrong dat…
dudanogueira Apr 5, 2022
4db8216
Disable ci for now
debdutdeb Apr 5, 2022
5bc4725
[FIX] GeoIp based server (#134)
Dnouv Apr 6, 2022
a22a174
Add Speaker (#135)
samad-yar-khan Apr 6, 2022
1db2b63
Reenable worklfow
debdutdeb Apr 6, 2022
77f97c6
Add bbb link for conference
debdutdeb Apr 6, 2022
b3f15f5
Add link (#136)
Dnouv Apr 6, 2022
cf81653
Some (#137)
Dnouv Apr 6, 2022
0b4228f
Fix final link infotile (#138)
Dnouv Apr 6, 2022
853f8c4
chore: changing community.liaison to open and keeping roomids for ina…
sidmohanty11 Apr 6, 2022
e3b38f3
[IMPROVE] Navbar DropDown UI Changes (#141)
nishant23122000 Apr 11, 2022
6dbe41c
increase wait time for cms startup
debdutdeb Apr 11, 2022
aa0fce6
modification
nik23122000 Apr 14, 2022
21704ff
added into strapi
nik23122000 Apr 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .exrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set shiftwidth=2
128 changes: 88 additions & 40 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Build and Test
name: "Build, Test, Deploy"

on:
pull_request: #{ types: [ready_for_review] }
push: { branches: [master] }
#release: { types: [published] }

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
BUILD_PATH: /tmp/archive.tgz
jobs:
bat:
runs-on: ubuntu-latest
if: false
strategy:
matrix: { node: [12, 14] }
matrix: { node: [14] }

steps:
- name: Clone repo
Expand All @@ -29,7 +34,7 @@ jobs:

- name: Start cms
run: cd cms; npm run develop &> /tmp/cms.log &
env: { INITIALIZE_DATA: 'true' }
env: { INITIALIZE_DATA: "true" }

- name: Check cms running
uses: actions/github-script@v5
Expand All @@ -41,7 +46,7 @@ jobs:
const http = require('http');
const {readFileSync} = require('fs');
core.info('waiting 1 minute for strapi data initialization to complete ..');
await new Promise(zzz => setTimeout(zzz, 60 * 1000));
await new Promise(zzz => setTimeout(zzz, 2 * 60 * 1000));
http
.request(`http://localhost:${process.env.PORT}/_health`, { method: 'HEAD' }, r => {
if (r.statusCode === 204 && r.headers.strapi === 'You are so French!')
Expand Down Expand Up @@ -81,7 +86,10 @@ jobs:
run: cd app && npm i --production

- name: Start app
run: cd app; npm run dev &>/tmp/app.log &
run: |
cd app
npm run dev &>/tmp/app.log &
echo $! > /tmp/app.pid

- name: Check app running
uses: actions/github-script@v5
Expand Down Expand Up @@ -123,37 +131,77 @@ jobs:
# echo "app successfully started"
# env: { PORT: 3000 }

# - name: Build app (scalable)
# run: cd app; npm run build
# env: { NEXT_PUBLIC_STRAPI_API_URL: 'http://localhost:1337' }

# - name: Build non-scalable app build archive
# run: cd app; tar zcvf /tmp/site.tgz out

# - name: Upload archive
# uses: actions/upload-artifact@v2
# with:
# name: non_scalable_build
# path: /tmp/site.tgz

# deploy:
# runs-on: ubuntu-latest
# if: github.event_name == 'release'
# needs: [bat]

# steps:
# - name: Get non-scalable build
# uses: actions/download-artifact@v2
# with:
# name: non_scalable_build
# path: /tmp/

# - name: Deploy
# uses: debdutdeb/rc4community.deploy.action@main
# with:
# remote_host: ${{ secrets.REMOTE_HOST }}
# remote_host_port: ${{ secrets.REMOTE_PORT }}
# ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
# remote_user: ${{ secrets.SSH_USER }}
# source: /tmp/site.tgz
# destination: ${{ secrets.DEPLOY_DESTINATION }}
- name: Build prod app
run: |
pkill -9 -F /tmp/app.pid
cd app; npm run build
env: { NEXT_PUBLIC_STRAPI_API_URL: "http://localhost:1337" }

- name: Generate archive
run: |
cd app
echo $GITHUB_SHA > /tmp/.github_sha
echo $GITHUB_REF > /tmp/.github_ref
tar zcvf ${{ env.BUILD_PATH }} \
.next \
ecosystem.config.js \
next.config.js \
package-lock.json \
package.json \
/tmp/.github_sha \
/tmp/.github_ref

- name: Upload archive
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v3
with:
name: build
path: ${{ env.BUILD_PATH }}

deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }} # don't wanna run on prs
needs: [bat]

steps:
- name: Download build archive
uses: actions/download-artifact@v3
with:
name: build
path: /tmp/

# - name: Push archive
# uses: easingthemes/ssh-deploy@main
# env:
# SOURCE: ${{ env.BUILD_PATH }}
# TARGET: ${{ secrets.TARGET }}
# REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
# REMOTE_USER: ${{ secrets.REMOTE_USER }}
# REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
#
# - name: Start remote service
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.REMOTE_HOST }}
# port: ${{ secrets.REMOTE_PORT }}
# username: ${{ secrets.REMOTE_USER }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# script: |
# target=${{ secrets.TARGET }}
# build_path=${{ secrets.BUILD_PATH }}
# cd $target
# tar zxf $build_path
# rm -f $build_path
# npm install --production
# pm2 reload ecosystem.config.js

- name: Push archive and start service
uses: debdutdeb/rc4community.deploy.action@main
with:
remote_host: ${{ secrets.REMOTE_HOST }}
remote_port: ${{ secrets.REMOTE_PORT }}
remote_user: ${{ secrets.REMOTE_USER }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
source: ${{ env.BUILD_PATH }}
target: ${{ secrets.TARGET }}
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
![build and grow massive online communities with rocket.chat](./assets/readme-banner.png)

![build and grow massive online communities with rocket.chat](./assets/readme-hero.png)

<h2 align='center'>🚀 Features 🚀</h2>
<ul>
<li>every part of the system scalable to handle from one to over a million online community members</li>
<li>engage your community at Rocket.Chat, Github, Discourse, Discord - wherever they may be</li>
<li>innovative reactJS components enhanced with fullstack behaviors</li>
<li>choice of Identity Management - popular SaaS (auth0, firebase) and open source (gluu, keycloak OpenID Connect)</li>
<li>full virtual conference handling</li>
<li>modern profile and superprofile factoring</li>
<li>supports flauna for scaled persistence</li>
<li>fine-grained full-stack optimization control - static, server side generation, per-request</li>
<li>designed for world-scale computing at the edge from day one</li>
<li>JAMStack and beyond, "no compromises" design</li>
<li>supports NextJS and Vercel pay-as-you-grow scaled deployments</li>
<li>easy assembly of reusable components for flexible adaptive systems</li>
<li>ultra-light-weight and re-imagined UX for next generation community builder / developer experience</li>
</uL>

<h2 align='center'>🚀 Community Builder quick start 🚀</h2>
<p align='center'> Customize - Deploy - Manage </p>

Expand All @@ -16,6 +34,7 @@ gitpod.io/#https://github.com/RocketChat/RC4Community

Start designing and customizing your community management system!


<h2 align='center'>🚀 Developer quick start 🚀</h2>
<p align='center'> Development - Build - Production </p>

Expand All @@ -25,10 +44,10 @@ During development, our data provider is a headless CMS, strapi.

Note that it is used only during development and build time, not during production.

By default, strapi listens on port 1337. If you're using WSL2 on Windows and also running Docker Desktop, port 1337 may not be available on your system. To use port 3000 instead, change this line in `config/server.js` file:
By default, strapi listens on port 1337. If you're using WSL2 on Windows and also running Docker Desktop, port 1337 may not be available on your system. To use port 3000 instead, set the environment variable `PORT` to 3000.

```
port: env.int('PORT', 3000),
export PORT=3000
```

Start strapi:
Expand Down
24 changes: 24 additions & 0 deletions app/.env.local.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,27 @@ NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
# for cookies signing
COOKIE_SECRET_CURRENT=
COOKIE_SECRET_PREVIOUS=

### BEGIN: Environment variables for keycloak
NEXTAUTH_SECRET="some random string for signing"
NEXTAUTH_URL="base url of rc4community"
KEYCLOAK_ID='keycloak client id'
KEYCLOAK_SECRET='keycloak client secret'
KEYCLOAK_ISSUER='http://localhost:8080/realms/{Realm Name}'
### END: Environment variables for keycloak

### BEGIN: Environment variables for RocketChat OAuth legacy
NEXTAUTH_SECRET="some random string for signing"
NEXTAUTH_URL="base url of rc4community"
ROCKETCHAT_CLIENT_ID="client id"
ROCKETCHAT_CLIENT_SECRET="client secret"
ROCKETCHAT_URL="base url of rocket chat server"
### END: Environment variables for RocketChat OAuth legacy

NEXT_PUBLIC_ROCKET_CHAT_GREENROOM_RTMP="rtmp://bkk.contribute.live-video.net/app/{stream_key}"

# STREAM-SOURCE-Environment

NEXT_PUBLIC_IPINFO_TOKEN = "6ea41123456765"
NEXT_PUBLIC_SERVER_STREAM_LINK0 = "https://{some_url}/hls/stream.m3u8"
NEXT_PUBLIC_SERVER_STREAM_LINK1 = "https://{some_other_url}/hls/stream.m3u8"
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ yarn-error.log*

# vercel
.vercel

41 changes: 41 additions & 0 deletions app/components/animation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import styles from '../styles/Mainstage.module.css';

function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}

const Animation = React.memo(() => {
console.log('animation rerendered');
return (
<span className={styles.track}>
{Array.apply(null, { length: 4 }).map(() => (
<p
className={styles.emojiAnimationContainer}
style={{
color: 'red',
overflow: 'hidden',
animationDelay: `${getRandomInt(2000)}ms`,
transform: `translate(${getRandomInt(40)}px, ${getRandomInt(0)}px)`,
}}
>
</p>
))}
{Array.apply(null, { length: 4 }).map(() => (
<p
className={styles.emojiAnimationContainer}
style={{
overflow: 'hidden',
animationDelay: `${getRandomInt(2000)}ms`,
transform: `translate(${getRandomInt(40)}px, ${getRandomInt(0)}px)`,
}}
>
👍
</p>
))}
</span>
);
});

export default Animation;
2 changes: 1 addition & 1 deletion app/components/auth/NoUserAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function NoUserAvatar({size,name}){
const char = name ? name.charAt(0) : null;
return (
<div
className="d-flex justify-content-center align-items-center"
className="d-flex justify-content-center align-items-center text-capitalize"
style={{
width: `${size}px`,
height: `${size}px`,
Expand Down
79 changes: 79 additions & 0 deletions app/components/auth/keycloak/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

### Keycloak configuration
1. Create an openid-connect client in Keycloak with "confidential" as the "Access Type". See [https://www.keycloak.org/docs/latest/server_admin/#_oidc_clients](https://www.keycloak.org/docs/latest/server_admin/#_oidc_clients).

2. To add profile picture attribute received from providers, You will have to create a mapper to set profile picture url into `picture` attribute.

### Set up
We have used `next-auth` npm package to configure keycloak authentication. Read more about it [here](https://next-auth.js.org/)

1. set up environment variables for firebase config in `.env.local`

```
### BEGIN: Environment variables for keycloak
NEXTAUTH_SECRET="some random string for signing"
NEXTAUTH_URL="http://localhost:3000"
KEYCLOAK_ID='keycloak client id'
KEYCLOAK_SECRET='keycloak client secret'
KEYCLOAK_ISSUER='http://localhost:8080/realms/{Realm Name}'
### END: Environment variables for keycloak
```

2. Wrap the app with `SessionProvider` in _app.js in the following way
```
import '/styles/globals.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import Layout from '../components/layout';
import SSRProvider from 'react-bootstrap/SSRProvider';
import {SessionProvider} from 'next-auth/react';

function MyApp({ Component, pageProps: {session, ...pageProps}}) {
return (
<SSRProvider>
<SessionProvider session={session}>
<Layout menu={pageProps}>
<Component {...pageProps} />
</Layout>
</SessionProvider>
</SSRProvider>
);
}

export default MyApp;

```
3. Add `KeycloakAuthMenuButton` in menubar.
```
...
import {KeycloakAuthMenuButton} from './auth/keycloak';
...

export default function Menubar(props) {
...

return (
<Container fluid className='border-bottom '>
<Navbar expand='lg' className=' bg-white mx-4 my-2'>
...
<div className="mx-1">
<KeycloakAuthMenuButton/>
</div>
</Navbar>
</Container>
);
}
```
4. Use `useSession()` webhook to get user data.
```
import { useSession } from "next-auth/react";
...
...
export default Component(){
const {data:session} = useSession();
if(!session)
return <div/>;
const user = session.user;
return <div>Hello ${user.name}</div>
}
```
5. Sign out using custom sign out function `signOutKC()`. This will sign out user from keycloak as well.
7 changes: 7 additions & 0 deletions app/components/auth/keycloak/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import keycloakAuthMenuButtonModule from "./ui/KeycloakAuthMenuButton";
import keycloakAuthUIModule from "./ui/KeycloakAuthUI";
import signOutKCModule from './lib/signOutKC';

export const KeycloakAuthMenuButton = keycloakAuthMenuButtonModule;
export const KeycloakAuthUI = keycloakAuthUIModule;
export const signOutKC = signOutKCModule;
Loading