- Joined
- Aug 11, 2013
- Messages
- 86
- Reaction score
- 9
Hi again,
You maybe remember I've published the StarMade Log Panel project some days ago. Even before this project started I've been working on a bigger one. It's in a early stage, but I've wanted to share it with you to get some feedback before going one step further, let me explain myself.
There are two real projects, a frontend developed with AngularJS that consumes the second one, a REST API developed in symfony. Now the REST API is nearly developed in a first iteration (more of this later), and the next step is to develop the frontend, which is now in a useless state, only an implementation of the official AngularJS tutorial.
The idea is to ask you, specially server administrators, what functionalities you may find useful for an administration page that (for now) will only let you read the game data.
For those who want to see code: https://github.com/thecko/starmadeadmin
Abstract
StarMade admin site is a web based tool to read and, in a future, manage your servers data. It allows you to list (and filter) several entities (ships, players, shops, etc.) and view the entity details.
Note: I've started this project to learn Symfony and AngularJS. Expect some oddities due to the ignorance of the programmer.
The REST API
I'm using Symfony Rest Edition (SRE), but for the particularities of StarMade data, I've developed an abstract repository to get the server data.
As you may know, StarMade stores the database entities in the server-database folder, a file per entity (with some exceptions like factions or the catalog). Reading directly the files for every query from the app will be slow, and may break something between the game. That's why I've developed a "cache" to store the game data, the Symfony app will query this cache and eventually will clear and regenerate it.
The SRE demo bundle uses a file in the symfony cache folder to store the demo data. My first iteration of the project used the same approach and creates a file per entity type (f.e. a file for all the ships). It worked, but it's not the best approach if you want to filter it because it stores all the data in memory.
Then I've decided to implement an abstract entity repository to let everyone to implement different database implementations. It's formed from two parts, the repository itself and an entity builder.
The repository is an abstract class that defines the methods to get the data (findAll, findById, etc.) and implements some methods to retrieve the data. For each file of the given type (ship, planet, etc.), it uses the builder to decode the data, build it, and then persists it.
The builder is a class that knows the internal structure of the file, decodes it (with the SMDecoder from BlackCancer), and returns a model filled with the entity data. By creating a builder per entity we can handle the special cases like the factions that works different.
First of all I've changed my previous code to use this new class hierarchy, storing the data in the Symfony cache folder, and once it worked, I've developed an ElasticSearch implementation. I think it's a great option because Elasticsearch is document oriented and created to perform searches, what's exactly what we'll do in the API.
Current state
The API can read the following entities:
Not all data is used now, I'm starting with some basic data and I expand the fields when necessary.
The API will work with an api key system, but it's not completely implemented (it needs an apikey param, but will work with any value).
The repository only implements the findAll (with pagination) and findById methods. Next I'll implement some kind of filtering to allow searches like "all ships whose name contains XXX".
My idea is to maintain both elasticsearch and file repositories to let any server admin to use for their server even if you don't want to use elasticsearch, but take into account that may fail if you have a lot of entities. Performance may be an issue with the searches also.
Frontend (AngularJS)
At this moment, this part is broken. I've started with the AngularJS tutorial and once implemented the service (the part where you connect to the REST API), I stopped working on it.
When the first file based version of the API was developed, I've started working in the ship list to allow pagination with the API (originally it retrieved all the rows and then you paginate client side, what was horrible for performance) and added the Angular UI Bootstrap dependency, a project that allows to link Twitter Bootstrap with AngularJS (and implements a pagination plugin).
At this point I'll implement the search function in the API and then in the frontend. From this point, the real app development will start.
My idea is to provide a generic solution to query the game files, then I've planned those modules:
Reports
Every server have rules. Some of them are related to limitations on entities. For example, we have a max mass rule for ships. But in the current state of the game, it's really hard to control, you need to check manually, you need reports from your users to know that there's a massive titan in the game, because there are not tools to detect some special cases.
The idea for the report part of the application is to generate some special reports that will let server administrators to detect easily those infractions, but it's not limited to this use case, and now is when I need you.
I need you to know what kind of reports you need to be able to create a report framework that allow to create those custom reports. Think in sentences like "I want to be able to list all the space stations that are X km from this sector".
You maybe remember I've published the StarMade Log Panel project some days ago. Even before this project started I've been working on a bigger one. It's in a early stage, but I've wanted to share it with you to get some feedback before going one step further, let me explain myself.
There are two real projects, a frontend developed with AngularJS that consumes the second one, a REST API developed in symfony. Now the REST API is nearly developed in a first iteration (more of this later), and the next step is to develop the frontend, which is now in a useless state, only an implementation of the official AngularJS tutorial.
The idea is to ask you, specially server administrators, what functionalities you may find useful for an administration page that (for now) will only let you read the game data.
For those who want to see code: https://github.com/thecko/starmadeadmin
Abstract
StarMade admin site is a web based tool to read and, in a future, manage your servers data. It allows you to list (and filter) several entities (ships, players, shops, etc.) and view the entity details.
Note: I've started this project to learn Symfony and AngularJS. Expect some oddities due to the ignorance of the programmer.
The REST API
I'm using Symfony Rest Edition (SRE), but for the particularities of StarMade data, I've developed an abstract repository to get the server data.
As you may know, StarMade stores the database entities in the server-database folder, a file per entity (with some exceptions like factions or the catalog). Reading directly the files for every query from the app will be slow, and may break something between the game. That's why I've developed a "cache" to store the game data, the Symfony app will query this cache and eventually will clear and regenerate it.
The SRE demo bundle uses a file in the symfony cache folder to store the demo data. My first iteration of the project used the same approach and creates a file per entity type (f.e. a file for all the ships). It worked, but it's not the best approach if you want to filter it because it stores all the data in memory.
Then I've decided to implement an abstract entity repository to let everyone to implement different database implementations. It's formed from two parts, the repository itself and an entity builder.
The repository is an abstract class that defines the methods to get the data (findAll, findById, etc.) and implements some methods to retrieve the data. For each file of the given type (ship, planet, etc.), it uses the builder to decode the data, build it, and then persists it.
The builder is a class that knows the internal structure of the file, decodes it (with the SMDecoder from BlackCancer), and returns a model filled with the entity data. By creating a builder per entity we can handle the special cases like the factions that works different.
First of all I've changed my previous code to use this new class hierarchy, storing the data in the Symfony cache folder, and once it worked, I've developed an ElasticSearch implementation. I think it's a great option because Elasticsearch is document oriented and created to perform searches, what's exactly what we'll do in the API.
Current state
The API can read the following entities:
- Ships
- Players
- Catalog
- Factions
- Planet
- Shops
- Server
Not all data is used now, I'm starting with some basic data and I expand the fields when necessary.
The API will work with an api key system, but it's not completely implemented (it needs an apikey param, but will work with any value).
The repository only implements the findAll (with pagination) and findById methods. Next I'll implement some kind of filtering to allow searches like "all ships whose name contains XXX".
My idea is to maintain both elasticsearch and file repositories to let any server admin to use for their server even if you don't want to use elasticsearch, but take into account that may fail if you have a lot of entities. Performance may be an issue with the searches also.
Frontend (AngularJS)
At this moment, this part is broken. I've started with the AngularJS tutorial and once implemented the service (the part where you connect to the REST API), I stopped working on it.
When the first file based version of the API was developed, I've started working in the ship list to allow pagination with the API (originally it retrieved all the rows and then you paginate client side, what was horrible for performance) and added the Angular UI Bootstrap dependency, a project that allows to link Twitter Bootstrap with AngularJS (and implements a pagination plugin).
At this point I'll implement the search function in the API and then in the frontend. From this point, the real app development will start.
My idea is to provide a generic solution to query the game files, then I've planned those modules:
- Entity list: For every entity type listed above, you'll be able to list with filters (initially by name)
- Entity detail: A page with the data from the entity
- Reports: TBD, see next.
Reports
Every server have rules. Some of them are related to limitations on entities. For example, we have a max mass rule for ships. But in the current state of the game, it's really hard to control, you need to check manually, you need reports from your users to know that there's a massive titan in the game, because there are not tools to detect some special cases.
The idea for the report part of the application is to generate some special reports that will let server administrators to detect easily those infractions, but it's not limited to this use case, and now is when I need you.
I need you to know what kind of reports you need to be able to create a report framework that allow to create those custom reports. Think in sentences like "I want to be able to list all the space stations that are X km from this sector".