Asset management system with role-based access control using Prisma and Permit.io.
- Role-based access control with Permit.io
- Asset category management
- User registration and authorization
- Prisma Client Extension for permission checks
- PostgreSQL with Neon serverless database integration
- Clone the repository and navigate into it:
git clone https://github.com/Tabintel/prisma-permit-auth.git
cd prisma-permit-auth
- Install dependencies:
npm install
- Create an
.env
file in the root directory, setup the database connection, and enter the details below. Get your Permit.io SDK key
DATABASE_URL="your-postgresql-url"
PERMIT_SDK_KEY="your-permit-key"
PORT=3000
- Run migrations:
npx prisma migrate dev
- Start the server:
npm run dev
Development server: http://localhost:3000
POST /api/users
- Register new userPOST /api/assets
- Create assetGET /api/assets
- List assetsPUT /api/assets/:id
- Update assetDELETE /api/assets/:id
- Delete asset
Configure roles and permissions in Permit.io dashboard:
- Manager: Full access
- Accountant: Financial reports access
- Developer: Software licenses access