/mern-ts-07-auth

JWT token-based authentication with magic link. Token stored in browser with localStorage.

Primary LanguageTypeScript

SEND EMAIL WITH MERN STACK

This project aims to...

Table of Contents

Prerequisites

Make sure you have the following installed on your system:

  • Node.js (version 14.x or later)
  • npm (version 6.x or later)

Installation

  1. Clone the repository:

git clone...

  1. Navigate to the project directory:

...

  1. Install the dependencies:

npm install

Scripts

Reason for Using Separate package.json Files for Client and Server

  1. Modularity and Separation of Concerns:

    • By maintaining separate package.json files for the client and server, we ensure a clear separation of concerns. This helps in isolating dependencies specific to each part of the application, reducing potential conflicts.
  2. Independent Management:

    • Each part of the application (client and server) can be managed, updated, and deployed independently. This modular approach allows for more flexibility and control over the development and deployment processes.
  3. Reduced Complexity:

    • Managing scripts and dependencies for each part of the application separately reduces the complexity in the root package.json. This makes it easier to understand and maintain the configurations for each part.
  4. Specific Build Processes:

    • Different parts of the application often have different build processes and requirements. Keeping separate package.json files allows for tailored build scripts and configurations, which can optimize performance and deployment.
  5. Focused Dependency Management:

    • Dependencies specific to the client or server are managed independently, preventing unnecessary bloat and ensuring that only the required packages are included. This can also improve security by limiting the scope of each environment.
  6. Scalability:

    • As the project grows, the ability to manage each part independently becomes increasingly important. Separate package.json files facilitate scaling the application by allowing focused enhancements and maintenance.
  7. Easier Collaboration:

    • In a team environment, having separate package.json files allows frontend and backend developers to work more effectively within their respective domains without interfering with each other's configurations and dependencies.

Usage

  • To run the client: Navigate to the client directory and run npm run dev.
  • To run the server: Navigate to the server directory and run npm run dev.

Run the server ...

Run the client ...

Config

...