Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
276 commits
Select commit Hold shift + click to select a range
3073a0f
refactor(*): layout
Jan 22, 2023
bbf5e6e
refactor(header): menu and more searchboxes instead of modal
Jan 22, 2023
1113f62
fix(*): layout
Jan 23, 2023
3a75237
fix(*): heights
Jan 23, 2023
f124bda
feat(*): .nvmrc
Jan 24, 2023
69ebfd8
fix(*): scrollbar styling
Jan 27, 2023
7fc83e3
fix(*): unnecessary code
Jan 27, 2023
e4e0ca7
refactor(accordion): file tree skeleton
Jan 27, 2023
7608ec1
feat(*): thrift workspace service integration
Jan 30, 2023
9c9289f
refactor(*): workspace context
Jan 31, 2023
3f804cf
feat(*): connect project service
Jan 31, 2023
e2f3649
feat(*): connect file content and file info
Jan 31, 2023
7c4b113
feat(accordion): tree view
Jan 31, 2023
a7212c2
fix(file-tree): navigation
Jan 31, 2023
f1af0da
build: integrate new web gui into build system
mcserep Feb 3, 2023
bd48e1b
Merge pull request #1 from mcserep/new-frontend
mdeme01 Feb 6, 2023
221be2e
refactor(*): build, npm
Feb 7, 2023
51a0e36
refactor(*): thrift-typescript usage
Feb 7, 2023
c4c6224
chore(npm): remove unused packages
Feb 8, 2023
52f8535
fix(*): generate thrift files at build
Feb 9, 2023
ad1f248
refactor(*): .gitignore
Feb 9, 2023
41d2188
fix(*): build
Feb 9, 2023
a4c09eb
refactor(*): styling
Feb 10, 2023
309bbe5
feat(*): multiple projects
Feb 10, 2023
6240a3b
fix(*): display placeholder with no file selected
Feb 10, 2023
e9eb99d
feat(*): use localstorage to save data
Feb 10, 2023
c4ea206
fix(*): clear localstorage on project change
Feb 10, 2023
6638d6c
feat(*): config file
Feb 12, 2023
bb5d6f0
fix(*): localstorage issues
Feb 12, 2023
cba8037
fix(id): localstorage
Feb 12, 2023
fc9b803
fix(*): build, nextjs static export
Feb 13, 2023
9c4e4a2
refactor(*): do not use dynamic route
Feb 13, 2023
c7e4a44
fix(project): unnecessary useeffect
Feb 13, 2023
15de9be
fix(*): save workspace to localstorage
Feb 13, 2023
0e1cba9
fix(cmake): move and overwrite build directory
Feb 14, 2023
81338cc
fix(file-tree): styling
Feb 14, 2023
e84e84f
feat(file-tree): store expanded nodes
Feb 15, 2023
6c5ee3c
refactor(*): project service client
Feb 15, 2023
6a6e43a
fix(file-tree): file tree not rendering
Feb 15, 2023
c4d0640
fix(file-tree): display selected file
Feb 15, 2023
a990e70
fix(file-tree): performance issues
Feb 15, 2023
c7d1d03
fix(*): colors
Feb 15, 2023
ffe107e
feat(*): sync file manager views
Feb 15, 2023
4c51ed6
fix(*): styling
Feb 15, 2023
5096281
fix(theme): scrollbar styling
Feb 16, 2023
221a830
feat(*): README, dotenv
Feb 16, 2023
25c1664
fix(*): HTML export
Feb 18, 2023
2c10f92
fix(config): missing properties
Feb 18, 2023
73388bf
feat(file-tree): display loading
Feb 18, 2023
4deacaf
refactor(file-tree): rename component
Feb 19, 2023
e4771e6
refactor(*): file-tree
Feb 20, 2023
61a0e5e
refactor(*): do not render grandchild nodes
Feb 21, 2023
0447dd4
fix(*): render expanded nodes
Feb 21, 2023
864cfe7
fix(*): file view sync
Feb 22, 2023
b71e8dc
fix(*): navigate back
Feb 22, 2023
e88c94e
fix(*): styling
Feb 22, 2023
2834d00
Merge pull request #2 from mdeme01/file-tree-refactor
mdeme01 Feb 22, 2023
8215bf2
fix(*): index page styling
Feb 22, 2023
aa1167c
refactor(*): context controllers, file manager
Feb 25, 2023
6adb52e
fix(*): build request url, symbolic link
Feb 27, 2023
c7395e2
fix(*): project client connection
Feb 28, 2023
dd51226
refactor(*): thrift codegen, build
Mar 1, 2023
f10e25d
fix(*): project client init
Mar 1, 2023
20c16ed
feat(*): init git client
Mar 3, 2023
f9e3ae1
fix(project): unnecessary useeffect, imports
Mar 3, 2023
f0bafde
fix(*): styling, inconsistent imports
Mar 3, 2023
2c7f1c0
feat(*): add tab menu
Mar 4, 2023
f04503b
feat(*): search client init
Mar 5, 2023
5407af7
refactor(*): thrift generation
Mar 5, 2023
a072027
Merge branch 'new-frontend' into search-service-client
Mar 5, 2023
039e77e
refactor(header): unnecessary menu
Mar 5, 2023
61fa8b6
Merge branch 'new-frontend' into search-service-client
Mar 5, 2023
76ddc3b
feat(*): search results
Mar 5, 2023
f09e97e
fix(results): expanded nodes
Mar 5, 2023
2edc47d
feat(*): save expanded nodes
Mar 5, 2023
ab881da
feat(*): pagination
Mar 7, 2023
b54e0d5
feat(*): pagination search
Mar 7, 2023
225b4d3
feat(*): definition search, file name search
Mar 8, 2023
f949010
feat(*): search filters, language search
Mar 9, 2023
a99f8b6
refactor(*): client connection, config
Mar 10, 2023
3c01de5
Merge branch 'new-frontend' into search-service-client
Mar 10, 2023
12d4491
fix(*): config undef check
Mar 10, 2023
2e69264
Merge branch 'new-frontend' into search-service-client
Mar 10, 2023
ddf61af
fix(search-service): missing check
Mar 10, 2023
6e63e80
fix(_app): incorrect controller order
Mar 10, 2023
980b8c3
Merge branch 'new-frontend' into search-service-client
Mar 10, 2023
385f017
fix(config): pathname
Mar 10, 2023
998face
Merge branch 'new-frontend' into search-service-client
Mar 10, 2023
c4cae43
fix(*): search results
Mar 11, 2023
2123663
fix(_app): controller order
Mar 11, 2023
63e0d06
refactor(*): unnecessary searchPage state
Mar 12, 2023
401293c
refactor(*): localstorage
Mar 12, 2023
6d44924
feat(*): matching result selection
Mar 13, 2023
4df2b85
feat(*): selected result visible, styling
Mar 13, 2023
8bcd441
fix(results): set files & folderpath on click
Mar 13, 2023
8809466
fix(results): onclick
Mar 13, 2023
51ad9bf
feat(*): get actual search result count
Mar 13, 2023
9cb451a
Merge branch 'new-frontend' into search-service-client
Mar 13, 2023
a220b70
Merge pull request #3 from mdeme01/search-service-client
mdeme01 Mar 13, 2023
e0ebdfe
fix(*): search query, store search languages, styling
Mar 14, 2023
7b8cc7e
fix(menu): select styling
Mar 14, 2023
550279c
fix(config): remove unnecessary .env variable
Mar 16, 2023
a6fc140
feat(*): create metrics service
Mar 16, 2023
8d59daf
feat(*): generate diagrams
Mar 17, 2023
72b69d1
feat(*): legend, additional diagrams
Mar 20, 2023
5309b7b
feat(*): custom context menu for files
Mar 20, 2023
bf4ec97
feat(*): language ctx, remove ctx menu, refactor file tree, generate …
Mar 21, 2023
bee3774
feat(*): save, export, scale diagram
Mar 21, 2023
805aa47
refactor(*): diagram gen, now with ctx menu
Mar 21, 2023
cfc88b1
feat(*): metrics options
Mar 21, 2023
b1ab194
feat(*): generate metrics treemap
Mar 23, 2023
37c9915
feat(*): zoom-pan on diagram
Mar 23, 2023
7754da2
fix(project-ctx): unnecessary import
Mar 23, 2023
e0f6d7c
Merge pull request #4 from mdeme01/diagrams-and-metrics-service
mdeme01 Mar 23, 2023
cc4b5a2
feat(*): cpp service methods
Mar 24, 2023
74fb2e8
feat(*): basic info tree
Mar 27, 2023
8fb850d
fix(search-results): expanded nodes undef check
Mar 27, 2023
a32f504
Merge pull request #5 from mdeme01/new-frontend
mdeme01 Mar 27, 2023
77b6302
Merge branch 'Ericsson:master' into master
mdeme01 Mar 27, 2023
90b10a6
feat(*): jump to reference, selection
Mar 27, 2023
ea132e6
fix(*): info tree references
Mar 30, 2023
b7f9b7b
feat(*): file references
Mar 30, 2023
6c98b97
feat(*): categorize refs by files
Mar 31, 2023
b604673
feat(*): jump to current node ref
Mar 31, 2023
53ea21e
feat(*): diagrams for astNodes, fixes
Mar 31, 2023
a34713c
feat(*): prepare copy selection feature
Mar 31, 2023
0fb14d8
feat(editor-context): get ast html
Apr 2, 2023
54d5885
feat(editor-context): jump to definition
Apr 4, 2023
7f7e2ae
Merge pull request #6 from mdeme01/info-tree
mdeme01 Apr 4, 2023
9e86213
Merge branch 'new-frontend' into git-service-client
Apr 4, 2023
b4f1f98
feat(service): git service methods
Apr 4, 2023
d25e092
feat(*): repos, branches, tags, commits view
Apr 4, 2023
e064e43
feat(*): git diff view
Apr 5, 2023
dcdfbec
fix(revision-controll.tsx): remove unnecessary comment
Apr 5, 2023
004130b
refactor(*): git url params, don't preload data
Apr 6, 2023
0091f8d
refactor(*): separate codemirror component
Apr 6, 2023
f478581
Merge pull request #7 from mdeme01/git-service-client
mdeme01 Apr 6, 2023
d3a2e16
refactor(git-ctx): use ctx instead of url params
Apr 7, 2023
9473f6f
feat(*): copy selection link
Apr 7, 2023
20543ad
fix(codemirror): editor width & height
Apr 7, 2023
e442304
refactor(file-manager): merge the two file views into one file, do no…
Apr 7, 2023
085adc1
refactor(project-ctx): remove unnecessary vars
Apr 7, 2023
d604d07
refactor(*): use one context component instead of multiple ones, adju…
Apr 8, 2023
081fd70
refactor(*): separate search related ctx variables, adjust changes in…
Apr 8, 2023
539bedc
fix(*): diff viewer theme, reset states on project change, file tree …
Apr 10, 2023
c31184d
Merge pull request #8 from mdeme01/refactoring
mdeme01 Apr 10, 2023
be39eaa
fix(editor): selection dispatch
Apr 11, 2023
90b4192
refactor(metrics): container size, colors
Apr 11, 2023
1f812b4
fix(*): remove unnecessary local storage, reset router after load
Apr 11, 2023
e36d7b3
feat(diagrams): set fileinfo/astnodeinfo on diagram node click
Apr 11, 2023
6dddde0
fix(diagrams): unnecessary 'entityType' state
Apr 12, 2023
3d5beec
feat(*): create components for welcome, user guide and credits tabs
Apr 12, 2023
30ba7eb
fix(git-diff): commit summary styling
Apr 13, 2023
bdc36e2
fix(editor-context-menu): display docs correctly
Apr 13, 2023
2de379b
refactor(*): diagram generation, appCtx - separate router effect, sto…
Apr 14, 2023
c445571
fix(build): remove unnecessary build changes
Apr 14, 2023
6d77c0c
fix(context-menus): do not display 'Diagrams' option if no diagrams a…
Apr 14, 2023
e24ba59
fix(proj-select): workspaces undef check
Apr 16, 2023
b368e26
Merge pull request #9 from mdeme01/new-frontend
mdeme01 Apr 16, 2023
90c57a5
fix(*): fix metrics treemap + add path navigation, highlight only the…
Apr 20, 2023
a55bbcb
feat(*): custom icon component
Apr 20, 2023
e80d148
feat(*): git icons, file icons, info tree icons (more to be added)
Apr 21, 2023
c824caa
feat(*): add missing icons, icon colors
Apr 22, 2023
ca580fb
refactor(*): styling, code formatting
Apr 23, 2023
4ad2bca
reset(remover.sh): reset file to previous commit
Apr 23, 2023
f0b7976
feat(config): add eslint react config
Apr 24, 2023
5b485d1
refactor(.gitignore): create separate gitignore
Apr 24, 2023
7e3f10b
fix(.gitignore): reset to previous commit
Apr 24, 2023
135b7ac
fix(codemirror): selection
Apr 24, 2023
e62d969
feat(*): display source texts
Apr 24, 2023
2e43316
fix(package.json): mui lab version
Apr 25, 2023
741054d
Merge branch 'new-frontend' of github.com:mdeme01/CodeCompass into ne…
Apr 25, 2023
9e6b218
refactor(cmake): commands
Apr 25, 2023
6f95b18
refactor(env): use only one .env variable: BACKEND_URL
Apr 25, 2023
6cbdc43
feat(old webgui header): add option to switch to new webgui
Apr 25, 2023
544fcee
Merge pull request #10 from mdeme01/new-frontend
mdeme01 Apr 25, 2023
8d87d14
Merge branch 'new-frontend' into codebites
Apr 25, 2023
0b8255c
feat(*): connect nodes
Apr 25, 2023
ebd9c9c
fix(codebites-node): check if new node is undefined
Apr 25, 2023
5228d50
Merge pull request #11 from mdeme01/codebites
mdeme01 Apr 26, 2023
fd7df9e
feat(*): prepare git blame feature
Apr 26, 2023
9d918d5
refactor(*): do not use runtime .env variables
Apr 26, 2023
3756fc5
Merge pull request #12 from mdeme01/new-frontend
mdeme01 Apr 26, 2023
e4b8ed7
feat(*): overwrite the next.js devserver with a proxy server - it doe…
Apr 27, 2023
4855111
feat(*): display git blame
Apr 27, 2023
4fff384
Merge pull request #13 from mdeme01/new-frontend
mdeme01 Apr 27, 2023
96e4d7b
fix(*): git blame request
Apr 27, 2023
97006bf
Merge pull request #14 from mdeme01/new-frontend
mdeme01 Apr 27, 2023
7229ee0
Merge branch 'new-frontend' into proxy-server
Apr 28, 2023
5006b4b
fix(*): proxy only the 'Service' requests properly
Apr 28, 2023
7ee236c
Merge pull request #15 from mdeme01/proxy-server
mdeme01 Apr 28, 2023
53781a6
update readme
Apr 28, 2023
a47d147
Merge pull request #16 from mdeme01/new-frontend
mdeme01 Apr 28, 2023
aad3b7d
fix: use pathname instead of origin in link to new UI
mdeme01 May 3, 2023
56c1583
fix(file-manager): add jump to source button
May 3, 2023
b633014
fix(file-manager): add jump to root option
May 3, 2023
e755f7c
Merge pull request #17 from mdeme01/new-frontend
mdeme01 May 3, 2023
c8b7a47
fix(next-config): add additional path to basepath and prefix
May 4, 2023
7fdb055
refactor(*): move settings states from appctx into diagrams
May 4, 2023
106d0ea
fix(*): selection link
May 4, 2023
8d5572a
Docker support to have a good version of Node.js.
intjftw May 4, 2023
5a5a672
fix(*): eslint config and eslint errors
May 4, 2023
94295e3
Merge pull request #18 from mdeme01/new-frontend
mdeme01 May 4, 2023
79dd61f
Merge remote-tracking branch 'mdeme01/master' into mdeme01-master
intjftw May 4, 2023
b5249cf
Merge pull request #20 from mdeme01/new-frontend
mdeme01 May 4, 2023
93391b7
refactor(styles): separate styled components
May 5, 2023
32cf54d
Merge pull request #21 from mdeme01/new-frontend
mdeme01 May 5, 2023
94c3e70
refactor(*): add more plugins to eslint, add JSX.Element type enforce…
May 5, 2023
f9a2314
Merge pull request #22 from mdeme01/new-frontend
mdeme01 May 5, 2023
51e9924
fix(service): add missing try-catches and error logging
May 5, 2023
c35c82e
Merge pull request #23 from mdeme01/new-frontend
mdeme01 May 5, 2023
3312fe6
feat(*): add react-toastify
May 6, 2023
daa5c82
Merge pull request #24 from mdeme01/new-frontend
mdeme01 May 6, 2023
a0cc7e0
feat(*): add user guide
May 12, 2023
7eb27b4
Merge pull request #25 from mdeme01/new-frontend
mdeme01 May 12, 2023
b119e9a
feat(*): share URL
May 23, 2023
654cc31
fix(*): allow selection and git blame in unparsed files
May 23, 2023
b79573a
fix(*): codebites node line number offset
May 23, 2023
79da65b
fix(codebites): more consistent react flow layout with dagre tree
May 25, 2023
dab4664
fix(cmake): use relative path at symlink creation
Jun 6, 2023
b43b8eb
feat(git blame): color commit label on hover for better visibility
Jun 6, 2023
3f1b8ed
fix(cmake): copy .env file
Jun 8, 2023
e43f917
Merge branch 'new-frontend' of github.com:mdeme01/CodeCompass into ne…
Jun 8, 2023
8df0ab3
Merge branch 'Ericsson:master' into master
mdeme01 Jun 9, 2023
3551e52
Merge branch 'Ericsson:master' into master
mdeme01 Jun 10, 2023
e233b07
fix(code editor): error at astnodeinfo if file is of type unknown, hi…
Jun 12, 2023
09c2871
fix(file-manager): directory switching on right click
Jun 12, 2023
b8512e6
fix(*): add global state for diagram type to avoid error
Jun 13, 2023
9ee0413
feat(service): add error toasts for user relevant methods
Jun 13, 2023
3662677
fix(user-guide): bad ul placement, styling, text
Jun 13, 2023
82978bf
Merge pull request #26 from mdeme01/new-frontend
mdeme01 Jun 13, 2023
7606c00
refactor(codebites): usereactflow hook to update the diagram, delete …
Jun 17, 2023
275bc6e
Merge pull request #27 from mdeme01/new-frontend
mdeme01 Jun 17, 2023
5a23330
Merge branch 'new-frontend' into persistent-urls
Jun 18, 2023
5b6c993
feat(*): persistent url params
Jun 19, 2023
f344a6c
fix(*): git blame and astnode selection conflict, remove astnode sele…
Jun 19, 2023
d6079a2
fix(appcontext): unnecessary check
Jun 19, 2023
2185975
fix(header): remove unnecessary 'copy url' button
Jun 19, 2023
8118d6b
Merge branch 'Ericsson:master' into persistent-urls
mdeme01 Jun 19, 2023
f451d00
Merge branch 'Ericsson:master' into new-frontend
mdeme01 Jun 19, 2023
0867c7e
fix(header styles): remove unnecessary style
Jun 20, 2023
6b87d84
Merge branch 'persistent-urls' of github.com:mdeme01/CodeCompass into…
Jun 20, 2023
2d45076
fix(appctx): workspaces state type
Jun 20, 2023
1fa3839
Merge pull request #28 from mdeme01/persistent-urls
mdeme01 Jun 20, 2023
9cee906
Merge branch 'Ericsson:master' into master
mdeme01 Jun 20, 2023
ff64db1
fix(.env): public url empty by default
Jun 20, 2023
69dac9d
Merge pull request #29 from mdeme01/new-frontend
mdeme01 Jun 20, 2023
188ed75
refactor(gitblame): do not use gutter for gitblame, create separate c…
Jun 20, 2023
543ba27
fix(gitblame): line heights, context menu not disappearing on git bla…
Jun 20, 2023
529e95a
Merge pull request #30 from mdeme01/new-frontend
mdeme01 Jun 20, 2023
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ add_subdirectory(service)
add_subdirectory(util)
add_subdirectory(plugins) # must precede webgui
add_subdirectory(webgui)
add_subdirectory(webgui-new)
add_subdirectory(webserver)

