The PAML Editor (PAMLED) is a web application that supports the authoring and sharing of PAML protocols. PAMLED consists of two components: frontend
and backend
. The frontend is a React-based server for handling the graphical interface. The backend is a Django REST server that handles persistent storage (protocols, user accounts, and primitives), and access to the pyPAML library.
See the user guide at: User Guide
-
On your development system install backend dependencies
-
Get PAMLED:
git clone https://github.com/Bioprotocols/pamled.git
- Initialize the pamled pipenv environment:
cd pamled
pipenv install
pipenv shell
- Set the secret key in
backend/.env
:
python -c "import secrets; print(f'SECRET_KEY=\"{secrets.token_urlsafe()}\"')" > backend/.env
- Initialize the backend
# from within the pipenv shell
cd backend
python manage.py makemigrations accounts editor
python manage.py migrate
# optionally create a admin user
python manage.py createsuperuser
- Start the backend
# from within the pipenv shell, in backend/
python manage.py runserver
The backend server should now be running. You will see some output in the terminal like this:
Performing system checks...
System check identified no issues (0 silenced).
January 24, 2022 - 18:52:36
Django version 3.2.9, using settings 'pamled.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
- On your development system install:
- Initialize the frontend
# while in backend/ from above
cd ../frontend/web
npm install
- Start the frontend
# while in frontend/web/
npm run start
If npm does not open a browser automatically then you can connect to the frontend at http://localhost:3000
from your preferred browser.
-
Once connected you should be greeted by a login page. If you made a superuser account then you can login with that. Otherwise you can navigate to the sign up page and register a new account with your development database.
-
Once logged in you will see the editor.
For those familiar with VSCode the backand and frontend instructions have mostly been encapsulated within a VSCode workspace. See the pamled.code-workspace
in the root of the repo.
Note that this workspace does still require pipenv
and npm
to be installed.
The workspace provides a set of tasks available via command palette (Ctrl+Shift+P
) under Tasks: Run Task
.
These make initialization of the backend and frontend a bit easier to manage.
- Make Migrations
- Migrate
- Create Superuser
- Nuke DB & Migrations
It also provides a set of launch commands available from the Run and Debug
panel (Ctrl+Shift+D
).
These make it easier to launch all of the editor parts at once.
- Django
- React
- Firefox
- Chrome
- Django & React & Firefox
- Django & React & Chrome