Everyone working on this Repository please follow the below rules:
Fork the repo on your github to work on it
Once you are dev complete, you can raise a pull request to organization repo
You need 2 reviewers to review your pull request before it can me merged to master branch of the Organization Repo
I have added gitignore for VS code. If you are using any other code editor add appropriate git ignore
Basic Folder Structure has been added to the project. Please follow the same for your development
Folder Structure
│ package.json # Has all the dependencies needed to run the application
│ server.js #The main Server file that runs the application
│
└───src # Folder having all the needed routes,controllers and middleware
│
├───CONSTANTS # Folder to hold all the Constant files
│ constants.js # File having all the constant values such as status code, responses etc.
│
├───controller # Folder having all the controllers that run the required functions for api
│ │ jobApplicationController.js # Controller to handle all the job application api's function
│ │ jobpostingController.js # Controller to handle all the job posting api's function
│ │ researcherController.js # Controller to handle all the researcher related api's function
│ │ volunteerController.js # Controller to handle all the volunteer related api's function
│ │
│ └───common_controllers # Folder having all the controllers that are used across other controllers
│ addUserController.js # Controller to handle the add api call for researcher's and volunteer's
│ loginController.js # Controller to handle login api for both researcher and volunteer
│ postAuthenticationController.js # Controller to handle the user authentication for crud operations for users
│
├───Logger # Folder with the javascript file to handle the logs
│ logger.js # Javascript file handling the logging of data
│
├───middleware # Middleware folder for handling common requests between the api's
│ authenticationMiddleware.js # Authentication Middleware used for postAuthenticationController.js
│ loginMiddleware.js # Middleware to check if user exists and to update the login attempts count
│ mongooseMiddleware.js # Middleware to handle all the mongoose queries
│
├───model # Folder having all the mongoose models to be created in mongoDB
│ jobApplicationModel.js # Model for job application
│ jobPostingModel.js # Model for posting jobs
│ researcherModel.js # Model for Researchers
│ volunteerModel.js # Model for Volunteers
│
└───Routes # Folder with all the routes. Used in server.js file
basicroutes.js # Basic routes showing hello page and the count of data for each model
jobApplicationsRoutes.js # Routes for Job Applications
jobPostingRoutes.js # Routes for Posting jobs
researcherRoutes.js # Routes for Researchers
volunteerRoutes.js # Routes for Volunteers
Installing
Clone the repository on your local machine
Once cloned cd into the folder and open the files in your favourite editor.
Open a terminal in your folder and run npm i to install all the packages.
Once all the packages are installed run npm start to start the api
To test if your application running go to http://localhost:3000/. It should give you the count of researcher,volunteers etc.
MongoDB Schema
1. Volunteer Schema
SNo.
Field
Description
Mandatory
Field Type
1.
vfirstName
First Name
Yes
String
2.
vlastName
Last Name
Yes
String
3.
vemail
Email ID
Yes
String
4.
vpassword
Password(hashable password)
Yes
String
5.
vphone
Phone Number
Yes
Number
6.
vgender
Gender
Yes
String
7.
vcreated_date
Created Date (Default value of today's date. Do not need to pass it from the UI)
No
Date
8.
vage
Between 18 and 65 (Can be changed. Open for discussion)
Yes
Number
9.
vskills
Holds an array of skills. Value to be given , seperated
Yes
Mixed
10.
vwork_experience
Holds arrays of different values [company, position, description, from, to]
No
Mixed
11.
vworks_experience_years
Years of Experience
Yes (Can be 0)
Number
12.
veducation
Holds Array of different values regarding the education of a volunteer [school, major, state, city, country, from, to]
Yes
Mixed
13.
type
Holds default value of Volunteer. No need to pass from the frontend
No
String
2. Researcher Schema
SNo.
Field
Description
Mandatory
Field Type
1.
rfirstName
First Name
Yes
String
2.
rlastName
Last Name
Yes
String
3.
remail
Email ID
Yes
String
4.
rpassword
Password(hashable password)
Yes
String
5.
rphone
Phone Number
Yes
Number
6.
rgender
Gender
Yes
String
7.
rcreated_date
Created Date (Default value of today's date. Do not need to pass it from the UI)
No
Date
8.
rage
Between 18 and 65 (Can be changed. Open for discussion)
Yes
Number
9.
rinstitute
Holds the value for Institutes
Yes
String
10.
type
Holds default value of Researcher. No need to pass from the frontend
No
String
3. Job Posting Schema
SNo.
Field
Description
Mandatory
Field Type
1.
researcherID
Researcher id of the researcher who has posted the job
Yes
String
2.
jobTitle
Title for the job
Yes
String
3.
description
Description
Yes
String
4.
requirements
Specific requirements for the job
Yes
String
5.
skills
Skills required. Takes array value from front end seperated by ","
Yes
Mixed
6.
postedDate
Posted Date (Default value of today's date. Do not need to pass it from the UI)
No
Date
7.
work_experience_required
Years of experience requird for the job. Can be 0
Yes
Number
4. Job Application Schema
SNo.
Field
Description
Mandatory
Field Type
1.
jobID
The id of the job applied to
Yes
String
2.
volunteerID
The id of the volunteer who has applied for the job
Yes
String
3.
currentStatus
The status of the application. Default value is "Application submitted"
Yes
String
4.
appliedDate
Default to the applied date
Yes
Date
API Paths
1. Volunteer API's
PS: The volunteerID mentioned here means the auto generated id from mongoDB (_id)
API's
Functionality
Example
Method
Requires token authentication
/volunteer/
Gets all the volunteers in the database (Can be used for analytical purposes)