# Install java libraries
Expand Down
3 changes: 3 additions & 0 deletions Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ set(INSTALL_AUTH_DIR "${INSTALL_LIB_DIR}/${INSTALL_AUTH_DIR_NAME}")
# Installation directory of web GUI
set(INSTALL_WEBROOT_DIR "${CMAKE_INSTALL_PREFIX}/share/codecompass/webgui")

# Installation directory of the new React-based web GUI
set(INSTALL_WEBROOT_REACT_DIR "${CMAKE_INSTALL_PREFIX}/share/codecompass/webgui-new")

# Installation directory of SQL files
set(INSTALL_SQL_DIR "${CMAKE_INSTALL_PREFIX}/share/codecompass/sql")

Expand Down
4 changes: 4 additions & 0 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN set -x && apt-get update -qq \
cmake make \
default-jdk \
ctags \
curl \
doxygen \
gcc-9 gcc-9-plugin-dev g++-9 \
libboost-filesystem-dev \
Expand All @@ -31,6 +32,9 @@ RUN set -x && apt-get update -qq \
ln -s /usr/bin/gcc-9 /usr/bin/gcc && \
ln -s /usr/bin/g++-9 /usr/bin/g++

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs

# Build GTest.
RUN cd /usr/src/googletest && \
mkdir build && \
Expand Down
4 changes: 4 additions & 0 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ RUN set -x && apt-get update -qq \
# To switch user and exec command.
gosu \
tini \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& set +x

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs

