Developing NodeJS environment v18.16.0
An all-in-one project listing app with a powerful backend, enabling seamless browsing of projects, businesses, and developers while offering extensive project details and developer profiles.
A functional requirement (FR) defines the specific services and behaviors that the software system or its components must provide, encompassing inputs, system behavior, and corresponding outputs.
- Developer -
- Developer should be able to do CRUD operation on their profile
- Organization -
- Organization should be able to do CRUD operation on their profile
- Project -
- Organization should be able to do CRUD operation on their listed projects
- Proposal -
- A developer should be able to do CRUD operation on their proposals made to organization's project.
- Review
- A developer should be able to create, delete review on the organization they've worked with.
- A organization should be able to create, delete review for the developer they've worked with.
- Retrieve all Developers - GET
/developers
- SORT asc/desc based on 'any' parameter - GET
/developers?sort=city
or=-city
for descending. - SEARCH based on 'fname, lname, city, qualification' parameter of schema - GET
/developers?city=mum
- Or something more complex like
?fname=me&city=che
- Or
?qualification=BE+in+Comp&sort=fname
- Or something more complex like
- FILTER based on 'openToWork' - GET
/developers?openToWork=true
- SORT asc/desc based on 'any' parameter - GET
- Register new Developer - POST
/developers/auth/register
- generates authToken too. - Login Developer - POST
/developers/auth/login
- generates authToken too. - Retrieve specific Developer - GET
/developers/:uid
- Update specific Developer - Protected PATCH
/developers/:uid
- Delete specific Developer - Protected DELETE
/developers/:uid
- Retrive all Organization - GET
/organizations
- SORT/FILTER asc/desc based on 'any' parameter - GET
/organizations?sort=name
or=-name
for descending. - SEARCH based on 'name, domain' parameter of schema - GET
/organizations?domain=it
- Or something more complex like
?domain=it&name=raw
- Or something more complex like
- SORT/FILTER asc/desc based on 'any' parameter - GET
- Register new Organization - POST
/organizations/auth/register
- generates authToken too. - Login Organization - POST
/organizations/auth/login
- generates authToken too. - Retrive specific Organization - GET
/organizations/:uid
- Update specific Organization - Protected PATCH
/organizations/:uid
- Delete specific Organization - Protected DELETE
/organizations/:uid
- Retrive all Projects - GET
/projects
- SORT asc/desc based on 'any' parameter - GET
/projects?sort=createdAt
or=-createdAt
for descending. - SEARCH/FILTER based on 'title, techStack' parameter of schema - GET
/projects?title=edu
- FILTER based on 'featured' - GET
/developers?featured=true
- Or something more complex like
?projects?projects?board=kan&featured=false
- Or something more complex like
- SORT asc/desc based on 'any' parameter - GET
- Create new Project - Organization Protected POST
/projects
- Retrive specific Project - GET
/projects/:uid
- Update specific Project - Organization Protected PATCH
/projects/:uid
- Delete specific Project - Organization Protected DELETE
/projects/:uid
- Retrieve all proposals - Dev+Org Protected GET
/proposals
- FILTER based on 'developer', 'organization', 'project' - GET
/proposals?developer=_id
- COUNT & FILTER based on 'developer', 'organization', 'project' - GET
/proposals?developer=_id&count=1
- FILTER based on 'developer', 'organization', 'project' - GET
- Create new proposal - Dev Protected POST
/proposals
- Update specific proposal - Dev Protected PATCH
/proposals/:uid
- Delete specific proposal - Dev Protected DELETE
/proposals/:uid
- Retrieve all reviews - GET
/reviews
- FILTER based on 'developer', 'organization', 'project' - GET
/reviews?developer=_id
- SORT asc/desc based on 'any' parameter - GET
/reviews?sort=rating
or=-rating
for descending.
- FILTER based on 'developer', 'organization', 'project' - GET
- Create new review - Dev+Org Protected POST
/reviews
- Update specific review - Protected PATCH
/reviews/:uid
- Delete specific review - Protected DELETE
/reviews/:uid
201
- Create/Register Resource.200
- OK for Updating/Deleting Resource.400
- Bad Request due to possible syntax errors/invalid request payload/failed the request validation like if the data is missing or if it has a wrong type, etc.422
- Server understands but Unprocessible due to business-logic/input validations related issues.- 422 is less severe than 400. The request has reached the server. The server has acknowledged the request has got the basic structure right. But the information in the request body can't be parsed or understood.
- Difference between the above two is that the syntax of a request entity for a 422 error is correct whereas the syntax of a request that generates a 400 error is incorrect.
401
- Unauthorized access to Resource used in access_token verification404
- Resource not found.
- Daatabases : MongoDB Atlas is used to house data of Developers, Organizations, Projects, Proposals and Reviews with appropriate Schema. Apart from MongoDB, Cloudinary web service is used to handle and store multimedia.
- RESTful API : The express API of the application follows all the REST API rules and provides CRUD operations on the API's entites.
- Sorting & filtering : Approtiate endpoints are powered with the sorting and filtering quering parameters.
- Verify user paramters : Specific fields like email and password and verified by express-validator.
- Security : The API's routes are protected with authentication middlwares and SSL by hosting service.
- Documentation with developer guide and learnings.
The backend follows the concept of RESTful(Representational State Transfer) APIs
- Accept and respond with JSON
- Standard HTTP status codes
- No use of verbs in URL. Use nouns.
- Plural nouns to name a collection in URL
- Use resource nesting
- Use filtering, sorting to retrieve data
- Well compiled documentation
- Return error details in response body
- Use SSL (done with the help of hosting)
- Secure the API (with several middlewares)
The API is tested with mocha
, chai
and supertest
libraries with overal coverage of more than 90%.
🛠 Here is the detailed result of the testing.
👉🏻👉🏻 Please refer guide for getting started with the application development
- Standardized response messages.
- Ask sir about async/await vs done promises in testing and veirfy the usage of aysnc/await in delete test cases.