Skip to content

Installation guide

Welcome to the Sign app developers team! This guide will assist you in setting up your development environment.

Requirements Flutter and Python

Here are all the items that must be present on your local machine to get started. Of course, if you only want to work on one part, not all items are necessary. For example, if you only want to work on the app, you only need to have Flutter installed.

We're assuming that you've got Git and an IDE all set up. If you're not sure which IDE to use, no worries! We recommend PyCharm for Python and Android Studio for Flutter.

  1. Install the Flutter SDK from the official Flutter website. Choose the link for your operating system and follow the instructions. Or use Android studio to install Flutter.

  2. Make sure you have Python installed. Check your Python version with the following command

    python --version 
    
    Version 3.8, 3.9, 3.10 and 3.11 are acceptable as these versions are compatible with Django 4.1

  3. Check if pip is installed with the following command:

    pip --version
    
    If pip is not installed look at the official pip website for an installation guide for you operating system.

  4. Optional but recommended is installing a virtual environment for python like virtualenv.

Setting up the Project

  1. Clone or download the project source code from the project's GitHub repository. For example:
    git clone git@github.com:Signbank/sign-app.git
    

Flutter

  1. Set up the Flutter app by opening the project folder in a code editor and running flutter pub get in the terminal to install any required packages.

  2. In the Flutter app code, update the url_config file to switch between localhost and the server. For example:

    bool _signAppLocalhost = true
    
    This will make sure the app uses the local Django server.

  3. Run the Flutter app on an emulator or physical device by running flutter run in the terminal or through Android studio. The app should be able to communicate with the local Django server and fetch data from the API endpoints.

Django

  1. Create a virtual environment

    virtualenv env 
    

  2. Activate the virtual environment

    source env/bin/activate
    

  3. Set up the Django backend by navigating to the backend folder (called django) in the terminal and running python manage.py migrate to create the database tables. Optionally, you can create a superuser account by running python manage.py createsuperuser.

  4. Install the required packages by running the following command:

    pip -r install requirements.txt
    

  5. Set up Django secrete key by creating a .env file in the signapp directory. You can create this file with the following command on unix systems:

    touch signapp/.env
    
    NOTE: It is a hidden file so enable hidden files in your file explorer or use ls -a command to see it.

  6. Add the following line to the .env file:

    SECRET_KEY = 'django-insecure-super-ultra-secret-key'
    
    For local development the key can be any string.

  7. Run the Django server by running python manage.py runserver in the terminal. The server will start at http://localhost:8000/.

Documentation

  1. Install MkDocs Material with the following command:

    pip install mkdocs-material
    

  2. Run the server:

    mkdocs serve
    

  3. Edit and save the documentation markdown files and see you changes at http://localhost:8000/.

Server

  1. Follow these steps to setup apache on the LXD container. On step 7 add the folliwing line instead of the one in the guide:
ProxyPass /api http:localhost:8000/

This redirects all api traffic to Django localhost.

  1. Build a Flutter web app with the following command:

    flutter build web
    

  2. Place the contents of the flutter web build on the server in the /var/www/html directory and remove the default index.html.