This is the backend server for Flick using Ktor. It is a fully customizable server that can be used to host your own Flick server.
This project uses OpenAPI to document the API.
The documentation can be found at localhost:8080/swagger-ui/index.html
once the server is running.
- MongoDB Database (can be hosted on your own or use MongoDB Atlas)
- Clone the repository
- Open the project in IntelliJ IDEA (or any other IDE, but the build process may differ)
- Open the
application.conf
file and you will see the following:
ktor {
deployment {
port = 8080 // Change this to the port you want to run the server on
}
application {
modules = [com.ikuzMirel.ApplicationKt.module]
}
}
jwt {
issuer = "https://example.com" // Change this to your domain
domain = "https://example.com" // Change this to your domain
audience = "users"
realm = "Flick" // Change this to your app name
}
mongo {
uri = "mongodb://<username>:<password>@localhost:27017" // Change this to your MongoDB Uri (*required)
}
- Change the values to your own values (the ones with
*required
are required to be changed) - Edit the run configuration for Application.kt and add the following to the environment variables:
JWT_SECRET=<Your JWT secret>;MONGO_PW=<Your MongoDB Password>;MONGO_USER=<Your MongoDB Username>
Tips: If you want to store your MongoDB credentials in environment variables, you have to replace the values in
application.conf
with<username>
and<password>
respectively. If you are not using MongoDB authentication, you can just ignore adding them.
- Build and run the project
If you want to deploy it on a cloud server, you can follow this guide: Deploying Ktor. Some of the steps may not be necessary, but it is a good guide to follow.