Skip to content

logto-io/rbac-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Logto RBAC Sample Application

This repository contains the sample code for the blog post RBAC in Practice. It demonstrates how to implement Role-Based Access Control (RBAC) using Logto in a full-stack application.

Project Structure

The project consists of two main parts:

  • backend/: A Node.js API server with RBAC implementation
  • frontend/: A React application demonstrating role-based UI and access control

Getting Started

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    cp .env.example .env

Update the .env file with your Logto configuration values (issuer URL, JWKS URL, and API resource identifier from your Logto console).

  1. Start the development server:
    npm run dev

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    cp .env.example .env

Update the .env file with your configuration values.

  1. Start the development server:
    npm run dev

The application will be available at http://localhost:5173 (frontend) and the API at http://localhost:3000 (backend).

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published