auth-service

Authentication Service

CI status

License: MIT Version

Code Smells Vulnerabilities Duplicated Lines (%) Quality Gate Status Technical Debt Security Rating

Authentication service is responsible for managing user authentication to the LetsStreamIt platform. It manages user registration and login.

Node.js Express jwt

Docker

GitHub Actions Semantic Release Semantic Versioning Conventional Commits Renovate SonarCloud

Typedoc

It is possible to run the service locally or through a Docker container.

  1. To run the service locally:

    git clone https://github.com/LetsStreamIt/auth-service.git
    cd auth-service
    npm install
    npm run build && npm run start
  2. Using a Docker container:

    1. You can build the Docker image locally:

      docker build -t auth-service .
      docker run -p 3000:3000 auth-service
    2. Or you can pull the image from the GitHub Container Registry:

      docker pull ghcr.io/letsstreamit/auth-service:main
      docker run -p 3000:3000 ghcr.io/letsstreamit/auth-service:main

If you want to change the default configuration, you can do so by creating a .env file in the root of the project.

The following variables can be set:

Variable Description Default
AUTH_SERVICE_PORT The port of the service 3000
JWT_SECRET The secret used to sign the JWT tokens testingsecret
PROFILE_SERVICE_HOSTNAME The hostname of the profile service localhost
PROFILE_SERVICE_PORT The port of the profile service 8080
MONGO_HOSTNAME The hostname of the MongoDB server localhost
MONGO_PORT The port of the MongoDB server 27017

The .env file should look like this:

AUTH_SERVICE_PORT=3000
JWT_SECRET=testingsecret
PROFILE_SERVICE_HOSTNAME=localhost
PROFILE_SERVICE_PORT=8080
MONGO_HOSTNAME=localhost
MONGO_PORT=27017

When running the service locally, the .env file is automatically loaded.

When running the service in a Docker container, you can pass the environment variables using the --env-file flag:

docker run --env-file .env -p 3000:3000 auth-service

The documentation and API reference can be found here.

If you want to contribute to the project, please read the CONTRIBUTING.md file.

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