Skip to content

buildwithricky/permitio-tms-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travel Management System - Backend

This repository contains the backend code for the Travel Management System demo application, showcasing secure and scalable authorization using Permit.io in an Express.js environment.

Getting Started

Follow these steps to run the backend locally on your machine.

Prerequisites

  • Node.js (version 16 or higher recommended)
  • npm or yarn
  • A MongoDB database instance (local or cloud)
  • A Permit.io account with Cloud PDP token
  • JWT secret for token signing

Setup

  1. Clone the repository:

    git clone https://github.com/buildwithricky/permitio-tms-backend.git
    cd travel-management-backend
  2. Install dependencies:

    Using npm:

    npm install
  3. Configure environment variables:

    Create a .env file in the project root and add the following variables:

    Copy the .env.example variables before proceeding into the .env file you created earlier

.env.example - replace values with your own before running

PERMIT_API_KEY=your_permit_api_key_here PERMIT_PDP_URL=cloud_pdp_url MONGO_URI=your_mongodb_connection_string_here JWT_SECRET=your_jwt_secret_here


> **Note:** For production deployments, consider using Permit.io’s Opal or your own cloud instance for enhanced control and security.

4. **Run the backend server:**

```bash
npm start

The server will start on http://localhost:4000 by default.

API Endpoints

Refer to the documentation in the article for detailed API usage and authorization flows.

Article Link

Down below is a link to an article , have fun reading https://medium.com/p/travel-management-system-with-granular-access-control-using-permit-io-03d291072924?source=social.linkedin&_nonce=vD7vfFDD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published