Skip to content

hicsail/authentication-service

Repository files navigation

Auth Service

Authentication Service

Codacy Badge Codacy Badge License Docker Pulls Uptime

The Authentication Microservice provides a secure and flexible authentication and authorization system that can be easily integrated into your application. It is designed for developers who need a reliable and scalable authentication solution that can handle large volumes of users and access requests.

Features

  • Flexible Drop-in Authentication UI
  • Email registration & login
  • User Roles and Permissions

Deployed URLs

Staging

Package Urls
Client https://test-auth.sail.codes/
Admin Client https://test-auth-admin.sail.codes/
Service https://test-auth-service.sail.codes/

Production

Package Urls
Client https://auth.sail.codes/
Admin Client https://auth-admin.sail.codes/
Service https://auth-service.sail.codes/

Local Development

This section outlines the steps to set up the Authentication Service for local development.

Prerequisites

Ensure you have the following software installed on your machine:

  1. Docker
  2. Node.js
  3. npm

Setup Instructions

  1. Open a terminal and navigate to the server package directory:

    cd packages/server
    
  2. Build and run the Docker Compose file:

    docker-compose up -d --build
    
  3. Set environment variables:

    source .env.test
    
  4. Install the project's npm dependencies:

    npm i
    
  5. Generate Prisma Client JS:

    npm run prisma:generate
    
  6. Run Prisma migrations to set up your database schema:

    npm run prisma:migrate
    
  7. Start the development server:

    npm run start:dev
    
  8. Access the GraphQL Playground at http://localhost:3001/graphql.

  9. To create a project, use the following GraphQL mutation:

    mutation {
      createProject(
        project: {
          name: "test",
          description: "test",
          displayProjectName: true,
          allowSignup: true,
          googleAuth: true,
          emailAuth: true
        }
      ) {
        id,
        name
      }
    }

This mutation will create a new project with the name "test". The project's display name is set to be shown, and both signup and authentication via Google and email are allowed. The server's response will include the new project's id and name.