1 - Add secret configuration file in src/main/resources/conf/secret.conf whit the following content :
swagger.access.password = "XXXXXXXXXXXXXXX"
# Binance Lecture
# api.binance.key.public = "XXXXXXXXXXXXXXX"
# api.binance.key.secret = "XXXXXXXXXXXXXXX"
# Binance Lecture & Ecriture
api.binance.key.public = "XXXXXXXXXXXXXXX"
api.binance.key.secret = "XXXXXXXXXXXXXXX"
# SLACK
# Url du channel "XXXXXXXXXXXXXXX"
api.slack.url = "XXXXXXXXXXXXXXX"
api.slack.token = "XXXXXXXXXXXXXXX"
Welcome to your Plume project! Here are some reminders to get your project up and running.
Install Lombok: http://jnb.ociweb.com/jnb/jnbJan2010.html#installation
Just run the fr.lelouet.WebApplication
class, you can then open your browser to http://localhost:8080.
The configuration file is located in src/main/resources/application.conf
.
If you have any doubt, check out the configuration documentation.
To connect to a database, the Plume Querydsl module must be configured:
- Setup the database connector in the
pom.xml
file (look for the "PUT YOUR DATABASE CONNECTOR HERE" comment - Setup the database connection parameters in the
application.conf
file, see the Plume Querydsl documentation for details - Add the Plume Querydsl module in the Guice configuration class
ApplicationModule
by uncommenting the lineinstall(new GuiceQuerydslModule());
To generate classes corresponding to the database tables,
you can run the fr.lelouet.db.QuerydslGenerator.main()
method.
Before the first run, do not forget to configure
the TABLES_PREFIX
constant in QuerydslGenerator
, to match your tables prefix.
For example, if your tables are named abc_film
and abc_actor
, then your prefix will be abc_
.
See the detailed documentations:
To completly get rid of the database component:
- Remove the line
install(new GuiceQuerydslModule());
in theApplicationModule
class, - Remove the package
db
in the project, - Remove the dependencies
plume-db-querydsl
andplume-db-querydsl-codegen
in thepom.xml
file.
Swagger is pre-configured to provide documentation about the project web-services.
This documentation is protected by credentials that should be configured in the application.conf
file.
To access this documentation, start the project
and go to http://localhost:8080/webjars/swagger-ui/4.1.2/index.html?url=/api/swagger.
As a reminder, the default Swagger credentials are: swagger//password
.
- Plume Mail: send mails,
- Plume Scheduler: schedule recurring Java jobs/tasks,
- Plume Admin: web-service with a security layer to create an admin area,
- Plume Admin AngularJs: an administration HTML/JS UI that use Plume Admin,
- Plume File: manage and serve files,
- Plume File Gallery: manage medias galleries.
Check the demo project to see an example with these modules.
In the default mode, when mvn package
is executed, a zip files is generated.
This file contains all the projects jar files and startup BAT/Bash files.
These startup files will not work since they are built only for Play Framework.
This solution is not ideal, eventually we should make our own Maven plugin
so that the startup files works correctly with Plume Framework.
If appserver
is used, then configure the server with export SERVER=javazip
,
it will correctly build and launch the project.
If not there are 3 solutions:
- switch back to the WAR file generation: see the Plume War archetype,
- create a maven plugin like
play2-maven-plugin
that produce Plume compatible startup scripts (if you choose this option, please share your work :), - replace in the
pom.xml
file theplay2-maven-plugin
and themaven-jar-plugin
plugins by
<!-- single jar executable with all dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>fr.lelouet.WebApplication</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
With this solution, mvn package
will produce an executable jar file.
Note that this last solution may produce side effects: files that share the same name can be overriden.
However all Plume modules will work as expected with this solution.
/**
* Info trade:
* "base asset" refers to the asset that is the "quantity" of a symbol. For the symbol BTCUSDT, BTC would be the base asset.
* "quote asset" refers to the asset that is the "price" of a symbol. For the symbol BTCUSDT, USDT would be the quote asset.
*/
/**
* Base endpoint without auth for market info :
* The base endpoint https://data.binance.com can be used to access the following API endpoints that have NONE as security type:
* GET /api/v3/aggTrades
* GET /api/v3/avgPrice
* GET /api/v3/depth
* GET /api/v3/exchangeInfo
* GET /api/v3/klines
* GET /api/v3/ping
* GET /api/v3/ticker
* GET /api/v3/ticker/24hr
* GET /api/v3/ticker/bookTicker
* GET /api/v3/ticker/price
* GET /api/v3/time
* GET /api/v3/trades
* GET /api/v3/uiKlines
*/