# Diskuy Backend ## Tentang Aplikasi Diskuy adalah sebuah aplikasi forum berbasis web. Thread-thread diskusi dengan topic yang bermacam-macam. Pengguna diwajibkan untuk mebuat akun apabila pengguna ingin mebuat topic, thread dan komen baru. ## Cara Menjalankan Aplikasi (Development) Cara menyalakan server Phoenix untuk aplikasi ini : * Install dependencies dengan `mix deps.get` * Setup file ```config/dev.exs``` dan isi credential username dan password user pada database postgresql. * Buat dan lakukan migrate pada database dengan `mix ecto.setup` * Nyalakan server Phoenix dengan `mix phx.server` Sekarang anda bisa mengakses [`localhost:4000`](http://localhost:4000) dari browser anda. Sudah ready untuk dijalankan di production? Mohon [lihat deployment guide berikut ini](https://hexdocs.pm/phoenix/deployment.html). ## Build Production Docker Image 1. Build Image dengan perintah berikujt ```docker build -t diskuy_backend .``` ### Deploy Production 1. Build Docker image sesuai dengan perintah Build DockerImage diatas 2. Isi Environment Variable pada ``` config/docker.env``` sesuai dengan Environtment yang sudah disediakan. ```shell SECRET_KEY_BASE=REALLY_LONG_SECRET GUARDIAN_SECRET_KEY_BASE=REALLY_LONG_SECRET DATABASE_HOST=db DATABASE_URL=ecto://postgres:postgres@db/postgres PORT=4000 HOSTNAME=localhost POSTGRES_PASSWORD=postgres LANG=en_US.UTF-8s ``` 3. Jalankan command ```docker-compose up``` untuk mendeploy Backend server. 4. Backend server dapat diakses pada http://localshost 5. Jalankan command ```docker-compose down``` untuk menghentikan server ## Pelajari lebih lanjut * Official website: https://www.phoenixframework.org/ * Guides: https://hexdocs.pm/phoenix/overview.html * Docs: https://hexdocs.pm/phoenix * Forum: https://elixirforum.com/c/phoenix-forum * Source: https://github.com/phoenixframework/phoenix ## Authors Kelompok 18 * Fadhil Pradipta - 1806205344 * Jonathan - 1806204985 * Muhammad Rafif Elfazri- 1806205722 * Ryo Axton Lie - 1806205571 ## Acknowledgements * CS UI - Functional Programming 2020