ARG CC_GID=960
ARG CC_UID=960

Expand Down
3 changes: 3 additions & 0 deletions webgui-new/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PUBLIC_URL=
BACKEND_URL=http://localhost:8080
DEVSERVER_PORT=3000
14 changes: 14 additions & 0 deletions webgui-new/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react-hooks"],
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended"
],
"globals": {
"JSX": true
}
}
37 changes: 37 additions & 0 deletions webgui-new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/

# production
build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# thrift generated files
generated/
1 change: 1 addition & 0 deletions webgui-new/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.13.0
20 changes: 20 additions & 0 deletions webgui-new/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
install(DIRECTORY
public src
DESTINATION ${INSTALL_WEBROOT_REACT_DIR}/app
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "[^.]*")

install(FILES
tsconfig.json
next.config.js
thrift-codegen.sh
.env
DESTINATION ${INSTALL_WEBROOT_REACT_DIR}/app)

# Install React application
install(CODE "set(CC_PACKAGE \"${CMAKE_CURRENT_SOURCE_DIR}/package.json\")")
install(CODE "set(INSTALL_WEBROOT_DIR ${INSTALL_WEBROOT_DIR})")
install(CODE "set(INSTALL_WEBROOT_REACT_DIR ${INSTALL_WEBROOT_REACT_DIR})")
install(CODE "set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})")
install(CODE "set(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})")
install(SCRIPT InstallReact.cmake)
45 changes: 45 additions & 0 deletions webgui-new/InstallReact.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Utility functions
include(${CMAKE_SOURCE_DIR}/Functions.cmake)

