-
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/out
directory in/frontend
directory and unpack artifact archive into it - Create
local.conf
file 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
/backend
directory - Run
sbt "project mockingbird-api; run"
Follow the following steps:
- Install GraalVM or Liberica NIK.
- Install
native-image
module viagu
- Download frontend artifacts from one of the latest workflow runs
- Create
/dist/out
directory in/frontend
directory and unpack artifact archive into it - Go to
/backend
directory - Run
sbt "project mockingbird-native; GraalVMNativeImage / packageBin"
- Create
qa.conf
in/mockingbird-native/target/graalvm-native-image
with 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.conf
in/mockingbird-native/target/graalvm-native-image
with the following contents:
secrets {
mongodb {
"uri": "mongodb://localhost:27017/localdb"
}
security {
secret = "..."
}
}
- Assuming you are in
/backend
directory, run./mockingbird-native/target/graalvm-native-image/mockingbird-native -Dconfig.file=./mockingbird-native/target/graalvm-native-image/qa.conf