This repository holds the code for the PSLab Webapp to enable students to access the Pocket Science Lab (PSLab) open hardware platform and other equipment through the Internet.
The goal of the PSLab Webapp is to create a virtual lab that can give students remote access to Pocket Science Labs and other equipment in laboratories via the internet without having to be physically present near the equipment. PSLab is a tiny pocket science lab that provides an array of equipment for doing science and engineering experiments. It can function like an oscilloscope, waveform generator, frequency counter, programmable voltage and current source and also as a data logger. Our website is at https://pslab.io
- You can get a Pocket Science Lab device from the FOSSASIA Shop.
- More resellers are listed on the PSLab website.
- The PSLab chat channel is on Gitter.
- Please also join us on the PSLab Mailing List.
A virtual lab interface can give students remote access to equipment in laboratories via the internet without having to be physically present near the equipment. The idea is that lab experiments can be made accessible to a larger audience which may not have the resources to set up the experiment at their place. Another use-case scenario is that the experiment setup must be placed at a specific location which may not be habitable. The capabilities of the Pocket Science Lab can be increased significantly by setting up a framework that allows remote data acquisition and control. It can then be deployed in various test and measurement scenarios such as an interactive environment monitoring station.
- Backend API server is hosted on Heroku. The dyno is reaped after an hour of inactivity and may take up to 10 seconds to boot up.
- Webapp Frontend is hosted on surge.sh
- Designing a remote access framework with PSLab
- Creating backend API methods using Python Flask Framework
- Execute python function calls remotely
- Deploying the API server and Webapp to separate domains automaticaly
- Creating better structured apps from user submitted scripts
- Adding a graph component to the frontend
The virtual lab will be hosted using Python-Flask, which is a BSD Licensed microframework for Python based on Werkzeug and Jinja 2 . It will use sqlalchemy to interface with databases containing user credentials and data. At present, postgresql will be used.
The repository has been integrated with Heroku, and modifications to the master branch are automatically deployed to pslab-stage.herokuapp.com after the CI build passes
The frontend code resides in a subdirectory called frontend
. It is Designed with EmberJS , and a production build is automatically deployed to pslab-remote.surge.sh by the CI if the build is successful.
Setting up PSLab is really easy. The steps are:
- Ensure you have the following dependencies to setup PSLab:
- Python3/2
- Git
- Nodejs
- Clone the pslab-webapp repositary via git.
git clone https://github.com/fossasia/pslab-webapp.git && cd pslab-webapp/
- Install all Python packages in requirements.txt
pip install -r requirements.txt
- Install the frontend dependcies as well
cd frontend/
npm install
gunicorn app:app
This launches the API server on default port 8000
cd frontend
ember -s environment='development'
this launches the the emberjs webapp on port 4200
navigate to localhost:4200 in your web browser
-
backend
- homepage hook
- SignUp hook
- SignUp database updation procedure
- SignIn hook
- SignIn database verification
- User script page hook
- Store, Edit, View, Delete user submitted code snippets
- Execute a function string
- Execute a code snippet
- Create object oriented apps
-
New Frontend based on EmberJS
- Home Page
- Navbar with bootstrap styling
- sign-up page
- sign-in page
- user-home.html. Feature to Create and Store code snippets. Execute function strings
- Create/Edit/Delete/Execute Python scripts. Embedded ace-js code editor.
- Display object oriented applications
- Plot data with the integrated JQplot library
This project was moved from another repository, and in order to browse the various issues and PRs, the following links may help