πŸƒβ€β™‚οΈQuick start (for local usage)

How to quickly start the annotation-app on your machine. All the tools you will need, and manipulations you will have to do...

circle-info

Prerequisite: your machine must have Python (version 3.10 is recommanded as it was used for development).

An IDE like IntelliJ is also recommended as it can boot the application with a few clicks once it is configured.

The repo to git clone

Create a local database with MAMP

In order to store all the annotations, documents and user infos, we used a MySQL DB in local with MAMP. To do so just install MAMP on your machine.

MAMP download page

When MAMP is installed, run it and click on the 'Start Server' button. An Apache server and a MySQL server should start-up and you should be able to go to the page http://localhost/MAMP/arrow-up-right

Then go to TOOLS and phpMyAdmin.

Once in phpMyAdmin press Import on the top of the screen.

Upload this .sql file then press Go. e

SQL scripts that creates the annotation-app database

This script creates a new database named annotation-app with all the tables and relations the application needs. The SQL schema is given below :

annotation-app's database schema

That's it for the database part. Now we will configure the machine to run our Flask back-end locally.

Install the Flask API server

To communicate to the database via the client we use an API. This API is coded in Python with the Flask library. This choice was motivated by the fact that our application may need to do some image processing using OpenCV. In order to do that, we needed a server running in Python so Flask was the easiest choice as it permits us to do some request to the DB and some image processing functions as well if needed.

Installation

Once you have git cloned the annotation-app repo, go its directory in the terminal.

Create a Python Virtual Environnement

We will create a Python Virtual Environnement (venv) where we will install all the necessary libraries for our API.

You will notice that a venv directory just appear in server. It is perfectly normal as you just duplicated all the files to run an unique version of Python specifically for the annotation-app. We will now add all the necessary librairies.

Install all the necessary libraries

Now that our venv is created, we neeed to activate it / access it so when we install our libraries, we know that they were installed for our venv (and not our global Python installation on our machine, that could cause some dependencies issues).

Now if everything works you should see (venv) written at the begging of the new terminal line meaning that we are now working in our virtual environment. We can now install the librairies.

triangle-exclamation

Start the server

To start the server be sure that you start it up in the venv and run the server.py file.

The Flask server should be up and running. Good job !

Start the client 🌐

Next and final step you can finally start the client.

If you just wish to start it, a pre-builded version of the frontend is already usable by Flask and runs at your localhost:5000.

If you wish to edit the client, you will need to start a NodeJS developpment server. All the intructions to edit and build are here.

Here you will just open the already builded version of the client. You can find it in client/build. Just copy this build folder on a server and you can access the app with the adress of the server.

Last updated