Authentication service is responsible for managing user authentication to the LetsStreamIt platform. It manages user registration and login.
It is possible to run the service locally or through a Docker container.
-
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
-
Using a Docker container:
-
You can build the Docker image locally:
docker build -t auth-service . docker run -p 3000:3000 auth-service -
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=27017When 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-serviceThe 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.
- Luca Fabri (w-disaster)
- Simone Ceredi (sceredi)