This is a basic Learning Management System (LMS) built using Python, gRPC, and SQLite. The project implements login, logout, post, and get functionalities using gRPC, along with session management through tokens. The system can be interacted with through a command-line interface for both students and instructors.
(the arrows signify the direction in which a connection begins. Here, a server can not initiate a connection with a client, but can with a tutoring server, and so on)
/LMS_Project
│
├── /client
│ ├── client.py # Command-line interface for interacting with the LMS
│ └── grpc_client.py # gRPC client logic to communicate with the server
│
├── /server
│ ├── grpc_server.py # Main gRPC server code handling RPC functions
│ ├── server.py # Code to run the grpc server
│ ├── database.py # SQLite database creation logic
│ └── initialize_content.py # Python script to initialize dummy LMS course content
│
├── /raft
│ ├── logs_helper.py # Helper functions for log files
│ └── raft_node.py # Raft Client and Raft Server classes with gRPC connections
│
├── /proto
│ ├── lms.proto # Protocol buffer file defining gRPC services and messages b/w Server and Client
│ ├── raft.proto # Protocol buffer file defining gRPC services and messages for Raft Nodes
│ └── tutoring.proto # Protocol buffer file defining gRPC services and messages b/w Server and LLM Server
│
├── requirements_server_client.txt # Python dependencies for the server/client nodes (gRPC, SQLite, etc.)
├── requirements_tutoring_server.txt # Python dependencies for the AI based tutoring server (gRPC, SQLite, PyTorch, etc.)
├── setup_server_client.sh # Setup for the server/client nodes
├── setup_tutoring_server.sh # Setup for the tutoring server
└── README.md # this ReadMe file
- Python 3.8 or 3.9
git clone https://github.com/UjjwalAggarwal-1/AOS-Adventure
cd AOS-Adventure
- You may create a virtual env and activate it before running the script
for the tutoring server node
./setup_tutoring_server.sh
for the server or client nodes
./setup_server_client.sh
incase the file is not executable, run
chmod +x {filename}
git clone https://github.com/UjjwalAggarwal-1/AOS-Adventure
cd AOS-Adventure
- You may create a virtual env and activate it at this step
Install the required Python dependencies using pip
:
for the server or client nodes
pip install -r requirements_server_client.txt
for the tutoring server node
pip install -r requirements_tutoring_server.txt
The project uses gRPC for communication. To generate the necessary Python files from the lms.proto
file, run the following command:
python -m grpc_tools.protoc -I./proto --python_out=./proto --grpc_python_out=./proto ./proto/lms.proto
This will generate lms_pb2.py
and lms_pb2_grpc.py
inside the /proto
directory.
similarly for tutoroing.proto
python -m grpc_tools.protoc -I./proto --python_out=./proto --grpc_python_out=./proto ./proto/tutoring.proto
python ./server/database.py
python ./server/initialize_content.py
This will also insert some dummy course materials into the SQLite database.
mkdir logs
Start the gRPC server and client (as 2 new threads) by running the following command:
python raft/raft_node.py {port_number}
The server will start listening for requests on port port_number
.
Use 40051/40052/40053 for now
-
These 3 are the only raft nodes for now, to include more, add them to the
peers
list in raft_node.py towards the end of the file -
Remember to start the LMS server (step 2) corresponding to each raft node
- for raft (40051) start LMS server (50051)
- for raft (40052) start LMS server (50052)
- so on
Start the gRPC server by running the following command:
python server/server.py {port_number}
The server will start listening for requests on port port_number
.
Use 50051/50052/50053 for now
To stop the gRPC server, simply press CTRL + C
in the terminal where it is running.
To run the LLM tutoring server:
python tutoring_server/tutoring_server.py
The server will start listening for requests on port 60052
.
To stop the gRPC server, simply press CTRL + C
in the terminal where it is running.
To run the client to interact with the LMS:
python client/client.py {server_port_number}
Use 50051/50052/50053 for server_port_number
for now
The client will provide options for login, posting data, retrieving data, and logging out.
Once the client is running, you can:
-
Login using the following credentials:
- username :
- instructor1/instructor2/instructor3 for instructor
- student1/student2/student3/student4/student5 for student
- password: password123 for all
- username :
-
Using the
post
option : Post assignments, and queries as student, or grade assignments and reply to queries as instructors. -
Using the
get
option : Retrieve course materials and assignments, their grades, and queries and replies.