Follow these steps to set up the project:
git clone [email protected]:algobot76/surabaya.git
cd surabaya
cp scripts/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
cd surabaya-site
./mvnw clean install
cd ..
cd surabaya-client
yarn install
To start the backend program:
- Go to the
surabaya-site
sub-directory - Run
./mvnw spring-boot:run
To start the frontend program:
- Go to the
surabaya-client
sub-directory - Run
yarn start
If you are using IntelliJ IDEA, please install this plugin that provides formatter support: spring-io/spring-javaformat.
To run the entire app using Docker:
- Go to the project root directory.
- Run
docker-compose up
Use JavaParser and convert the outputted AST into the custom classes described below.
packages
: map of package name to Package objects
{ [key: string]: Package }
files
: list of File objects
classes
: list of Class objectsimports
: list of imported package names
name
: class nametype
:Interface
,Abstract Class
,Class
accessModifier
: AccessModifier enumlineCount
: number of linesfields
: list of Field objectsmethods
: list of Method objectsconstructors
: list of Constructor objectssupertypes
: list of class or interface names that this class/interface extends/implements
name
: field nametype
: field typeaccessModifier
: AccessModifier enum
name
: method nameaccessModifier
: AccessModifier enumparameters
: list of Parameter objectsreturnType
: return type (e.g.int
)src
: raw source code string
name
: constructor nameaccessModifier
: AccessModifier enumparameters
: list of Parameter objectssrc
: raw source code string
name
: parameter nametype
: parameter type
An AccessModifier
is private
, public
, or protected
.
Representation of JavaProject
in JSON:
{
"packages": {
"p1": {
"files": [
{
"classes": [
{
"name": "C1",
"type": "Interface",
"accessModifier": "private",
"lineCount": 100,
"fields": [
{
"name": "foo",
"type": "String",
"access_modifier": "public"
},
{
"name": "bar",
"type": "int",
"access_modifier": "private"
}
],
"methods": [
{
"name": "getBar",
"access_modifier": "public",
"parameters": [],
"return_type": "int",
"src": "public int getBar(){ return this.bar }"
},
{
"name": "setFoo",
"access_modifier": "public",
"parameters": [
{
"name": "foo",
"type": "String"
}
],
"return_type": "void",
"src": "public void setFoo(String foo){ this.foo = foo; } "
}
],
"constructors": [
{
"name": "C1",
"access_modifier": "public",
"parameters": [
{
"name": "foo",
"type": "String"
},
{
"name": "bar",
"type": "int"
}
],
"src": "public C1(String foo, int bar) { this.foo = foo; this.bar = bar; }"
}
]
}
],
"imports": ["p2.ex2", "p2.ex3"]
}
]
}
}
}
- Project = Map of islands
- Class = Island (size is determined by number of lines of code)
public
= Regularprivate
= Wooden fenceprotected
= Aluminum fence
- Field
- Primitive
boolean
= Tree- Numeric (
int
,double
, etc.) = Pond
- Non-primitive
- String = Evergreen
- Collection
- A collection of things will be visualized as multiple icons. For example, an array of
int
will be visualized as multiple ponds.
- A collection of things will be visualized as multiple icons. For example, an array of
- Other (e.g.
Object
) = Stone
- Primitive
- Method = Factory
- Constructor = Volcano