message("Install npm packages...")

if(${CC_PACKAGE} IS_NEWER_THAN ${INSTALL_WEBROOT_REACT_DIR}/app/package.json)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${CC_PACKAGE} ${INSTALL_WEBROOT_REACT_DIR}/app/package.json
WORKING_DIRECTORY ${INSTALL_WEBROOT_REACT_DIR})

execute_process(
COMMAND npm install
WORKING_DIRECTORY ${INSTALL_WEBROOT_REACT_DIR}/app)
endif()

message("Installation of npm packages are finished.")

# Generate TypeScript from Thrift
execute_process(
COMMAND bash -c "chmod +x thrift-codegen.sh"
WORKING_DIRECTORY ${INSTALL_WEBROOT_REACT_DIR}/app)

execute_process(
COMMAND bash thrift-codegen.sh --thrift-source ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${INSTALL_WEBROOT_REACT_DIR}/app)

message("Building React App...")

execute_process(
COMMAND npm run build
WORKING_DIRECTORY ${INSTALL_WEBROOT_REACT_DIR}/app)

# Move build directory out of application directory
file(REMOVE_RECURSE ${INSTALL_WEBROOT_REACT_DIR}/out)
file(RENAME ${INSTALL_WEBROOT_REACT_DIR}/app/out ${INSTALL_WEBROOT_REACT_DIR}/out)

