-
Notifications
You must be signed in to change notification settings - Fork 8
Local backend development
danslapman edited this page Jun 5, 2023
·
8 revisions
Here's a small guide about how to build & run mockingbird locally.
To run mockingbird in any variant on your personal machine, you'll need a running mongodb instance.
Follow the following steps:
- Install JDK 17. JDK vendor doesn't matter, you can use your preferred distribution.
- Download frontend artifacts from one of the latest workflow runs
- Create
/dist/outdirectory in/frontenddirectory and unpack artifact archive into it - Create
local.conffile in/backend/mockingbird/src/main/resources(this path is already git-ignored). Here is a minimal example of configuration file:
include classpath("application.conf")
ru.tinkoff.tcb {
db {
mongo {
uri = "mongodb://localhost:27017/localdb" <- URI of you mongodb instance/cluster
}
}
security {
secret = "..."
}
}
- Go to
/backenddirectory - Run
sbt "project mockingbird-api; run"
Follow the following steps:
- Install GraalVM or Liberica NIK.
- Install
native-imagemodule viagu - Download frontend artifacts from one of the latest workflow runs
- Create
/dist/outdirectory in/frontenddirectory and unpack artifact archive into it - Go to
/backenddirectory - Run
sbt "project mockingbird-native; GraalVMNativeImage / packageBin" - Create
qa.confin/mockingbird-native/target/graalvm-native-imagewith the following contents:
include classpath("application.conf")
include file("./mockingbird-native/target/graalvm-native-image/secrets.conf")
ru.tinkoff.tcb {
db.mongo = ${?secrets.mongodb}
server = ${?secrets.server}
security = ${secrets.security}
proxy = ${?secrets.proxy}
event = ${?secrets.event}
}
- Create
secrets.confin/mockingbird-native/target/graalvm-native-imagewith the following contents:
secrets {
mongodb {
"uri": "mongodb://localhost:27017/localdb"
}
security {
secret = "..."
}
}
- Assuming you are in
/backenddirectory, run./mockingbird-native/target/graalvm-native-image/mockingbird-native -Dconfig.file=./mockingbird-native/target/graalvm-native-image/qa.conf