Skip to content

I2PC/xmipp-portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XMIPP-Portal

Website: https://xmipp.i2pc.es

Overview

XMIPP-Portal is a web-based application designed for ahving a main portal for xmipp, link to the full documentation and visualzie the metrics of installations of Xmipp.


Local Development Setup

1. Clone the Repository

git clone [email protected]:I2PC/xmipp-portal.git
cd xmipp-portal

2. Configure Environment

  • Copy the .env file provided (refer to the documentation for details), a template is available on the repo as .env.template.

3. Create Environment

  • Use the provided xmipp-portal.yml file to set up the Conda environment:
    conda env create -f xmipp-portal.yml

4. Install Database

Install MariaDB server and client:

sudo apt install mariadb-client-core-10.6
sudo apt-get install mariadb-server

5. Create logger folder and privilege

Activate the environment and run migrations:

mkdir /var/log/django
sudo chmod go+w /var/log/django

6. Create xmipp user for the mariaDB

Acces mysql service from an admin user (mysql -u 'user' -p)

 CREATE DATABASE xmippportal;
 CREATE USER 'xmipp'@'localhost' IDENTIFIED BY 'pass';
 GRANT ALL PRIVILEGES ON xmippportal.* TO 'xmipp'@'localhost';

7. For develope propose

Add this lines in the setting.py :

import pymysql
pymysql.install_as_MySQLdb()

8. Apply Database Migrations

Activate the environment and run migrations:

conda activate xmipp-portal
python manage.py makemigrations
python manage.py migrate

9. Create superuser

Run the local server:

python manage.py createsuperuser
user: superuser
mail: [email protected]
password: 

10. Start Development Server

Run the local server:

python manage.py runserver

Service Management

Restarting the Service

To restart the service:

su root
sudo systemctl restart xmipp-portal

Hosting Information

The application is hosted on the Asimov server.


Updating the Application

  1. Push changes to the devel branch.
  2. If there are changes in MySQL tables:
    • Restart Asimov to reload the application:
      su root
      sudo systemctl restart xmipp-portal
    • A service will automatically relaunch the page.

Code Structure

  • api/: Contains the API logic, including views and serializers for handling server-side requests and responses. Uses Django's REST framework.
  • main/: Main directory with essential Django configuration and core files.
  • web/: Frontend assets including HTML templates, CSS, and JavaScript files for the user interface.

Key Configuration Files

  • .gitignore: Specifies files and directories to exclude from Git.
  • LICENSE: Contains the project license (GPL-3.0).
  • Procfile: Defines commands for running the application in deployment environments (e.g., Heroku).
  • README.md: Documentation for setting up and running the project.
  • manage.py: Django CLI tool for administrative tasks.
  • requirements.txt: List of Python dependencies for the project.

Documentation

Full documentation is available here.


License

This project is licensed under GPL-3.0.