This project was started as a part of our CS-433 Computer Networks course at IIT Gandhinagar, and was colaboratively made by Dishank Goel, Harshit Kumar and Pushkar Mujumdar
- Problem Statement β
- Directory Structure π
- Feature Checklist β
- Use Cases πΉοΈ
- Communication Paradigm for web application π°οΈ
- Communication paradigm for Live Classroom Feature π°οΈ
- App Logic π²
- Overview of Implementation βοΈ
- How To Use π οΈ
- Deployment Strategy π§
- Screenshots π·
Design and implement Mini Classroom, a simple internet tool that mimics the functionalities of Google Classroom and some additional features. Build your application on top of TCP.
Mini-Classroom
βββ api.py
βββ app.py
βββ chat_client.py
βββ chat_server.py
βββ database
βΒ Β βββ make_database.py
βββ http_lib.py
βββ mininet_tests.py
βββ models.py
βββ README.md
βββ requirements.txt
βββ server.py
βββ server_to_app.py
βββ start_app.sh
βββ start_chat_app.sh
βββ static
βββ attendance.html
βββ class.html
βββ classrooms.html
βββ create_class.html
βββ css
βΒ Β βββ chat.css
βΒ Β βββ cover.css
βΒ Β βββ offcanvas.css
βΒ Β βββ signin.css
βββ discussion.html
βββ error.html
βββ group_discussions.html
βββ img
βΒ Β βββ class_icon.png
βΒ Β βββ login_icon.png
βββ index.html
βββ join_class.html
βββ js
βΒ Β βββ offconvas.js
βββ live_class.html
βββ login.html
βββ posts_by_tag.html
βββ signup.html
βββ students.html
Basic Features -
β
Any Client is able to sign up and create an account with Mini Classroom
β
Client can Login and Logout
β
Client can create a classroom and be the instructor of the class
β
Client can join a classroom as a student by using the classroom code
β
Only the Instructor can post updates to the classroom
β
Students (and the instructor) can view posts on the classroom
Advance Features -
β
Instructor can associate a Tag with each post
β
Students and the Instructor can view posts Categorized by Tags
β
Instructor can initiate a Live Classroom Session
β
Students and Instructor can join and send messages in the Live Classroom Session
β
Instructor can initiate a Group Discussion on any topic
β
Students and Instructor can send public messages in the Group Discussion
β
Students can send private messages only to the Instructor
β
Instructor can send private messages to any student
β
Concurrent server which can handle several client requests
β
Multiple instances of server
Security Features π-
β
Users need to Authenticate (Login) with the server before accessing any features
β
When a client enters a password, the input is masked
β
Only the Instructor can access all the students in a classroom
Bonus Features -
β
Attendance Management: Instructors can access Attendance of any Live Classroom session
β
Group Chat with Students
β
Browser based GUI for all features except Live Chat and Group Chat
β
Live Chat and Group Chat are command line based features
A client in a particular Classroom can have one of the two roles -
- We have Implemented HTTP protocol on top of TCP
- Request π Response paradigm.
- Client establishes connection with the server.
- Client sends request to the server as URL and request method.
- HTTP parser parses the headers of the HTTP request and makes use of the following headers -
- First line: Method (GET/POST), URL, Protocol (HTTP/version)
- Content length: Length of the body of the request in bytes
- Content type: Type of content in the body.
- Set cookie: To give the client a token for authorization and usage for further communication
- Cookie: To store the authorization token
- Location: To redirect the client to a new route
- HTTP library sends the following headers in the HTTP response -
- First line: Version, Response Code
- Server: Name of the server (Custom server in our case)
- Content type: Specifies the type of the content in the body.
- Content length: Length of the content in the body
- Connection: Used to specify if connection is persistent/non-persistent. In our case, Connection = close in the response as we are keeping it non-persistent.
- Response Codes sent by server include:
- 200 - OK (Request is OK, render HTML)
- 302 - Moved Permanently (used for redirect)
- 404 - Not Found (error response)
- 405 - Method Not Acceptable (error response)
- Full duplex bidirectional communication.
- The size of the JSON object is sent first, followed by the JSON object itself.
- Whenever a client sends a message, the live-class server receives it and broadcasts it to all clients.
Below is the High Level Design of the App

-
Make sure that all the dependencies are installed by running.
$ pip3 install -r requirements.txt -
First, the database needs to be created. Make sure you have mysql installed and the sql server is up and running. Go into the database/ directory. Run:
$ python3 make_database.py <IP of database> <user> <password>
In case of running database server onlocalhost, the IP will be127.0.0.1and user and password as per configuration -
Deploy app server: This server is the main backend for the application. To deploy this, run
$ ./start_app.sh <ip_of_server>
Note: Edit ./start_app.sh for database configurations if the database is not on localhost. -
Deploy chat server: This server handles the live chatting and group chatting. It has a different network paradigm than app server. To deploy this, run
$ ./start_chat_app.sh <ip_of_server>
Note: Edit ./start_chat_app.sh for database configurations if the database is not on localhost. -
The application is now ready to use.
Intended deployment strategy is a simple tree topology, with all the clients at leaf nodes, database server connected to switch s7 at depth-0, 2 app servers and 1 chat server connected to switches at depth-1.