Skip to content

A fully customizable backend server for Flick using Ktor.

License

Notifications You must be signed in to change notification settings

Ikutsu/Flick-Ktor

Repository files navigation

Flick-Ktor

A fully customizable backend server for Flick using Ktor.

About

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.

Frameworks

  • Database - MongoDB
  • Network - Ktor
  • API - REST API
  • Realtime connection - WebSocket

API Documentation

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.

Building

Requirements

  • MongoDB Database (can be hosted on your own or use MongoDB Atlas)

Steps

  1. Clone the repository
  2. Open the project in IntelliJ IDEA (or any other IDE, but the build process may differ)
  3. 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)
}
  1. Change the values to your own values (the ones with *required are required to be changed)
  2. 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.

  1. Build and run the project

Deployment

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.

About

A fully customizable backend server for Flick using Ktor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages