Home

Awesome

Dev.to Ory NodeJS NestJS Angular Jest Postgres Nx Docker

fork with dotenv-vault

<img width="1389" alt="CatFostering-min" src="https://github.com/getlarge/cat-fostering/assets/15331923/5911cc7f-e853-47bb-83d6-19ca9341ff2d">

CatFostering

This demonstration app is a web-based platform (REST API) called CatFostering. The CatFoster application is a simplified example that demonstrates the integration of Ory in a NestJS application with the NestJS Ory Integration libraries.

Note If this is your first time working with Ory, I recommend reading the Introduction to Ory article to familiarize yourself with the core components and concepts of Ory.

Key Features

  1. User Authentication and Profile Management:

    • Ory Integration: Utilize Ory's authentication system to handle user registrations, logins, password resets, and profile management.
    • User Roles: There is one static user role, Admin, that a super admin can assign to users after registration.
  2. Cat Profiles:

    • Listing and Management: Cat owners can create profiles for their cats, including photos, descriptions, special care instructions, and availability for fostering. Admins can edit and delete cat profiles.
    • Search and Filters: Users looking to foster cats can search for them based on filters.
  3. Fostering Matchmaking:

    • Requests and Approvals: Cat fosters can send fostering requests to cat owners, who can review and approve or deny them based on the foster's profiles.
    • Authorization Checks: Use Ory to manage authorization, ensuring that only cat owners can approve fostering requests and only registered users can send requests.

Design phase

Architecture

---
config:
  fontFamily: ''
  theme: base
  themeVariables:
    primaryColor: '#5d9fd8'
    textColor: black
    secondaryColor: '#f8f8f8'
    fontSize: "12px"
---

flowchart TD
    UI("fa:fa-laptop Self-service UI -")
    OryKratos(["fa:fa-shield Ory Kratos -"])
    OryKeto(["fa:fa-shield Ory Keto -"])
    NestJSApp("fa:fa-code NestJS App -")
    AngularApp("fa:fa-code Angular App -")
    Postgres[("fa:fa-database Postgres -")]

    UI -- Register/Login <br>Manage Account --> OryKratos
    NestJSApp -- Verify cookie \nor JWT --> OryKratos
    NestJSApp -- Create relationships <br> Check permissions --> OryKeto
    NestJSApp -- CRUD Operations \n Store User and \nCat Profiles --> Postgres
    OryKratos -. Send webhooks .-> NestJSApp
    AngularApp -->|REST interactions| NestJSApp
    AngularApp -->|Redirect to authenticate| UI

    style UI fill:#a0c8e8,stroke:#333,stroke-width:2px,stroke-dasharray: 0
    style OryKratos fill:#ffdd57,stroke:#333,stroke-width:2px
    style NestJSApp fill:#ff6f61,stroke:#333,stroke-width:2px
    style AngularApp fill:#ff6f61,stroke:#333,stroke-width:2px
    style OryKeto fill:#6accbc,stroke:#333,stroke-width:2px
    style Postgres fill:#5d9fd8,stroke:#333,stroke-width:2px

Check out the complete Ory Integration guide to learn how to integrate Ory Kratos and Ory Keto into your NestJS application.