Server - Project structure
Back to ezysmashers1. Modules
- ezysmashers-admin-plugin: provides views/APIs used in the administration interface to manage everything in game
- ezysmashers-common: common components shared between admin, socket, and web plugins
- ezysmashers-socket-app: provides real-time game APIs for end-users (e.g., room APIs, player APIs, game play APIs, etc).
- ezysmashers-socket-plugin: being used for user authentication or background tasks, or other tasks related to the admin
- ezysmashers-theme: provides landing page, end-user interface and can also offer HTTP APIs
- ezysmashers-web-plugin: offers HTTP APIs
This structure follows the generic EzyPlatform Structure
2. Folders
Each module's folders are generally structured as follows:- module-name
- src
main/java
: the standard location for Java source code filesmain/resources
: store non-Java resources needed by the application. Examples include configuration files, XML files, properties files, images, etc.test/java
: houses the Java source code for tests. Typically follows a parallel structure tosrc/main/java
to mirror the application code being tested.test/resources
: contains resources specifically for tests. Similar to src/main/resources, but for test-related files.
- src
3. Code Structure
- ezysmashers-admin-plugin/src/main/java
- org.youngmonkeys.ezysmashers.admin
- config: initial game configurations, e.g., default data
- constant: constant values or enumerations specific to admin
- controller: view/APIs used in admin dashboard, e.g, unity config management
- manager: admin managers like file system manager
- request: client requests used in controllers, typically represent a request body
- org.youngmonkeys.ezysmashers.admin
- ezysmashers-common/src/main/java
- org.youngmonkeys.ezysmashers.common
- constant: constant values or enumerations shared between all modules
- converter: convert entity to model, model to entity, request to model, etc.
- model: objects used in service layer
- repo: jpa repositories to communicate with databse
- service: handle game/business logics common to admin/web/socket
- org.youngmonkeys.ezysmashers.common
- ezysmashers-socket-app/src/main/java
- org.youngmonkeys.ezysmashers.socket.app
- config: configures some common beans widely used in socket app
- constant: constant values or enumerations specific to socket app
- controller: handles incoming real-time requests
- converter: converts between different data types (request, model, entity) specific to the socket app
- event: events and event handlers used in the socket app
- exception: includes exception classes, providing meaningful error handling
- factory: creates instances of some game objects
- game:
- entity: game entities, which are normally kept in memory
- service: handles game logics
- util: contains utility classes used in game logics
- model: contains data models used in service layer
- repo: contains jpa repository classes to communicate with database
- request: contains client real-time requests used in controller layer
- response: contains server real-time responses to the client
- service: handles business logics specific to the socket app
- org.youngmonkeys.ezysmashers.socket.app
- ezysmashers-socket-plugin/src/main/java
- org.youngmonkeys.ezysmashers.socket.plugin
- controller: handles user authentication
- org.youngmonkeys.ezysmashers.socket.plugin
- ezysmashers-theme/src/main/java
- org.youngmonkeys.ezysmashers.socket.web
- controller: provides end-user interfaces including game landing page, how-to-play page, account page, etc
- org.youngmonkeys.ezysmashers.socket.web
- ezysmashers-web-plugin/src/main/java
- org.youngmonkeys.ezysmashers.socket.web
- controller: offers HTTP APIs
- converter: converts between different data types (request, model, entity) specific to the web plugin
- exception: includes exception classes, providing meaningful HTTP error handling
- interceptor: handle HTTP user authentication
- repo: contains jpa repository classes to communicate with database
- response: contains HTTP responses to the client
- result: contains classes representing database query results
- service: handle HTTP business logics
- validator: validates incoming HTTP requests
- view: responsible to decorate user authentication information to views
- org.youngmonkeys.ezysmashers.socket.web