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.
Follow these steps to run the backend locally on your machine.
- 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
-
Clone the repository:
git clone https://github.com/buildwithricky/permitio-tms-backend.git cd travel-management-backend -
Install dependencies:
Using npm:
npm install
-
Configure environment variables:
Create a
.envfile in the project root and add the following variables:Copy the .env.example variables before proceeding into the .env file you created earlier
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.
Refer to the documentation in the article for detailed API usage and authorization flows.
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