On this tutorial, we are going to explain how to execute the application with Open Source tools: Eclipse Spring Tool Suite 3 and Visual Studio Code. You can use others if you want to. Pre-requisites: Java and MySQL server installed on your machine.
Tutorial to install MySQL (in Spanish) step by step
First of all, download the last version of the Licensoft repository.
- Download Spring Tool Suite 3.
- Open backend folder on STS.
- Set the properties
- Run as Spring Boot application.
You can configure the database url, user and pass on the application.properties.
- Download and install Node.js and npm
- Download and install Angular CLI:
npm install -g @angular/cli
on the console - Download and install Visual Studio Code
- Open Angular project on your IDE(Frontend folder)
- Set the proxy properties
- Run
npm install
and then,ng serve --proxy-config proxy.conf.json
. The app will be running on http://localhost:4200
On the application.properties
file inside the backend folder (src/main/resources).
Example application.properties
spring.datasource.url=jdbc:mysql://localhost/nameOfYourScheme?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UC
spring.datasource.username=root
spring.datasource.password=passOfYourMySQLConnection
spring.jpa.hibernate.ddl-auto=update
stripe.privateKey=sk_***
stripe.publicKey=pk_***
appName=LicenSoft
app.domain=http://localhost:4200/#
adminEmail=***@email.com
adminName=***
adminPass=***
# Must be Gmail
spring.mail.username=***@gmail.com
spring.mail.password=***
# Next 4 properties can't be changed
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
# 8443 for HTTPS, 80 for HTTP.
server.port=8443/80
# [Only if HTTPS]Best path: src/main/resources (classpath)
server.ssl.key-store=classpath:keystore.jks
# [Only if HTTPS] Password and Secret for the default selfsigned certificate by the author
server.ssl.key-store-password=password
server.ssl.key-password=secret
# Path of the private.key for RSA algorithm
licencheck.keys.private=.../private.key
We use a proxy.conf.js file to redirect all the requests made to /api/* to the URL of the backend (it will vary depending if backend is deployed under http or https). proxy.conf.js for HTTP:
{
"/api/*": {
"target": "http://localhost:80/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}
proxy.conf.js for HTTPS:
{
"/api/*": {
"target": "https://localhost:8443/",
"secure": true,
"changeOrigin": true,
"logLevel": "debug"
}
}
- Name (String)
- Description (String)
- WebLink (String)
- Licenses (License[])
- TypeSubs (String[])
- PhotoAvailable (boolean)
- PlansPrices (Map<String, Number>)
- Plans (Map<String,String>)
- Sku (String)
- Active (boolean)
- ProductStripeId (String)
- TrialDays (int)
- Mode (String)
- Serial (String)
- Active (boolean)
- Type (String)
- Product
- StartDate (Date)
- Owner (String)
- Price (double)
- LicenseString (String)
- Trial (boolean)
- CancelAtEnd (boolean)
- SubscriptionItemId (String)
- SubscriptionId (String)
- NUsage (int)
- EndDate (Date)
- Period (Integer)
Object with statistics of a License (by ip)
- License (License)
- Ip (String)
- NUsage (int)
- LastUsage (Date)
- Usages (List)
- UserName (String)
- UsagePerTime (Map<String,Integer>)
- Period (Integer)
- Email (String)
- Name (String)
- Roles (String[])
- Password (String - hashed)
- UserStripeId (String)
- Last4 (int)
- ExpMonth (int)
- ExpYear (int)
- ProductName (String)