2020-05-04 15:20:36 +00:00
|
|
|
---
|
|
|
|
layout: default
|
|
|
|
parent: For developers
|
|
|
|
title: Installation
|
|
|
|
nav_order: 1
|
|
|
|
---
|
|
|
|
|
|
|
|
Installation
|
|
|
|
============
|
|
|
|
|
2020-06-12 18:58:37 +00:00
|
|
|
Download this repo and install the dependencies.
|
2019-12-13 16:56:19 +00:00
|
|
|
|
|
|
|
Application dependencies
|
|
|
|
------------------------
|
2020-05-04 15:20:36 +00:00
|
|
|
|
2019-12-13 16:56:19 +00:00
|
|
|
The application uses [Pipenv][pipenv] to manage Python packages.
|
2020-06-12 18:58:37 +00:00
|
|
|
While in development, you will need to install all dependencies:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ pipenv shell
|
|
|
|
$ pipenv install --dev
|
|
|
|
```
|
|
|
|
|
|
|
|
You will need to set the variables in `.env.example`, and rename the file to `.env`.
|
2019-12-13 16:56:19 +00:00
|
|
|
|
2020-06-12 18:58:37 +00:00
|
|
|
![Files](https://i.imgur.com/ri2zOe8.png)
|
2019-12-13 16:56:19 +00:00
|
|
|
|
2020-06-12 18:58:37 +00:00
|
|
|
You might also need to install additional packages, depending on the [backend wallets](../guide/wallets.md) you configured.
|
|
|
|
E.g. when you want to use LND you have to `pipenv install lnd-grpc`.
|
|
|
|
|
|
|
|
Take a look at [Polar](https://lightningpolar.com/) for an excellent way of spinning up a Lightning Network dev environment.
|
2020-05-04 15:20:36 +00:00
|
|
|
|
2019-12-13 16:56:19 +00:00
|
|
|
Running the server
|
|
|
|
------------------
|
|
|
|
|
2020-06-12 18:58:37 +00:00
|
|
|
LNbits uses [Flask](http://flask.pocoo.org/) as an application server.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ pipenv run flask migrate
|
|
|
|
$ pipenv run flask run
|
|
|
|
```
|
2019-12-13 16:56:19 +00:00
|
|
|
|
|
|
|
There is an environment variable called `FLASK_ENV` that has to be set to `development`
|
|
|
|
if you want to run Flask in debug mode with autoreload
|
|
|
|
|
2020-06-12 18:58:37 +00:00
|
|
|
[pipenv]: https://pipenv.pypa.io/
|
|
|
|
|
|
|
|
Frontend
|
|
|
|
--------
|
2019-12-13 16:56:19 +00:00
|
|
|
|
2020-06-12 18:58:37 +00:00
|
|
|
The views are build using [Vue.js and Quasar](https://quasar.dev/start/how-to-use-vue).
|