# Create symbolic link
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../webgui-new/out ${INSTALL_WEBROOT_DIR}/new)

if (CMAKE_BUILD_TYPE STREQUAL "Release")
# Remove application source code in case of Release build
file(REMOVE ${INSTALL_WEBROOT_REACT_DIR}/app)
endif()

message("Building React App finished.")
62 changes: 62 additions & 0 deletions webgui-new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# New Web GUI development guide

## Prerequisites

Make sure you are using at least version 18 of [Node.js](https://nodejs.org/en/).\
You can also download [nvm](https://github.com/nvm-sh/nvm), and run `nvm install` at the root of the project to use the specified Node version (18.13.0).

## Development

Run the webserver with:

```bash
cd <path-to-webserver-binary> && ./CodeCompass_webserver -w <path-to-workspace-folder> -p <port>
```

Install npm packages with:

```bash
npm install
```

Generate TypeScript files from Thrift by running the following command:

```bash
chmod +x thrift-codegen.sh && ./thrift-codegen.sh --thrift-source ../
```

You can set the URL of the webserver (`BACKEND_URL`) and the port of the development server (`DEVSERVER_PORT`) by creating a `.env.local` file at the root of the project. This will override the variables in the `.env` file.\
The default value is `http://localhost:8080` for the webserver URL and `3000` for the port of the development server, as seen in the `.env` file.

```py
# .env.local
BACKEND_URL=
DEVSERVER_PORT=
```

After this, you can run the development server with:

```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.\
(Make sure to open the URL with the correct port if you chose to override the port for the devserver.)

## Learn More

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Build and Install

For building and installing the application, or parsing projects, please refer to the [CodeCompass README](/README.md) documentations and development sections.\
(Note: For development, use SQLite as a database for parsing projects.)

After installing, the current webgui will still be available at the root URL of the webserver (`/`), but you can also reach the new webgui at (`/new`).
18 changes: 18 additions & 0 deletions webgui-new/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require('dotenv').config();

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
},
trailingSlash: true,
...(process.env.NODE_ENV === 'production' && {
assetPrefix: `${process.env.PUBLIC_URL || ''}/new`,
basePath: `${process.env.PUBLIC_URL || ''}/new`,
}),
};

module.exports = nextConfig;
Loading