Backend Python Flask Application This repository contains the backend code for a Python Flask application. The application serves as the server-side component, handling requests and providing data to the frontend of the web application. It is built using the Flask framework, which is a lightweight and flexible web framework for Python.
Getting Started To get started with this backend application, follow the instructions below:
cloud : AWS services: 1.EC2 2.RDS
We are running this application on top of VM. So we need to launch an instance. Create a mysql database in rds Install all the dependencies which are mentioned in dependencies.sh file in this repo
------>first we have to create an ec2 instance for Backend application
------>Create the database in rds and allow 3306 from backend instance sg 3306 -- backend-sg
Go through with the commands :
---->Connect to the instance
-
yum install git -y
-
git clone <'git url link'>
-
cd <'foldername'>
-
cd <'backend flodername'>
-
sh dependencies.sh
---->After installing all the dependencies, connect with rds and create a table and then insert some values as your requirement,--for that follow the below commands
-
mysql -h <'rds endpoint'> -u <'username'> -p <'password'>
-
CREATE TABLE <'tablename'>( name VARCHAR(50) NOT NULL, roll INT NOT NULL, grade CHAR(1) NOT NULL );
-
INSERT INTO <'tablename'>(name, roll, grade) VALUES ('leo hank', 103, 'A');
INSERT INTO <'tablename'>(name, roll, grade) VALUES ('ram', 104, 'B');
INSERT INTO <'tablename'>(name, roll, grade) VALUES ('devops', 105, 'B');
-
\q ----to exit from the rds
cofigure the application and give the rds creds i.e. host,username,password,db name
-
vi properties.db----- update the dbname,host,username,password
-
esc+:wq!-----command to save the file
a. foreground------
1) python3 app.py
b. background------
2) nohup python3 app.py &