 talking about a Django tail. So I'll be talking about a project which built on Django. So I'll be talking about a project named ScanCodeServer. And we built this as a part of Google Summer of Code 2017. And it was a part of an organization named Nextv in California. And see, I'll be talking about the licenses and copyrights. This is what we deal with. This is what Nextv deals with and the project which we built deals with. And then I'll skim through the whole project, how we built, why we used Django in the project. And then I'll be talking about APIs. I'll be giving you a small introduction on APIs. And then I'll be talking about the APIs we used to build our ScanCodeServer. And then there's an interesting part on handling background asynchronous tasks. So we've used this using Celery and Redis servers. And yeah, OK. So I'll be talking about myself. I'll be giving a small background on me. I am a computer grad. I'm a grad from TripleID Vododra, India. And I've been contributing to the open source for the last three years. So I was really in the hour with the power of code. I initially started writing code and then writing bash scripts and Python scripts to hack my modern sense jobs. So I started on building with my first script. That was the bash for bootstrap. And that was a script, a bash script, was used to build websites on the go from the command prompt directly. And then I started building with applications, big ones, and then was introduced to the Django framework. I was really intrigued by the architecture of different applications, the back end. And I was really curious about how this goes and how to build the basic components and the foundation of every application. And then I started on with back end development, started on to build a social networking application for the travel enthusiasts. So I've been traveling out of the world. And then so I thought there should be a social networking applications for travel enthusiasts. And I built the same thing on Django again. By 2017, I was pretty confident called Python and other cool frameworks like Node, which helped me crack the Google Summer of Code in 2017. And yeah, Jueysock was one of my memorable periods of my life. You get to interact with a lot of mentors, people around the world. You come and contribute to develop an idea, make it a project, see that the people use it. And then, yeah, I told you, we've been working under a Bout Code. There's a sub-organization in XB, and build a scan code project. A mentor was Philip Arbrudain. And then I'm basically a full-stacked developer, specialist. So let me get into the topic. So I told you we deal with copyrights and licenses. So you must have all heard about copyrights and licenses everywhere. You deal with it. How we have copyrights and songs. You write a poem, you have copyrights there. If you have a huge artwork made, you have copyrights there. And sure, there are copyrights in the software world. So there are copyrights world there in the software. So let's see how it goes. Yeah, there are copyrights everywhere. So let me tell you one thing. I'll be talking about copyrights and licenses. And the most important thing is that copyrights and licenses are two different things. I'll just read out the definition for you. What is a copyright? A copyright is a legal mechanism which established a sort of ownership of an expressive work. Let me tell you, let me give you a small example. So when you create a computer program, by the copyright law, it gives you the ownership of the program. So it gives you the ownership of the program. Now that, you can add any license so that the other people use it. So let me tell you an example. So if you wrote a code, the copyright law authorizes you to be the owner of the code. Now if you want to transfer this code to someone else, you give the whole copyright to someone else. So that's how it works. Let's talk about licenses now. A license is an agreement between you and the other party that dictates the term by the other person can use that program. So let me tell you, there's small, interesting things you can do. I'll think about the program you create, any program, any source, any code. And then you add a small Rimi file named license in it, and then dictate your own terms. It could be, I'm Kaushik. So it could be a Kaushik license. So if you add that license in it, and then dictate the term saying that it's a, let's talk about, I build a song, a game downloading application. A game downloading application for open source application. But I have a license saying that every game you download, you've got to pay me $5. That's insane, I know. But now that a user downloaded the program, you can use the program, and every time he downloads a new game in that, he's got to pay me, because I told in the license that he got to pay me $5. That's how it works. Let's me talk about an open source license. So open source license says that if a project is built on open source license, you have this power that you can actually give it to anyone. The code could be redistributed, and it could be used by anyone. So you don't have any rules around that. A patchy license is a one open source license. So without the license, if you made a copy of your program, and either used it or redistributed it, you will have a legal case that will allow you to attempt and collect damages from them. So yeah, the two different things. So copyrights are the legal systems which gives you control over your creative works, whereas licensing is a legal mechanism which allows you to form agreements with other parties, how they use the copyrighted work. So the other parties could be a huge business, or it could be a small set of people, or it could be any person using your software. OK. So yeah, you're forced to pay license fees for using a popular meme. I don't know, but that's very sad. I'll be talking about scan code server. So now that you've actually got a basic idea on licenses and copyrights, I'll be talking about the scan code server, which deals with it. So most importantly, OK, I've built this around like the last year. And then NextB, Inc. is in California, is an organization. And they supported me build this with my contributor. So yeah, I told you we build this as part of Google Summary code. I'll be talking about our company bit. And then so you can get a brief idea. So NextB is a company that solves the problem of discovering, identifying, tracking, and managing code source, and third party components used in your projects, applications, and systems. So we build modular tools for software development teams so that each team can implement a work flow tailored for a set of languages. It could be a technology or tools. We call this set of tools about code. So yeah, I'll be talking about scan code servers. So for building scan code server, we used scan code toolkit. So it's a toolkit. It does scan code, it took it as a suit of utilities, used to scan a code base for license, copyrights, package manifest, dependencies, and other interesting information that can be deserved or discovered in a source or by recode files. So I'll give you an example in the real world. So where could we use this project? Think of Uber, OK? They're just small, think of another company, which is really cool, it builds some really cool map API, and it has really good integrations in it. But the Uber company likes it, and they want to own that now. But it has to show the authority of it. It has to know how authoritative it is. You exactly don't know. The license in the project says that this whole project is yours, or it's someone else. So the authority is really important over here. So for Uber to buy this from, it has to see the authority now. Now, how do you look? You can't look into the whole code. The small organization builds. It's really difficult. So what you've got to do is that you have the scan code server, because it could be a 20 GB of data. You go 20 GB of code, and then you go and scan each file, it's going to be difficult for you. So what you can do is that you can use a scan code server for that. What a scan code server does is that it could scan through each and every file of it very fast. And then this suit could detect licenses, as it told, copyrights, package manifest, and dependencies, and other interesting information. So it'll give you the whole thing. And this open source, yeah, you can use it. Now, I'll be talking about scan code server, which uses the scan code toolkit, and tries to quicken the process. I'll tell you, I'll just read this out. Scan code server uses the scan code toolkit as the library and rest the API application that allows you to scan code and demand by entering a URL and then stores the scan results. We have created a Django server with rest of API support to scan code, given data link to the repository. It could be a GitHub or a Git repository, or any URL containing archive files to be zip, tar, tar, gz. So think of a software you've built, and then you want to scan it. You want to see what all the licenses used in the libraries or the dependencies in it. So you can just give the URL there. You could give you a GitHub URL repository, or you could give a zip file, a URL of the files containing zip in it. And then you just give it to the application, you want to scan, and you get all the results insanely fast. And then it'll give you the license, copyrights, all the package manifest, and the dependencies. It not only shows you, it registers you as a user, stores all the information stored in the models. And then you get to see your previous information, the projects you've scanned, or the licenses you've used until now, everything. I'll be talking about why did we choose Django. There are a lot of frameworks out there, but why did we choose Django here? It's fast. It's pretty fast. This has been designed in a way to help the developers make an application as fast as possible. From idea, production, to release, Django helps in making it both cost-effective and efficient. So it becomes an ideal solution for developers having a primary focus on deadlines. And yeah, Django has a huge community to support. It's there. It's growing very fast, so that you have a lot of libraries to contribute in also. It's fully loaded. It works in the way that includes dozens of extra to help with user authentication, sitemaps, content administration, RSS feeds, and much more. You just have things on the go. You have everything right there for you. And then talking about the security, when you're doing it on Django, it is and showed that developers don't come in any mistakes related to security. Because they have this thing called CSRF token, which actually helps from SQL hacking and SQL injection. So some of the common mistakes in SQL injection is told, cross-site request forgery, clickjacking, cross-site scripting. This all has everything built in Django so that you know to worry about the security part. To manage effective user names in password, the user authentication is the key. Django has this predefined user authentication system, which is really cool, and it's really secure. Talking about the scalability of Django, to meet the heaviest traffic demand, the benefits of Django framework can be seen. Therefore, the business sites use it medium to quickly traffic demand. So think about the whole world using it. A lot of main applications in the world, like Instagram, is also using Django here. And then it's actually handling huge amounts of traffic. So that's the reason we actually used Django framework to build a project. Yeah, and for any application to build and to outsource data, get data, send requests, and get the response, you actually need an application interface. So I'll just give you a brief introduction on application interface, how it's used and why, and its use cases. So API is the acronym for application program interface. It's a software intermediary that allows two applications to talk to each other. Let me give you an example. You have opened a Facebook account, and you need to sign in. You're a new user. OK, you enter all your information, you enter your username and all other details. And then you click on the sign up button. What happens next? There's a API which is used here. The API sends the data. I mean, there's a request being processed from the application to the server of Facebook. And then what this API does is that it actually stores your information in the database and sends back a response, and the body says it's successful. It gives you a 200 response, says that the thing is successful, and you are a new registered user of Facebook. So this is how an API looks like. I think I've given you a simple idea. So when you use an application on your mobile phone, the application connects to the internet and sends data to a server. The server then retrieves the data and then interprets it, performs the necessary actions, and sends it back to your phone. The application, so look at this. So when we talked about this Facebook authentication system, how it works and all, so it takes the information, goes to the, all the information goes to the server, the Facebook server. Everything is, you know, interpreted there, like all the software programs are building there. And then whatever the response from the API, you get it as a response here, and it's seen on your application. So this is how it works. So this is a thing that that's your app application. And then you send a data request to the back-in. It could be a post, get, put, delete, custom, or any request. The data is fed in to the server now. And the back-in server now, you know, registered, you want to crunch all the information in and get the basic information you want it as response to the application. That's how you get, and that's how an API works. So this is the basic API, which actually gives you all the queries of the users inside an application. So this is a small example of that. And if you want to look into the API of user view set, so class user view set, that's an API there. It's an API endpoint that allows you to view the users. And you can actually use your users and edit them. If you want to look into the response, how it's generated, after getting it back to the server, this is how it looks like, this is the response. So this is a formatting format within JSON. This is the JSON. You can see that the count is two, which says there are two users there. And then there's no next user, and there's no previous user. So this is the JSON which you get back. The email ID of the user, number one, here, you get the email ID of user two. And there are the details of the users there. So I'll be talking about handling background servers tasks using server. So a single server handling all the tasks is really difficult. Now you use, you know, you have to have something which actually scrutinizes all the data, make it fast, and scan a lot of things. So think about if you are actually sending huge amount of data, this is just where it's in MB or it's in KBs. If you want to actually, basically, what do you call, if you want to send in a huge amount of data, like 20 GB or 30 GB, and it has to work there, you got to use a background asynchronous servers for that. It will create you multiple servers there. And then in each server, the data is fed into, I mean, the whole data is actually divided into chunks. And in each chunk is divided into a new server there. And then the server gives you the results. All the results are aggregated at one place, and then you get a response. That's a better way of handling big tasks. So web application usually start out simple, but it can become quite complex. And most of them exceeds the responsibility of responding to HTTP requests. So when that happens, one must have a distinction between what has to happen instantly. If you want to have something instantly, you need that thing to happen fast. And then what can happen eventually? If you have time, you can use the normal server. But if you want to view something instantly, you have to use the background sync server so that all the information is scanned very fast. So well, because your application becomes overloaded with traffic, simple things like this can make a difference. I'll be talking about tasks that can be processed in the background. So tasks that are not essential for the basic functionality of the web applications. The tasks that can be run in the request response cycle since they're slow. And the task, the dependent on external resources that might not be available due to as behaved or expected. And then the task which might be needed to retire at least once or have to be executed on schedule. So all these scenarios needs asynchronous background servers to handle the scenario. So I'll be talking about salary. And salary is an asynchronous task, Q job, Q based on distributed message passing. So, salary is the de facto choice of doing background tasks, processing and the Python Django ecosystem. It has a simple and clear API. It integrates beautifully with Django. It supports various technologies for the task Q and various paradigms for the workers. And C. So I've talked about you sending a huge amount of data. Let's talk about scan code server itself. You send 20 GB of data to get scanned. And then, now that you've sent the data to the server, you can't scan the whole thing at a time. It's going to take a long time if you have only a single server to do that. But now that you've divided the whole 20 GB of data, you're using asynchronous servers. You're using salary here in Django. What happens is that you divide this 20 GB of data into many chunks. And each chunk is given to a small red server. So red server here is a broker server, which takes in the amount, a small amount of data there. Data chunk. And then each chunk, at each chunk, your files are scanned there in each file. And then all the data, and each chunk gives you a JSON response everywhere, everywhere, everywhere. And then the whole JSON response is then aggregated into one single platform. And then all the data is feeded into the models. So here what salary does is that salary actually queues all the servers, queues the data, and then helps you get in track with asynchronous system. So this is basically the architecture of the scan code server. You have a Django server built in. All the data, as I told, is gone into the server part. And then what happens is that it's divided into multiple chunks, as I told. We're using a red server here. And then in each red server, the data is being collected as a JSON. And then all the data is being scheduled by salary workers here. And the salary workers actually combines them together and then gives you the whole back response there. And all the responses are feeded into the database of everything stored. So yeah, that's how it works. And then this is the outline of a project, scan code app. We have migration set in. We have a migration folder. We have the static folder for putting up all the images and stuff, or the web page, or small faulty cons and something. And then in the templates, you have the different templates of HTML and all. And actually, Django has an interesting concept in templates. So they're actually very good in handling templates because you have a single header there. That's cool. And then I'll be talking about, so this server is not so important here. I'll be talking about the major API scan code server. Let's look into the URL API, which allows the user to enter into the direct link of the code. So I just told you it can accept GitHub links. So what happens is that it actually takes in your GitHub link. Now, it has to know. It has to know which URL is that. It has to actually identify. So we have a small regex matcher for that to identify whether it's a URL or an archive file or some file which doesn't contain the file at all, or URL which doesn't contain the file at all. So the API segregates the URL using a regex matcher and then clones or downloads the database at certain part using an asynchronous background task implemented using regex and server. So as I told you, we've taken what you call the URL here. And then the whole URL, it scans for, it actually matches for the URL, think of it's GitHub URL. It downloads everything there, downloads as far as, and saves it on your PC or it could be on the cloud. And then scans, and all the regex workers are worked upon there. So this is how the URL works. So now the downloaded code base is now scanned using the scan code library. And the result and scan results are fed into the model, as they told you, into the scan code server. There's a local upload you API which is quite similar where you can upload the data and the whole thing works in the same way as the URL API. So this is actually the JSON result of scan code. So that's the URL and you get a lot of information there. It could give you a license, copyrights, a lot of things. Packages, information, the scan code error. This project is available on GitHub for you. And yeah, there could be a lot of things done here. You could add a Travis integration, saying that which could actually, whenever you build a project directly into your repository, you can add a Travis repository here. And then it could scan automatically without anything and gives you the result. So that's it now. I think I've managed to talk about copyrights and stuff. And my projects scan code server. So yeah, anyone up for some questions? OK. Fine, fine, thank you. Thank you very much for your recent session. Yeah, thank you very much.