Skip to content

mouseTube/mousetube_API

Repository files navigation

MouseTube API

Build Passing Python 3.8+ Django 4.0+ Django REST framework 3.12+ Documentation License: GPL v3

Mousetube

What is mouseTube?

MouseTube is a database designed to facilitate sharing, archiving, and analyzing raw recording files of rodent ultrasonic vocalizations following the FAIR (Findable, Accessible, Interoperable, Reusable) principles (Wilkinson et al., 2016).

Installation

1. Create a Python environment

We recommend creating a virtual environment to isolate the project's dependencies.

# Create a virtual environment
python3 -m venv .venv

# Activate it
# On Linux/macOS:
source .venv/bin/activate

2. Create a .env file

Create a .env file at the root of the project and fill in the following variables:

DEBUG=
ALLOWED_HOSTS=
DB_ENGINE=django.db.backends.mysql
DB_ROOT_PASS=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=127.0.0.1
DB_PORT=3306
DB_SSL=True

3. Install and start MariaDB

Before proceeding, ensure that MariaDB is installed and running. If it's not installed, use the following commands:

# Install MariaDB (if not already done)
sudo apt-get update
sudo apt-get install mariadb-server

# Start the MariaDB service
sudo systemctl start mariadb

# Verify MariaDB is running
sudo systemctl status mariadb

4. Install system dependencies

You will need to install some system dependencies before installing mousetube_api:

# Install necessary dependencies for MariaDB integration
sudo apt-get install pkg-config
sudo apt-get install libmariadb-dev

5. Install Python dependencies

Once the system dependencies are installed, install mousetube_api and its Python dependencies:

pip install -e .

6. Run the server in development mode

Finally, start the Django development server:

mousetube_api runserver

Docker Alternative FullStack Installation

  1. Clone the repositories:

    git clone https://github.com/mouseTube/mousetube_APIv0-5.git
    git clone https://github.com/mouseTube/mousetube_frontendv0-5.git
  2. Add a .env file in the mousetube_APIv0-5 folder as described earlier in the section "2. Create a .env file".

  3. Add a .env file in the mousetube_frontendv0-5 folder with the following content:

    DEBUG=true
    NUXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8000/api
  4. Navigate to the mousetube_APIv0-5 folder and run the following command to build the Docker image and start all required services:

    docker compose up --build

Docker Stop and Clean Up

To stop the running containers:

docker compose down

To stop and remove all containers, networks, and volumes created by Docker Compose:

docker compose down -v

To remove all unused Docker images and free up space (optional):

docker image prune -a

⚠️ Warning: docker image prune -a will remove all images not currently used by any container. Use it only if you're sure you don't need them anymore.

Check out mouseTube's publications:

  • Torquet N., de Chaumont F., Faure P., Bourgeron T., Ey E. mouseTube – a database to collaboratively unravel mouse ultrasonic communication [version 1; peer review: 2 approved]. F1000Research 2016, 5:2332 (F1000Research Link) (2016).

About

MouseTube backend version 1

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages