Icpc - Local Registration System
Total Page:16
File Type:pdf, Size:1020Kb
ICPC - LOCAL REGISTRATION SYSTEM A Project Presented to the faculty of the Department of Computer Science California State University, Sacramento Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in Computer Science by Shiva Kumar Melam FALL 2016 © 2016 Shiva Kumar Melam ALL RIGHTS RESERVED ii ICPC - LOCAL REGISTRATION SYSTEM A Project by Shiva Kumar Melam Approved by: __________________________________, Committee Chair John Clevenger, Ph.D __________________________________, Second Reader Scott Gordon, Ph.D ____________________________ Date iii Student: Shiva Kumar Melam I certify that this student has met the requirements for format contained in the University format manual, and that this project is suitable for shelving in the Library and credit is to be awarded for the project. __________________________, Graduate Coordinator ___________________ Ying Jin, Ph.D. Date Department of Computer Science iv Abstract of ICPC - LOCAL REGISTRATION SYSTEM by Shiva Kumar Melam ICPC (International Collegiate Programming Contest) is a worldwide programming contest organized by ACM (Association for Computing Machinery) every year. Over 40,000 students from over 2500 Universities all around the globe participate in this prestigious competition. It is a team based multi-tier competition which follows the rules formulated by ACM. The competition initially takes place among the local universities and the winners of this contest get selected to the regional level competition. Winners at the regional level contest advance to the world finals. Currently, the ICPC has a web-based registration system only for the regional and world finals Contests. Registration of the contestants/teams who participate in local contests has been a manual process i.e. the event organizers take the details of the contestants on a piece of paper. It has become a tedious process to archive and maintain the information of many such local contestants on paper. Moreover, this data couldn’t be shared among other contests. Local university contests usually determine the eligibility of the teams to v compete in the regional and eventually to the world finals contest. This shows that there is a significant need for the ‘local registration’ data to be securely stored for further use. The main intent of the project is to develop a RESTful API that provides services to the web based applications which makes the registration process of the contestants easy. The project also includes an AngularJS based web application which consumes these web services and stores the registered contestants’ data in a local database. The important aspect as a part of the project is to develop an API design Specification which acts as an interface that could essentially generate Javascript files for the front-end development and platform independent implementation code for the back-end. This feature gives an insight of the REST API and also provides information on how it could be implemented to develop applications. _______________________, Committee Chair John Clevenger, Ph.D. _______________________ Date vi ACKNOWLEDGEMENTS I would like to thank Dr. John Clevenger for taking up the role of my project advisor. He helped me understand the design processes involved in the creation of this application with ease. His feedback and guidance was very important for me to see the real purpose of my master’s project. I would also like to thank Dr. Scott Gordon for taking time to review my report and giving me important feedback. Added to that, I would like to thank the Department of Computer Science at California State University, Sacramento for providing an opportunity to pursue my Masters Degree and guiding me all the way to become a successful student. vii TABLE OF CONTENTS Page Acknowledgements………................................................................................................vii List of figures…………………………………………………………………………….. x Chapter 1. INTRODUCTION……………………………………………………………………... 1 1.1 Goal of the Project………………………………………………………………... 1 1.2 What is ICPC……………………………………………………………………... 1 1.3 Existing Problem…………………………………………………………………. 3 1.4 Proposed Solution………………………………………………………………… 3 2. TECHNOLOGY STACK……………………………………………………………… 5 2.1 Dropwizard……………………………………………………………………….. 5 2.2 MySQL…………………………………………………………………………… 7 2.3 AngularJS…………………………………………………………………………. 8 2.4 Bootstrap………………………………………………………………………….. 8 2.5 RAML…………………………………………………………………………….. 8 3. OVERVIEW OF SYSTEM DESIGN………………………………………………….. 9 3.1Architecture of the Application…………………………………………………… 9 3.1.1 Introducing RAML…………………………………………………………. 9 viii 3.1.2 Why RAML………………………………………………………………. .10 3.1.3 RAML VS Swagger……………………………………………………….. 11 3.2 Database Schema………………………………………………………………... 12 4. IMPLEMENTATION………………………………………………………………… 14 4.1 Implementing Database Schema………………………………………………… 14 4.2 RAML Specification and Implementation……………………………………… 17 4.3 RESTful API using Dropwizard………………………………………………… 25 4.4 AngularJS client Implementation……………………………………………….. 36 5. APPLICATION ILLUSTRATIONS…………………………………………………. 42 5.1 Register Individual……………………………………………………………… 44 5.2 Register Team…………………………………………………………………… 46 5.3 Create Division………………………………………………………………….. 49 5.4 Manage Registrations…………………………………………………………… 51 6. CONCLUSION………………………………………………………………………. 54 6.1 Lessons Learnt…………………………………………………………………... 54 6.2 Future Enhancements……………………………………………………………. 54 References……………………………………………………………………………….. 56 ix LIST OF FIGURES Figures Page Figure 1 Entity - Relation Diagram...................................................................................17 Figure 2 API Designer Editor............................................................................................18 Figure 3 JAX-RS Implementation code.............................................................................23 Figure 4 AngularJS code Snippet generated by RAMLAng.............................................24 Figure 5 Dropwizard Project Setup....................................................................................25 Figure 6 Maven Dependencies...........................................................................................26 Figure 7 AngularJS project structure.................................................................................37 Figure 8 NPM command to start the server.......................................................................38 Figure 9 LRS - API Portal.................................................................................................42 Figure 10 API Reference...................................................................................................43 Figure 11 API Notebook....................................................................................................43 Figure 12 Home Page.........................................................................................................44 Figure 13 Register an Individual........................................................................................45 Figure 14 List of Registered Individuals...........................................................................46 Figure 15 Add Team Members..........................................................................................47 Figure 16 Register Team....................................................................................................48 Figure 17 List of Registered Teams...................................................................................49 Figure 18 Create Division..................................................................................................50 x Figure 19 List of Divisions................................................................................................51 Figure 20 Make a Team.....................................................................................................52 Figure 21 Add Individual to team......................................................................................53 xi 1 1. INTRODUCTION 1.1 Goal of the Project There are many worldwide competitions that occur every year. ICPC (International Collegiate Programming Contest) is one such event. Students from all over the world participate in this competition. These students have to initially register for the event through ICPC official website. Local contests usually determine the eligibility of the teams to compete in the regional and eventually to the world finals contest. The goal of the project is to develop a web application that lets the contest administrator to register the contestants as individuals and teams in the local contest. This is achieved by creating a java RESTful API that would provide services to any web application, thereby making the whole registration process computerized. In addition to it, the main objective of the project is to develop an interface (API Specification) which can generate platform independent implementation code (for the back-end) and script files (for the front-end) which can be used by the application developers. 1.2 What is ICPC ICPC (International Collegiate Programming Contest) is a world-wide programming contest conducted among Universities annually by ACM (Association for Computing Machinery). It is a multi-tier, team based programming competition where participants come from over 2,500 universities, across 100 countries on six continents. The competition has gained so much prominence that each year the number of teams has 2 increased exponentially by 10-20%.