This repository contains the code and instructions that will help you deploy your first ONE Record Server. Please follow the instructions in order to get the application running.
Before deploying the server, you will need to update the application.properties
file with:
-
the credentials for accessing your MongoDB database. You can find the instructions on how to setup a MongoDB database below.
spring.data.mongodb.uri:mongodb+srv://<username>:<password>@<databaseURI>/<databaseName>?retryWrites=true&w=majority
-
path to a directory in which temporary certificates will be stored.
ocsp.cachedDir=C:\\
For testing the application locally, follow the next steps:
- Install
Java >= 8
andMaven
. - Install the Maven dependencies by running
mvn clean install
- (Optional) Download the latest ONE Record Turtle ontologies from Github + the latest Web Access Control from W3C by running
mvn exec:java
. - (Optional) Generate ONE Record cargo related data model by running
mvn package -Dbuild=cargo
- (Optional) Generate ONE Record API related models by running
mvn package -Dbuild=api
- (Optional) Generate W3C Web Access Control ACL (Access Control List) related models by running
mvn package -Dbuild=acl
- Run the server from OneRecordApplication or from the command line via
mvn spring-boot:run
. Your application should be available at https://localhost:8443.
Swagger API Documentation can be accessed and tested via https://yourserverurl/swagger-ui.html. If you run the server locally, Swagger documentation can be accessed via https://localhost:8443/swagger-ui.html.
ONE Record Server uses a MongoDB database. In order to setup quickly your own MongoDB environment, we suggest you to use a cloud database service such as MongoDB Atlas.
- To get started with MongoDB Atlas, follow these steps.
- Add your database URL to
application.properties
file:'spring.data.mongodb.uri': 'mongodb+srv://<username>:<password>@<databaseURI>/<databaseName>?retryWrites=true&w=majority'
You can find further information about ONE Record specifications here.