Skip to content
Snippets Groups Projects

Archi Back

Back-end part for the Archi project.

Installation

First, download this repository and unzip it to the folder of your choice.

If you have Git client, you can also use the following command:

git clone https://gitlab.imt-atlantique.fr/FIL-A3-2024/ue-proj/archi-back.git

You will have to download Python here and install it on your computer.

Note: if the installer asks you to install pip package manager, say yes or check the box.

Then, use the included scripts to install Archi Back:

  • On Windows, launch setup.bat.

  • On Linux/macOS, open a terminal inside the directory of the project then write

chmod +x ./setup.sh && ./setup.sh

Configuration

The back-end part send requests to the HuggingFace API.

Follow these steps to connect your account to the back-end:

  1. Visit this page to create a new token (give it a name).
  2. When your token is created, you should see its value. Copy the value in .env file (replace hf_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with your token, make sure to keep hf_token= before!)
  3. Your back-end should now be linked to your HuggingFace account.

Usage

First, you should launch the back-end part:

  • On Windows, launch run.bat.

  • On Linux/macOS, open a terminal inside the directory of the project then write

chmod +x ./run.sh && ./run.sh

Then, launch the front-end part with the instructions available here.

Google Drive integration (optional)

If you want your results to be uploaded on Google Drive, you should configure a Google service account and a Google Drive folder shared with this account so it can upload your artworks.

Follow these steps (as Google Cloud Console is dense, you can click link for each step):

  1. Visit Google Cloud Console.
  2. Create a new project and give it a name.
  3. Enable Google Drive API for your project.
  4. Create a service account for your project and just give it a name (copy its email and keep it in a notepad before clicking "OK").
  5. Click on the newly created account inside the list, click on "Keys" tab, then on "Add key" button and "Create key". Check that "JSON" is selected and click "OK".
  6. Your key should have been downloaded. Rename it to "service_account.json".
  7. Copy the key inside the root folder of the project (archi-back).
  8. Create a new folder into Google Drive.
  9. Share this folder with the email of your service account (step 4, you can also find it here) with "Editor" permission level.
  10. Report the identifier of your Google Drive folder in .env file after drive_folder_id=.
  11. Your back-end should now be linked to your Google Drive account.

Authors

Renaud Birk and Anas Yakoubov

License

This project is licensed under GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007.