Giter Club home page Giter Club logo

osmose-app's Introduction

OsmoseApp

Continuous integration Code style: black

In this repository there are actually 2 projets : APLOSE software and OSmOSE team's website. The backend is shared by the 2 projects but is located in distincts Django apps.

APLOSE

APLOSE is a scalable web-based annotation tool for marine bioacoustics. It allows the annotations of audio spectrograms. It is currently used for marine bioacoustics studies but its usage can be extended to all kind of acousitc studies.

APLOSE is composed of a React frontend, located in "frontend" folder, and a Django backend, located in the "backend" folder ("api" app).

OSmOSE team's website

OSmOSE team's website is composed of a React frontend, located in "website" folder, and a Django backend, located in the "backend" folder ("osmosewebsite" app).


Deployment

For Ifremer infrastructure follow the comments in the .gitlab-ci.yml file, otherwise use the docker-compose.yml file (you should create a .env file with the required variables, see possible variables).

Development

This project uses poetry (pip install poetry) for Python dev and npm for Javascript dev.

Setup

Backend:

# Initial setup
poetry install
docker run --name devdb -e POSTGRES_PASSWORD=postgres -p 127.0.0.1:5432:5432 -d postgis/postgis
docker start devdb
poetry run ./manage.py migrate
poetry run ./manage.py seed

# Run
docker start devdb
poetry run ./manage.py runserver

Frontend:

# Initial setup
cd frontend
npm install
# Run
npm run dev

Testing

# Run backend & frontend tests
docker start devdb
poetry run ./manage.py test
cd frontend; npm test

# Run backend coverage
coverage run ./manage.py test && coverage report
# You can also get an html report in the htmlcov folder
coverage html

Cypress testing

We use Cypress for end to end testing. Examples of cypress tests are kept in frontend/cypress/examples, they should be deleted once we have a solid E2E test base.

cd frontend
# Run Cypress test runner
./node_modules/.bin/cypress open

Before pushing to github

# Be sure not to forget any migrations
poetry run ./manage.py makemigrations
# You should run Pylint regularly when coding to get tips and avoid bad patterns
poetry run pylint backend
# Also don't forget to use black in order to unify code style
poetry run black backend

Tooling & maintenance

To update a package to a specific version do not directly edit the pyproject.toml file but rather use the following command:

poetry add --group dev "pylint==2.14.5"

Here --group dev because this is a dev tool, if it's a library to also be used in production you can drop that option.

If you want to changes pylint rules, the configuration options are in the pyproject.toml file.

Formatting :

If you use VSCode, you can add "python.formatting.provider": "black" to your .vscode/settings.json

Possible .env variable

ENV=                # either "development" or "production", used for backend.api.settings
STAGING=            # "true" if we are in staging, used in backend/start.sh to install dev libraries
SECRET_KEY=         # see https://docs.djangoproject.com/en/3.2/ref/settings/#secret-key
OSMOSE_HOST=        # "osmose.ifremer.fr" for production, use what you want for staging and localhost
OSMOSE_DB_USER=     # database username
OSMOSE_DB_PWD=      # database password
HTTPS_PORTAL_STAGE= # see https://github.com/SteveLTN/https-portal, use "local" to test on your machine
OSMOSE_SENTRY_URL=  # if you use https://sentry.io (more for staging and production)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.