martin-markovic / learn-connect

Multi-feature platform designed to enhance the online learning experience.
MIT License
0 stars 0 forks source link

Implement and test socket.io, router, and user authentication #3

Closed martin-markovic closed 2 months ago

martin-markovic commented 2 months ago

Description

This pull request introduces several features and enhancements to the project:

  1. Development Dependencies: Added socket.io, socket.io-client, nodemon, supertest, mongoose, mocha, chai, and chai-http as development dependencies via npm install --save-dev.

  2. Test Script Addition: Included a test script in package.json for streamlined testing.

  3. Socket.io Integration: Integrated Socket.io with the HTTP server (server.js).

  4. Socket.io Testing: Implemented server.test.js to validate Socket.io functionality, ensuring it handles client connections/disconnections and starts the server using expect, server, PORT, and io.

  5. User Authentication: Implemented user authentication controller functions registerUser and loginUser in userController.js and integrated them into userRoutes.js.

  6. User Authentication Testing: Implemented userAuth.test.js to validate user authentication and routing functionality, ensuring it handles post requests and authenticates users using expect, request, express, and userRouter.

Context

These changes were necessary to enhance the project's real time capabilities with Socket.io, streamline the testing process, and improve user authentication mechanisms.

Impact

Instructions