From f5700377d4e1dab3ade3f5f4bfaaa9b76034881a Mon Sep 17 00:00:00 2001 From: Tejas Ahuja Date: Sat, 3 Dec 2022 15:55:28 +0530 Subject: [PATCH 1/6] Made some cmd pages --- _config.yml | 7 +++++ assets/images/spoLogo.webp | Bin 0 -> 1842 bytes docs/cmd.md | 5 ---- docs/cmd/admin.md | 53 +++++++++++++++++++++++++++++++++++++ docs/cmd/auth.md | 32 ++++++++++++++++++++++ docs/cmd/cmd.md | 29 ++++++++++++++++++++ docs/cmd/company.md | 6 +++++ docs/cmd/ras.md | 6 +++++ docs/cmd/student.md | 6 +++++ docs/errors/errors.md | 9 +++++++ docs/overview.md | 18 +++++++++++++ index.md | 5 ++-- 12 files changed, 169 insertions(+), 7 deletions(-) create mode 100644 assets/images/spoLogo.webp delete mode 100644 docs/cmd.md create mode 100644 docs/cmd/admin.md create mode 100644 docs/cmd/auth.md create mode 100644 docs/cmd/cmd.md create mode 100644 docs/cmd/company.md create mode 100644 docs/cmd/ras.md create mode 100644 docs/cmd/student.md create mode 100644 docs/errors/errors.md diff --git a/_config.yml b/_config.yml index ba12ef0..5585f0c 100644 --- a/_config.yml +++ b/_config.yml @@ -1,3 +1,10 @@ title: RAS-Backend Documentation description: A guide to understanding the backend server of RAS. theme: just-the-docs +logo: "/assets/images/spoLogo.webp" +callouts: + info: + title: Information + color: green +search: + button: true \ No newline at end of file diff --git a/assets/images/spoLogo.webp b/assets/images/spoLogo.webp new file mode 100644 index 0000000000000000000000000000000000000000..b9c7b80d0afdcd6fc3991dcd3fc1ba60e74bd31a GIT binary patch literal 1842 zcmV-22hI3WNk&F02LJ$9MM6+kP&il$0000G0000#002P%06|PpNEikH00E$O+u9*X z)_)`3XpU{$wr$(CZQHhO+qP}nM#cNS_k75x%;@fjm;ep)QsZCwM|^c#sniHrXsq|a zaL*_zM~G6F@V`klPYqBp0u-9`A8g}3E>JlF1Z_;RF-|P4a`>xs6tw{pc|^tV7j$M5 zwwYVy2yhxT4MYx8815<^NbL@scvQu37qk}HZpeH(RKtCtN&caU%ukc3Xsc*Vg&rW< zO}|djR*=fpg4QR};mo(=wNz@**cyh#D?|)VyrFhWt@Ykd2dHSP)MAjasX0@jiz0-g zA!sdtrB$}1pgnQ4Bh0R{ze18qNrlG#fx3^2+EbzZX*^t|`YklWsk@G%AO#&vP2y=4 z-IO7eU4}|aJ@QBVVs~{}XtYn^qnQlo@bXm$SY$aPtL6Y`yHPqe@Z{$}YB~rjG|CEs0I!B$Y*wG<4Ae z?)~&%dj0qF$4^>w3P}oO(>g>uvX-<8*-osWfzp8GFaDIy6k|-yF~&sa@6R5#Kp_=D zDm8nJi99SVj2(GiuLSLy`dIIZys)Brg~clH9)s?r)b*6gOv0nd?=$@6RM$(K3cuHPUh>=ppyI>K#J zYA=BKrJxBupwA>;Rr3T}KL^p+ZD4Rp{Jy@{c;&aFr9y*Wp$|K9hN_|{t3uK$uRy|X z!T34s8V*-EraG>o4|lAqpw1#l#epVbw~$%wF%l_rl2j^aL!xa=noVVcq#!N$H4(eF z#EQ$1Oit{jAdUPP2}9m#zsu(*PDCt@J+hI*_t_IpIy*j&dG zF_Cu%seFUvrpHuvr%F@)Ov1fwrp3v&so6vGVVj0qds3wpu%d&g^_Tf(Tot_) z8trQ`-6oz^rA4s8=BF-f=2F?4f-WGs3r8;3KrPmkdFzkxWOb|mMZN;G&YMWsL)v7km$fR%c<(2)B-fw zPOPR%qkTm-HAgB)3R)Q(caZpObd}vz+L_p4Q*(ogptFfkbDx@n4j~!?CUUz}bXDp) zA{|6N8C?UlCfP*ZA5CS03Y|wZHa3ytRd%J(z9kz>CeE$Fn)NR-ksqd1P=C6FXl#r# zd#Wt@3tF9QW1QJcgEht1L?ZvpsY?A9()px}jmc(r6-7U#t|uCsniDig(|t)K5*JgY zZVTyHh}f8H4wphhp(+2twyC*Qg_ih*NX`FCs8aWZw4JGqZL+zvP}LE14AC}`*GG|d zgXo%{=2N9!i&FD{fTOW-9z}tI`Aq5TFASuka z?Zq$tLBFOky>r&mK?)l7WssyW&iothcjiq`zVQvez4OeC$8S2*07;=x?^aMaAnX7D z0B{BXodGI9073vhkv^D6C8MGtEZO@|uo4MC8cUj#fNg-#!0Kk+cmeKT3SJVudymBx z|1ug7d(tX#_yGR(z(4=!g@3_Ay;LBI0okAbxRr}zSF`^){Oz>-{Kx}3B`?nZ|NRgA zkoh0kF4I?Z!q1O(Yc^VeM<7G}eeosp-Y!z$S9zK7R8sDk6V(6ycl?w8{wCEGe$UOV zSdu078Gu_O=J11t^8cGWcXo}V5}k29g>mg8oJ3}+OWNI>pcS1RZ}f=Qg9^Cso<}dt gfB&&7Q-EFbee)i5Ct^IEG-59Nl_Z%$x_l@A05U6x9smFU literal 0 HcmV?d00001 diff --git a/docs/cmd.md b/docs/cmd.md deleted file mode 100644 index ed23942..0000000 --- a/docs/cmd.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title : cmd -layout : default -nav_order: 7 ---- \ No newline at end of file diff --git a/docs/cmd/admin.md b/docs/cmd/admin.md new file mode 100644 index 0000000..93afc6f --- /dev/null +++ b/docs/cmd/admin.md @@ -0,0 +1,53 @@ +--- +title : admin +layout : default +nav_order: 1 +parent : cmd +--- + +# admin.go +This file defines mail service handler for the admin service. + + +The Go viper package is used to read the [config.yaml secrets file]() and get the port of the various administrator services. A new Go engine is initialized and the required middlewares are attached to it. + + +## function adminRCServer +It returns an http server instance of the adminRC server for reading and writing to the mail service. + +{: .info} +The adminRC service is hosted on port 3490. + +### Middlewares Attached to the process +- [CORS]() : Custom middleware +- [Authenticator]() : Custom middleware +- [EnsurePsuedoAdmin]() : Custom middleware +- Recovery +- Logger + +Initialized service is passed to [adminRC router](). + +## function adminApplicationServer +Same as [adminRCServer]() except the fact the service is passed to [Application admin router](). + +{: .info} +The adminApplication service is hosted on port 3492. + +## function adminCompanyServer +Same as [adminRCServer]() except the fact the service is passed to [Company admin router](). + +{: .info} +The adminCompany service is hosted on port 3495. + +## function adminStudentServer +Same as [adminRCServer]() except the fact the service is passed to [Student admin router](). + +{: .info} +The adminStudent service is hosted on port 3500. + +--- +#### References +- [Go Engines]() +- [Go Logger middleware]() +- [Go recovery middleware]() +- [Go Viper module]() \ No newline at end of file diff --git a/docs/cmd/auth.md b/docs/cmd/auth.md new file mode 100644 index 0000000..88d773b --- /dev/null +++ b/docs/cmd/auth.md @@ -0,0 +1,32 @@ +--- +title : auth +layout : default +nav_order: 2 +parent : cmd +--- + +# auth.go + +This file defines mail service handler for the authentication service. + +## function authServer +It returns an http server instance of the started server for reading and writing to the mail service. + +The Go viper package is used to read the [config.yaml secrets file]() and get the port of the authentication service. A new Go engine is initialized and the required middlewares are attached to it. + +{: .info} +The authentication service is hosted on port 3475. + +### Middlewares Attached to the process +- CORS - Cross-Origin Resource Sharing : Custom middleware defined in the middleware documentation +- Recovery (Standard Go middleware) : to recover from any panic +- Logger (Standard Go Middleware) : To log the status + +Initialized service is passed to [auth router]. + +--- +#### References +- [Go Engines]() +- [Go Logger middleware]() +- [Go recovery middleware]() +- [Go Viper module]() \ No newline at end of file diff --git a/docs/cmd/cmd.md b/docs/cmd/cmd.md new file mode 100644 index 0000000..8978bfd --- /dev/null +++ b/docs/cmd/cmd.md @@ -0,0 +1,29 @@ +--- +title : cmd +layout : default +nav_order: 7 +has_children: true +--- + +# main.go + +A mail service is initialized and passed on to the following handlers and the errors are returned to the main function and logged by the logger. + +{: .info} +Mail read and write timeouts are defined to 5 seconds and 10 seconds respectively + +The service is passed on to the following handlers. The handlers are defined in the [overview]({{ site.baseurl }}{% link docs/overview.md %}) for reference. + +- Auth +- RAS +- Student +- Company +- Admin RC +- Admin Application +- Admin Student +- Admin Company + +--- +#### References +- [chan - Go Command](https://www.sohamkamani.com/golang/channels/) +- [errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) \ No newline at end of file diff --git a/docs/cmd/company.md b/docs/cmd/company.md new file mode 100644 index 0000000..550c79e --- /dev/null +++ b/docs/cmd/company.md @@ -0,0 +1,6 @@ +--- +title : company +layout : default +nav_order: 3 +parent : cmd +--- \ No newline at end of file diff --git a/docs/cmd/ras.md b/docs/cmd/ras.md new file mode 100644 index 0000000..28980c5 --- /dev/null +++ b/docs/cmd/ras.md @@ -0,0 +1,6 @@ +--- +title : ras +layout : default +nav_order: 4 +parent : cmd +--- \ No newline at end of file diff --git a/docs/cmd/student.md b/docs/cmd/student.md new file mode 100644 index 0000000..f1b07cb --- /dev/null +++ b/docs/cmd/student.md @@ -0,0 +1,6 @@ +--- +title : student +layout : default +nav_order: 5 +parent : cmd +--- \ No newline at end of file diff --git a/docs/errors/errors.md b/docs/errors/errors.md new file mode 100644 index 0000000..c8e8288 --- /dev/null +++ b/docs/errors/errors.md @@ -0,0 +1,9 @@ +--- +title : Logged Errors +layout : default +nav_order: 17 +has_children : true +--- + +# Common logged errors +This file lists down the various common errors encountered while developing, building and deploying the application. \ No newline at end of file diff --git a/docs/overview.md b/docs/overview.md index c6b6f05..d30fe2e 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -3,3 +3,21 @@ title : Overview layout: default nav_order: 2 --- +# Overview +The program is divided into multiple sections for the easy management of the different parts. The different sections of the program use separate ports for increased stability. A crash at one of the ports/handler leaves the others remain unaffected. + +- RAS: 3470 +- AUTH: 3475 +- STUDENT: 3480 +- COMPANY: 3485 +- ADMIN: +- RC: 3490 +- APP: 3492 +- COMPANY: 3495 +- STUDENT: 3500 + +## Authentication Script +## Application +## Student +## Company +## RAS diff --git a/index.md b/index.md index 41d6175..d9aa9fe 100644 --- a/index.md +++ b/index.md @@ -3,5 +3,6 @@ title: Home layout: home nav_order: 1 --- -RAS-Backend Documentation ---- \ No newline at end of file +## RAS Backend Documentation +RAS is the new recruitment automation system developed by a team of 10 undergraduate students for the Students' Placement Office, IIT Kanpur to ease-out and automate the internship and placement process of the institute. + From 8e929fea8a3511125483ae21916cb9ee1c404adb Mon Sep 17 00:00:00 2001 From: Tejas Ahuja Date: Tue, 6 Dec 2022 13:56:29 +0530 Subject: [PATCH 2/6] some corrections rectified --- docs/cmd/auth.md | 1 + docs/cmd/cmd.md | 8 +++++--- docs/overview.md | 2 +- index.md | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/cmd/auth.md b/docs/cmd/auth.md index 88d773b..c8d1862 100644 --- a/docs/cmd/auth.md +++ b/docs/cmd/auth.md @@ -21,6 +21,7 @@ The authentication service is hosted on port 3475. - CORS - Cross-Origin Resource Sharing : Custom middleware defined in the middleware documentation - Recovery (Standard Go middleware) : to recover from any panic - Logger (Standard Go Middleware) : To log the status +- Gin middleware Initialized service is passed to [auth router]. diff --git a/docs/cmd/cmd.md b/docs/cmd/cmd.md index 8978bfd..d5fecea 100644 --- a/docs/cmd/cmd.md +++ b/docs/cmd/cmd.md @@ -7,10 +7,10 @@ has_children: true # main.go -A mail service is initialized and passed on to the following handlers and the errors are returned to the main function and logged by the logger. +A mail service is initialized in a goroutine and passed on to the following handlers. The errors are returned to the main function and logged by the logger. {: .info} -Mail read and write timeouts are defined to 5 seconds and 10 seconds respectively +Mail read and write API call timeouts are defined to 5 seconds and 10 seconds respectively. The mailer works instantly. The service is passed on to the following handlers. The handlers are defined in the [overview]({{ site.baseurl }}{% link docs/overview.md %}) for reference. @@ -26,4 +26,6 @@ The service is passed on to the following handlers. The handlers are defined in --- #### References - [chan - Go Command](https://www.sohamkamani.com/golang/channels/) -- [errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) \ No newline at end of file +- [errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) +- [Go Routines](https://go.dev/tour/concurrency/1) +- [Gin multiple port http services](https://github.com/gin-gonic/gin/issues/346) \ No newline at end of file diff --git a/docs/overview.md b/docs/overview.md index d30fe2e..82229dd 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -4,7 +4,7 @@ layout: default nav_order: 2 --- # Overview -The program is divided into multiple sections for the easy management of the different parts. The different sections of the program use separate ports for increased stability. A crash at one of the ports/handler leaves the others remain unaffected. +The application is divided into multiple sections and follows a sort of neomonolith architecture. The different sections of the application use separate ports for increased stability. A crash at one of the ports/handler leaves the others remain unaffected. - RAS: 3470 - AUTH: 3475 diff --git a/index.md b/index.md index d9aa9fe..3ea6bdb 100644 --- a/index.md +++ b/index.md @@ -4,5 +4,5 @@ layout: home nav_order: 1 --- ## RAS Backend Documentation -RAS is the new recruitment automation system developed by a team of 10 undergraduate students for the Students' Placement Office, IIT Kanpur to ease-out and automate the internship and placement process of the institute. +RAS is the recruitment automation system developed by a team of 10 undergraduate students for the Students' Placement Office, IIT Kanpur to ease-out and automate the internship and placement process of the institute. From dad46ac322e9ba194295ede4601843e943ff6050 Mon Sep 17 00:00:00 2001 From: Tejas Ahuja Date: Tue, 6 Dec 2022 16:19:50 +0530 Subject: [PATCH 3/6] mail documentation --- docs/mail.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++- index.md | 2 +- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/docs/mail.md b/docs/mail.md index 721aeab..2554fdb 100644 --- a/docs/mail.md +++ b/docs/mail.md @@ -2,4 +2,55 @@ title : mail layout : default nav_order: 11 ---- \ No newline at end of file +--- +# config.go +This file initializes the mailer with the required constants. Viper is used to get the constants from [_config.yml]() and the [secrets file](). Logrus is used to log the status. + +Following constants are initialized +- user +- sender : user + "@iitk.ac.in" +- pass : password +- host +- port +- webteam : email address of the web-team + +{: .info} +user, password, webteam are defined in the secrets file. + +--- +# service.go +This file defines methods to build messages. + +Mail struct is defined with the standard mailing properties. +- To +- Subject +- Body + +## Function BuildMessage +This method builds the message by setting the From, Subject, To and Signature properties of the body of the mail and returns the final body. + +[Read the code here]() + +{: .info} +All the recipients are put into BCC when the message is mass mailed. + +## Function Service +This is the function started in [cmd]() as a Go routine for sending mails. The function receives the mail queue channel, builds the message of the mail using [BuildMessage function]() and sends the mail using the SMTP protocol. + +Errors are logged by logrus. + +{: .info} +The mail is forwarded to the webteam mail as well + +--- +# generate.go +This file takes all the properties of the mail and generates the final object of type Mail to be sent using the SMTP protocol. + +- **Function GenerateMail** - to generate a single mail +- **Function GenerateMails** - to generate multiple mails + +--- +#### References +- [logrus middleware](https://pkg.go.dev/github.com/sirupsen/logrus#section-readme) +- [A Tour of Go](https://go.dev/tour/concurrency/1) - Do check this out +- [SMTP Documentation](https://pkg.go.dev/net/smtp) \ No newline at end of file diff --git a/index.md b/index.md index 3ea6bdb..5524f12 100644 --- a/index.md +++ b/index.md @@ -4,5 +4,5 @@ layout: home nav_order: 1 --- ## RAS Backend Documentation -RAS is the recruitment automation system developed by a team of 10 undergraduate students for the Students' Placement Office, IIT Kanpur to ease-out and automate the internship and placement process of the institute. +RAS is the Recruitment Automation System developed by a team of 10 undergraduate students for the Students' Placement Office, IIT Kanpur to ease-out and automate the internship and placement process of the institute. From 075863e2b6d452eec3eb59281f0dc2dbe47520e1 Mon Sep 17 00:00:00 2001 From: Tejas Ahuja Date: Tue, 6 Dec 2022 16:51:23 +0530 Subject: [PATCH 4/6] utils documentation --- docs/util.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/util.md b/docs/util.md index e00c7a8..0e1f7dd 100644 --- a/docs/util.md +++ b/docs/util.md @@ -2,4 +2,29 @@ title : Utils layout : default nav_order: 16 ---- \ No newline at end of file +--- + +# convert.go +This file contains utilities to parse data as required in other parts of the program. + +Functions in the file +- **ParseUint** - converts a string to an unsigned integer. Very standard implementation. If it cannot be converted, then 0 along with non-nil error is returned. + +{: .info} +>2 objects are returned (converted unsigned integer, error). + +- **ParseString** - Converts an unsigned integer to string. + +--- + +# prog_dept.go +This file contains utilities to check and compare the program departments. +Only 1 function is defined to check if the given branch ID is a double major branch ID or not. + +{: .info } +> array of all double major program department IDs +> +> 28: AE | 29: BSBE | 30: CE | 31: CHE | +> 32: CSE | 33: EE | 34: MSE | 35: ME | +> 96: CHM | 36: ECO | 37: MTH | 97: SDS | +> 98: PHY | From 749f9eeb2ac5bfe326db26191695cc51e89ecb5b Mon Sep 17 00:00:00 2001 From: Tejas Ahuja Date: Thu, 22 Dec 2022 03:03:52 +0530 Subject: [PATCH 5/6] cmd folder complete and overview edited --- docs/cmd/admin.md | 8 ++++---- docs/cmd/auth.md | 6 +++--- docs/cmd/company.md | 5 ++++- docs/cmd/ras.md | 8 +++++++- docs/cmd/student.md | 6 +++++- docs/overview.md | 40 +++++++++++++++++++++++++--------------- docs/util.md | 3 ++- 7 files changed, 50 insertions(+), 26 deletions(-) diff --git a/docs/cmd/admin.md b/docs/cmd/admin.md index 93afc6f..7882dfd 100644 --- a/docs/cmd/admin.md +++ b/docs/cmd/admin.md @@ -6,21 +6,21 @@ parent : cmd --- # admin.go -This file defines mail service handler for the admin service. -The Go viper package is used to read the [config.yaml secrets file]() and get the port of the various administrator services. A new Go engine is initialized and the required middlewares are attached to it. + +The Go viper package is used to read the [config.yaml configuration constants file]() and get the port of the various administrator services. A new Go engine is initialized and the required middlewares are attached to it. ## function adminRCServer -It returns an http server instance of the adminRC server for reading and writing to the mail service. +It returns an http server instance for listening to requests of the mail service. {: .info} The adminRC service is hosted on port 3490. ### Middlewares Attached to the process - [CORS]() : Custom middleware -- [Authenticator]() : Custom middleware +- [Authenticator]() : Custom middleware to authenticate that the user is an admin. - [EnsurePsuedoAdmin]() : Custom middleware - Recovery - Logger diff --git a/docs/cmd/auth.md b/docs/cmd/auth.md index c8d1862..f58a51f 100644 --- a/docs/cmd/auth.md +++ b/docs/cmd/auth.md @@ -7,12 +7,12 @@ parent : cmd # auth.go -This file defines mail service handler for the authentication service. +This file configures the mail service handler for the authentication service. ## function authServer -It returns an http server instance of the started server for reading and writing to the mail service. +It returns an http server instance of the started server for broadcasting content on the mail channel. -The Go viper package is used to read the [config.yaml secrets file]() and get the port of the authentication service. A new Go engine is initialized and the required middlewares are attached to it. +The Go viper package is used to read the [config.yaml configuration constants file]() and get the port of the authentication service. A new Go engine is initialized and the required middlewares are attached to it. {: .info} The authentication service is hosted on port 3475. diff --git a/docs/cmd/company.md b/docs/cmd/company.md index 550c79e..a033dae 100644 --- a/docs/cmd/company.md +++ b/docs/cmd/company.md @@ -3,4 +3,7 @@ title : company layout : default nav_order: 3 parent : cmd ---- \ No newline at end of file +--- + +# company.go +Similar to other handler files, this file configures the mail service handler to be passed to the company router. \ No newline at end of file diff --git a/docs/cmd/ras.md b/docs/cmd/ras.md index 28980c5..ac53b25 100644 --- a/docs/cmd/ras.md +++ b/docs/cmd/ras.md @@ -3,4 +3,10 @@ title : ras layout : default nav_order: 4 parent : cmd ---- \ No newline at end of file +--- + +# ras.go +Similar to other handler files, this file configures the mail service handler to be passed to the ras router. + +{: .info} +The RAS service doesn't require authentication as is is just used to test the mail service and send a testing mail. \ No newline at end of file diff --git a/docs/cmd/student.md b/docs/cmd/student.md index f1b07cb..7eb23b5 100644 --- a/docs/cmd/student.md +++ b/docs/cmd/student.md @@ -3,4 +3,8 @@ title : student layout : default nav_order: 5 parent : cmd ---- \ No newline at end of file +--- + +# student.go + +Similar to other handler files, this file configures the mail service handler to be passed to the student router. \ No newline at end of file diff --git a/docs/overview.md b/docs/overview.md index 82229dd..cd8f5ce 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -6,18 +6,28 @@ nav_order: 2 # Overview The application is divided into multiple sections and follows a sort of neomonolith architecture. The different sections of the application use separate ports for increased stability. A crash at one of the ports/handler leaves the others remain unaffected. -- RAS: 3470 -- AUTH: 3475 -- STUDENT: 3480 -- COMPANY: 3485 -- ADMIN: -- RC: 3490 -- APP: 3492 -- COMPANY: 3495 -- STUDENT: 3500 - -## Authentication Script -## Application -## Student -## Company -## RAS +## RAS: 3470 +This is the testing handler. It is used to get ping responses from the server. It is also used to test the connection to the mail controller. + +## AUTH: 3475 +This handler is responsible for authentication of the user. It is responsible for checking the credentials of the user and returning the appropriate response. It also handles the registration of new users. + + +## STUDENT: 3480 +This handler has all the routes related to the student. It is responsible for handling the requests related to the student's application, profile, etc. + +## COMPANY: 3485 +This handler has all the routes related to the company. It is responsible for handling the requests related to the company's new job openings, notices, application status etc. + +# ADMIN: +Overview of the admin handlers +## RC: 3490 +This handler is responsible for handling the requests related to the RC. It is used by the admin to post notices, reminders, verify resumes and answers to rc questions. + +## APP: 3492 +This handler contains all the APIs related to the admin RC events, proformas, etc. It is used by the admin to verify the proforma, add new proforma, etc. +## COMPANY: 3495 +This handler contains all the APIs related to the company. It is used by the admin to verify the company, add new company, etc. +## STUDENT: 3500 +This handler contains all the APIs related to the student. It is used by the admin to verify the student, add new student, etc. + diff --git a/docs/util.md b/docs/util.md index 0e1f7dd..9f04e22 100644 --- a/docs/util.md +++ b/docs/util.md @@ -19,7 +19,8 @@ Functions in the file # prog_dept.go This file contains utilities to check and compare the program departments. -Only 1 function is defined to check if the given branch ID is a double major branch ID or not. + +**Function isDoubleMajor** to check if the given branch ID is a double major branch ID or not. (returns boolean) {: .info } > array of all double major program department IDs From 6290babae5348bf528d9103c176c989ac65928a6 Mon Sep 17 00:00:00 2001 From: Tejas Ahuja Date: Thu, 22 Dec 2022 03:21:46 +0530 Subject: [PATCH 6/6] middleware relevance added --- docs/cmd/admin.md | 6 +++--- docs/cmd/auth.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/cmd/admin.md b/docs/cmd/admin.md index 7882dfd..f6c4350 100644 --- a/docs/cmd/admin.md +++ b/docs/cmd/admin.md @@ -19,9 +19,9 @@ It returns an http server instance for listening to requests of the mail service The adminRC service is hosted on port 3490. ### Middlewares Attached to the process -- [CORS]() : Custom middleware -- [Authenticator]() : Custom middleware to authenticate that the user is an admin. -- [EnsurePsuedoAdmin]() : Custom middleware +- [CORS]() : Custom middleware to allow cross-origin requests. +- [Authenticator]() : Custom middleware to get the role ID of the user using the service. +- [EnsurePsuedoAdmin]() : Custom middleware to ensure that the role ID is that of a pseudo admin. (OPC, GOD, APC and Chairman) - Recovery - Logger diff --git a/docs/cmd/auth.md b/docs/cmd/auth.md index f58a51f..583590e 100644 --- a/docs/cmd/auth.md +++ b/docs/cmd/auth.md @@ -18,7 +18,7 @@ The Go viper package is used to read the [config.yaml configuration constants fi The authentication service is hosted on port 3475. ### Middlewares Attached to the process -- CORS - Cross-Origin Resource Sharing : Custom middleware defined in the middleware documentation +- CORS - Cross-Origin Resource Sharing : Custom middleware to allow cross-origin requests. - Recovery (Standard Go middleware) : to recover from any panic - Logger (Standard Go Middleware) : To log the status - Gin middleware