/vinesh-backend-task

Primary LanguageTypeScriptMIT LicenseMIT

This package.json file defines a starting point for building an Express API using TypeScript. Here’s a breakdown of its components:

  1. Project Info:

    • Name: vinesh-express-api
    • Version: 0.0.1
    • Description: "Starting point for building an Express API with TypeScript."
    • Main: Points to the entry file src/index.ts.
  2. Scripts:

    • "start": Runs the API using ts-node on port 3000.
    • "dev": Runs the API in development mode using nodemon to restart automatically on changes.
    • "build": Compiles the TypeScript code to JavaScript using tsc.
    • "start:dist": Runs the compiled JavaScript code from the dist directory.
    • "lint": Runs ESLint with the --fix option on the src and test folders to automatically fix linting issues.
    • "test": Runs tests using jest.
    • "typecheck": Performs a type check without emitting any compiled files.
  3. Dependencies:

    • Express: The core web framework for building APIs.
    • Axios: For making HTTP requests.
    • bcrypt: For password hashing and comparison.
    • cors: To enable cross-origin resource sharing.
    • dotenv: For loading environment variables from .env files.
    • helmet: For security-related HTTP headers.
    • jsonwebtoken: For generating and verifying JWT tokens.
    • mongodb and mongoose: To work with MongoDB databases.
    • morgan: For logging HTTP requests.
  4. Dev Dependencies:

    • TypeScript: The TypeScript language itself.
    • ts-node: To run TypeScript files directly in Node.js without precompiling.
    • nodemon: For automatically restarting the server during development.
    • Jest and Supertest: For testing, including integration tests.
    • ESLint: For linting the TypeScript code.
    • Airbnb ESLint Configuration: Follows Airbnb’s style guide for TypeScript.
    • Various @types packages: For TypeScript type definitions of the libraries (like Express, bcrypt, JWT, etc.).

This is a well-rounded setup for developing a secure, testable, and scalable API using Express and TypeScript. It includes robust linting, security, and testing mechanisms.