Skip to content

Advanced Node.js API: A TypeScript API showcasing TDD, Clean Architecture, and Design Patterns, simulating a Facebook login. Demonstrates SOLID principles and advanced TypeScript features.

Notifications You must be signed in to change notification settings

GabrielTSR/Advanced-Nodejs-API-Express

Repository files navigation

Advanced Node.js API

Description

The advanced-node project is a comprehensive Node.js API that simulates a fictitious Facebook login. This project utilizes TypeScript to enhance development with static typing and leverages modern software engineering principles. It demonstrates best practices in Test-Driven Development (TDD), Clean Architecture, and Design Patterns. Additionally, the project implements SOLID principles, advanced TypeScript features, and Git best practices to ensure a robust and scalable API.

Features

  • Test-Driven Development (TDD): Follow a disciplined approach to write tests before implementation.
  • Clean Architecture: Organize code into layers to separate concerns and improve maintainability.
  • Design Patterns: Implement design patterns correctly to solve common software design problems.
  • SOLID Principles: Apply SOLID principles to create a well-structured and maintainable codebase.
  • TypeScript: Utilize TypeScript features such as Utility Types, Interfaces, Type Aliases, and Modular Path Resolution.
  • Git Best Practices: Follow best practices for version control.

Getting Started

Prerequisites

  • Node.js (v16.x)
  • npm (Node Package Manager)
  • TypeScript (v4.7.4 or above)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/advanced-node.git
  2. Navigate to the project directory:

    cd advanced-node
  3. Install the dependencies:

    npm install

Configuration

  1. Create a .env file in the root directory and configure your environment variables:

    # Example configuration
    DB_HOST=localhost
    DB_PORT=5432
    DB_USER=youruser
    DB_PASSWORD=yourpassword
    

Running the Project

  • Development Mode:

    npm run dev

    This command runs the project in development mode with automatic reloading.

  • Build and Start:

    npm run build
    npm start

    This command builds the project and starts the application.

Testing

  • Run All Tests:

    npm test
  • Watch for Changes:

    npm run test:watch
  • Run Tests with Coverage:

    npm run test:coverage
  • Run Specific Tests:

    npm run test:fb-api

Linting and Formatting

  • Lint Code:

    npm run lint
  • Fix Linting Issues:

    npm run lint:fix

Contributing

  1. Fork the repository.

  2. Create a feature branch:

    git checkout -b feature/your-feature
  3. Commit your changes:

    git commit -am 'Add new feature'
  4. Push to the branch:

    git push origin feature/your-feature
  5. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • TypeScript for providing a robust typing system.
  • Express for a minimalist web framework.
  • Jest for a powerful testing framework.
  • ESLint for maintaining code quality.

About

Advanced Node.js API: A TypeScript API showcasing TDD, Clean Architecture, and Design Patterns, simulating a Facebook login. Demonstrates SOLID principles and advanced TypeScript features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages