This is the a project from Coderhouse Backend Programming course
-
Clone the repository (to learn how check this link)
-
Be sure to have NodeJS (>=18.x) and NPM installed. Test this with the commands
node -vornpm -vin a terminal. -
Install the dependencies with
npm install. -
For testing, start the server with
npm run startand go to http://localhost:8080/
The ones marked are the ones currently used
- express : web framework.
- express-routemap : express middleware to print all registered routes in a tree structure.
- express-handlebars : handlebars view engine for express.
- socket.io : enables real-time bidirectional event-based communication.
- mongoose : MongoDB object modeling tool.
- mongoose-paginate-v2 : mongoose plugin to paginate mongoose queries.
- dotenv : loads environment variables from a .env file.
- inspirational-quotes : get inspirational quotes.
- express-session : session middleware.
- connect-mongo : MongoDB session store for Connect and Express.
- bcrypt : library to help you hash passwords.
- passport : authentication middleware for Node.js.
- passport-local : passport strategy for authenticating with a username and password.
- passport-github2 : passport strategy for authenticating with GitHub using the OAuth 2.0 API.
- passport-google-oauth20 : passport strategy for authenticating with Google using the OAuth 2.0 API.
- passport-jwt : passport strategy for authenticating with a JSON Web Token.
- express-jwt : middleware that validates JsonWebTokens and sets req.user.
- jsonwebtoken : implementation of JSON Web Tokens.
- cookie-parser : cookie parsing middleware.
- uuid : simple, fast generation of RFC4122 UUIDS.
- nodemailer : module for Node.js applications to allow easy as cake email sending.
- winston : logger for just about everything.
- colors : get colors in your node.js console.
- swagger-jsdoc : allows you to integrate swagger using JSDoc comments in your code.
- swagger-ui-express : serves auto-generated swagger-ui generated API docs from express.
- connect-flash : special area of the session used for storing messages.
- express-validator : middleware for validating data.
- sequelize : promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.
- cors : CORS is a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.
The ones marked are the ones currently used
- nodemon : tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.
- faker-js : generate massive amounts of fake data in the browser and node.js.
- jwt is not being able to populate req.user from the cookies in the newest version of express-jwt, so we need to downgrade it to 6.1.0. Run:
npm uninstall express-jwt
npm install express-jwt@6.1.0
-
When working with thunderclient te JWT is not read from the cookie. Login in the front end and use Postman instead (copy the jwt cookie manually).
-
Chat: When a chat is deleted, the user is not asign a new empty chat, it just crashes the socketIO functionality.
-
Cart: The same as with chat but at least there is a sign of the error in the frontend