This is an example Python application built with Flask (a microservice framework) that can be deployed on Catalyst Appsail.
To deploy this application, you must satisfy the following requirements:
- Catalyst Account
- Catalyst CLI installed and logged in
- Knowledge of Catalyst Datastore and ZCQL
- Python 3.9 installed on your local system
- Knowledge of PyPI and pip
- Basic understanding of git
This application will use the following Catalyst components:
- Serverless -> Appsail : PaaS offering from Catalyst for all your compute needs.
- CloudScale -> Datastore : A relational data storage component for storing table data.
- The user will input credentials, which will be checked against the credentials stored in Catalyst Datastore.
- Once authenticated, the user can upload a CSV in the UI, which will then be visualized in the UI.
To deploy this application to your Catalyst account, follow these steps:
- Download the code using the following command:
git clone https://github.com/rengarajan01/catalyst-python-webinar.git
- Once downloaded, navigate to the
appsail-python
directory and create a virtual environment with the following command:python -m venv .venv
- After creating the virtual environment, activate it with the following command:
source .venv/bin/activate
- Install the dependencies with the following command:
pip install -r requirements.txt
- Once the dependencies are installed, go to the Catalyst console, create a new project, and navigate to CloudScale -> Datastore -> Create Table.
- Create a table named "Users" with the columns "USERNAME" (data type: text) and "PASSWORD" (data type: Encrypted Text).
- Go to Data View and insert a new record for the username and password.
- In your local environment, initialize the Catalyst project inside your
appsail-python
directory. Once Appsail is initialized with Appsail and Python 3.9 as the runtime, replace the value for the keycommand
insideapp-config.json
with:python app.py
- You can now serve the application locally with the
catalyst serve
command or deploy the application with thecatalyst deploy
command. - Use this file for your testing.
Demo Credentials: Username: demo Password: demo