Git Product home page Git Product logo

elkhvn / storybooks Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 32 KB

This project is created as a learning exercise to explore Node.js and implement best practices for securing Node.js applications. The goal is to build a simple Node.js application and integrate various security measures to protect against common vulnerabilities and threats.

JavaScript 57.99% CSS 1.22% Handlebars 40.79%

storybooks's Introduction

StoryBooks

Create public and private stories from your life

This app uses Node.js/Express/MongoDB with Google OAuth for authentication

Usage

Add your mongoDB URI and Google OAuth credentials to the config.env file

# Install dependencies
npm install

# Run in development
npm run dev

# Run in production
npm start

Features

  • User authentication with JWT
  • Secure password storage using bcrypt
  • Data validation and sanitization
  • Error handling and logging
  • Rate limiting to prevent brute-force attacks
  • Input validation to prevent SQL Injection and XSS attacks
  • Secure HTTP headers using Helmet
  • Protection against CSRF attacks

Security Practices Implemented

  1. User Authentication with JWT: Secure authentication mechanism using JSON Web Tokens to ensure that only authenticated users can access protected routes.

  2. Secure Password Storage: Passwords are hashed using bcrypt before being stored in the database, making it difficult for attackers to obtain plain-text passwords.

  3. Data Validation and Sanitization: Input data is validated and sanitized to prevent SQL Injection and Cross-Site Scripting (XSS) attacks.

  4. Error Handling and Logging: Proper error handling and logging mechanisms to monitor and respond to security incidents effectively.

  5. Rate Limiting: Limits the number of requests a user can make to the server within a certain time period to prevent brute-force attacks.

  6. Secure HTTP Headers: Helmet is used to set various HTTP headers for better security, including Content Security Policy, XSS Protection, and others.

  7. CSRF Protection: Implemented Cross-Site Request Forgery protection to ensure that requests are not forged.

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • JWT (jsonwebtoken)
  • Bcrypt
  • Helmet
  • Express-rate-limit
  • Joi (for input validation)
  • Winston (for logging)

storybooks's People

Contributors

elkhvn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.