Opportunity Calendar is the one-stop place to refer important opportunities available in tech-space like newly posted jobs, internships, hackathons, tech-conferences, scholarships, etc.
The opportunity_id field is not needed, as we will be using the unique id generated by mongoose for tasks needing id.
It has to be removed from all the places in the project.
I think we should create a User Model for different users , so that they can view various opportunities and apply to them as per their need and requirements , along with this a moderator who can verify if the job posted is genuine or not
In controllers/opportunity/index.js , managers/opportunity/index.js , services/opportunity/index.js , update the createOpportunity method to create the Opportunity with one more field onlyForFemale.
I checked to make sure that this issue has not already been filed
I'm reporting the issue to the correct repository (for multi-repository projects)
Expected Behavior
@Manvityagi I guess the User api needs to be integrated. There is no user authentication as of now (while the UI is already ready for this). Since there's no user api hence we are not able to proceed with the (Bookmark/Save and share functionality).
I also checked that the frontend is in React, so probably you guys will be using RESTful APIs. So I wish to contribute to this project by implementing the following features -
Authentication using JWT
Routes protection middlewares to prevent unauthorized access of certain routes.
Expected end result :
User authentication
We can secure our APIs with this jwt middleware.
userId, admin access can be stored in jwt which can be decoded in frontend to use further.
The GET API should be divided into the controllers, services, and managers as per the convention (can lookup the POST API for reference), Refer Project Structure to know the significance of controllers, managers, services.
The endpoint should be /opportunities?type=JOB
The entries should be returned as per the query param type
The 6 possible values if type query param are -
'HACKATHON',
'JOB',
'INTERNSHIP',
'SCHOLARSHIP',
'CONFERENCE',
'CODINGCOMPETITION',
Make a folder helpers in root dir, and move all the pagination logic in managers/opportunity/index.js to a function in helpers/pagination.js, and use the function after importing in managers/opportunity/index.js.
The functionality of pagination should not be affected
This is being done to keep the code clean, modular, and maintainable
Use two additional query params - limit and offset
Instead of returning all the opportunities return something like: limited_query_set = query_set[offset : offset + limit].
An Example: if offset = 7 & limit = 20, The opportunities 7th to 27th should be returned.
PS:
Use
"DEFAULT_PAGE_LIMIT" - 20
"DEFAULT_PAGE_OFFSET", - 0
The changes will be effectively done in /managers/opportunity/index.js in the getOpportunities function.
Update the API documentation accordingly inside routes/opportunity.js
The GET API currently can filter only on the basis of opportunityType, modify it to filter on the basis of onlyForFemale field also, which is a boolean field in `opportunity schema
I would like to work on creating the sign up and login routes and controller for this project as a participant of GSSOC'21.
Please assign this to me and add the relevant tags.
Inside this section https://github.com/Girl-Code-It/Opportunity-Calendar-Backend#documentation-,
update Swagger Docs link with https://opportunity-calendar.herokuapp.com/playground/
and put this link as the first value in the documentation list
I checked to make sure that this issue has not already been filed
I'm reporting the issue to the correct repository (for multi-repository projects)
Proposal
body-parser is been deprecated and Express version 4.16+, their own body-parser implementation is now included in the default Express package so there is no need for you to download another dependency.
You have added a line to your code that looks like the following:
app.use(bodyparser.json());
If you are using Express 4.16+ you can now replace that line with:
app.use(express.json());
You also have the following code in your environment:
As of now, the schema in Swagger documentation blocks (written as JSDoc) contains a response schema. This can be extracted into a separate file, and reference whenever needed using $ref. There are two benefits of doing it. It will reduce the file size so that the file can be maintained easily. Second, It will allow us to reuse certain schema in more than one places.
What needs to be done?
Extract the schema to a new file, preferably in docs/ROUTE_FILE_NAME.json(create if necessary). Then reference this file wherever required. For resources, please check Swagger docs (definitions, refs etc).
Hello @Manvityagi ,
I would like to contribute on backend part of this project as part of GSSOC'21 programme. Willing to discuss more about this project. Add me to relevant group or discord channel whenever it will be created.
I checked to make sure that this issue has not already been filed
I'm reporting the issue to the correct repository (for multi-repository projects)
Feature Request
I can see that there are apis for creating and fetching the opportunities but no api exists for updating and deleting. @Manvityagi@abdus Kindly look into this issue and assign it to me if it makes sense.
GET API Tests are not updated for the pagination feature,
All the tests in controllers, managers, services shall be updated as per the latest version of GET API.
I am a GSSOC'21 participant and would like to add a feature in README.md where the contributors get automatically updated.
Can you please assign this issue to me?