The repo is the frontend interface of Queryshield, a secure multiparty computation (MPC) cloud service. It leverages the power of cryptographic techniques to enable collaborative computation among multiple parties without compromising the privacy of their data.
- Frontend: Streamlit, Python
- Database: PostgreSQL
- Authentication: JWT library
- User Registration & Authentication
- Securely manage user registration and authentication with JWT-based token handling for enhanced security and session management.
- Analyst Features
- Create Analysis Page: allows analysts to create new analyses with custom schemas, thread modes, and SQL queries.
- Analysis History Page: allow analyst to trace his/her analysis status.
- Data Owner Features
- Analysis Catalog Page: allows data owners to view all available analyses, providing an entry point for data sharing.
- Share Data Page: allow data owner to do secret data sharing using MPC.
- Analysis Detail Page: wiew detailed metadata about specific analyses.
-
Create
.envat the root:touch .env
-
Edit
.envfile with these variables:JWT_SECRET_KEY=secret DATABASE_URL=postgresql+psycopg2://user1:12345678!@host.docker.internal:5432/storage DATABASE_URL_VERIFICATION=postgresql+psycopg2://user1:12345678!@host.docker.internal:5432/verification POSTGRES_USER=user1 POSTGRES_PASSWORD=12345678! POSTGRES_DB=storage POSTGRES_DB_VERIFICATION=verification
The following instruction is for running the app on Docker, if you want to deploy on your local machine, you can go to 2-2) Deploy on Local
-
Start Docker.
-
Open a terminal and navigate to the
scriptsfolder":cd scripts -
Run the following commands:
chmod +x start.sh ./start.sh
You can also run the app on your local machine, rather than using Docker. The following is the instruction.
-
Create and activate a Python virtual environment:
python -m venv venv source venv/bin/activate -
Install all dependencies
pip install -r requirements.txt
-
Compile the custom streamlit React component
cd src/secret_share_component npm install npm run build -
Run
python ./src/Create_Analysis.pycd ../.. python ./src/Create_Analysis.py
.
├── Dockerfile # Docker configuration file
├── LICENSE # License information
├── README.md # Project documentation
├── docker-compose.yml # Docker Compose configuration
├── requirements.txt # Python dependencies
├── setup.py # Python app setup file
├── scripts # Shell scripts
│ ├── cleanup.sh # Script to remove the entire app from Docker
│ └── start.sh # Script to start/restart the app
├── sql # SQL scripts
│ ├── db_setup.sql # Database setup script
│ └── db_storage_setup.sql # Database storage setup script
├── secret_share_component/ # React.ts secret data sharing component
└── src # Source code
├── Create_Analysis.py # Main app (entry point)
├── components/ # UI components
├── configs/ # Configuration files
├── db/ # Database connection and operations
├── models/ # Data models
├── pages/ # Application pages
└── utils/ # Utility functions- analyst
- data_owner
| Column Name | Column Type |
|---|---|
| uid | SERIAL ->PK |
| first_name | VARCHAR(50) |
| last_name | VARCHAR(50) |
| VARCHAR(50) | |
| pin | VARCHAR(50) |
| role | user_role |
- Created
- Ready
- Running
- Failed
- Completed
| Column Name | Column Type |
|---|---|
| aid | SERIAL ->PK |
| analysis_name | TEXT NOT NULL |
| analyst_id | INTEGER REFERENCES user(uid) |
| time_created | datetime DEFAULT NOW() |
| details | JSONB NOT NULL |
| owners_registered | SERIAL[] |
| status | analysis_status NOT NULL |
| Column Name | Column Type |
|---|---|
| analysis_id | INTEGER REFERENCES analysis(user_id) |
| user_id | INTEGER REFERENCES user(aid) |