{"id":20617849,"url":"https://github.com/joozef315/rbac-system","last_synced_at":"2026-04-13T14:32:33.792Z","repository":{"id":250891661,"uuid":"835771680","full_name":"JooZef315/RBAC-System","owner":"JooZef315","description":"RBAC System with JWT Authentication using React and Express.","archived":false,"fork":false,"pushed_at":"2024-08-03T14:37:45.000Z","size":1102,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T04:46:21.649Z","etag":null,"topics":["express","jwt","nodejs","postgresql","prisma","react","role-based-access-control","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JooZef315.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T13:54:23.000Z","updated_at":"2024-10-07T20:46:23.000Z","dependencies_parsed_at":"2024-11-20T11:01:42.034Z","dependency_job_id":null,"html_url":"https://github.com/JooZef315/RBAC-System","commit_stats":null,"previous_names":["joozef315/knb-task","joozef315/rbac-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JooZef315%2FRBAC-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JooZef315%2FRBAC-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JooZef315%2FRBAC-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JooZef315%2FRBAC-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JooZef315","download_url":"https://codeload.github.com/JooZef315/RBAC-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242277434,"owners_count":20101531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","jwt","nodejs","postgresql","prisma","react","role-based-access-control","tailwindcss"],"created_at":"2024-11-16T12:06:16.044Z","updated_at":"2026-04-13T14:32:33.729Z","avatar_url":"https://github.com/JooZef315.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RBAC System with JWT Authentication\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Features](#features)\n3. [Tech Stack](#tech-stack)\n4. [Installation and Usage](#installation-and-usage)\n   - [Backend](#backend)\n   - [Frontend](#frontend)\n5. [Project Structure](#project-structure)\n6. [Best Practices](#best-practices)\n\n## Introduction\n\nThis project implements a Role-Based Access Control (RBAC) system with JWT authentication using React for the frontend and Express for the backend. The system manages user roles and permissions, ensuring secure and appropriate access to various parts of the application.\n\n## Features\n\n- User Authentication (Login, Register)\n- Role Management (Admin, User)\n- Protected Routes Based on Roles\n- JWT Token Handling with Refresh Tokens\n- Responsive UI with Tailwind CSS\n\n## Tech Stack\n\n**Frontend:**\n\n- React\n- Zustand\n- React Router v6\n- Tailwind CSS\n- Vite\n\n**Backend:**\n\n- Node.js\n- Express\n- Prisma ORM\n- PostgreSQL\n\n## Installation and Usage\n\n### Backend\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/JooZef315/KNB-task.git\n   cd KNB-task/server\n   ```\n2. **Install dependencies:**\n   ```bash\n    npm install\n   ```\n3. **Set up environment variables:**\n   Create a .env file in the backend directory and add your database and JWT secret configurations.\n   ```bash\n    PORT=3001\n    DATABASE_URL=\n    ACCESS_TOKEN_SECRET =\n    REFRESH_TOKEN_SECRET =\n   ```\n4. **Run Prisma migrations:**\n   ```bash\n    npx prisma migrate dev\n    npx prisma generate\n   ```\n5. **Start the backend server:**\n   ```bash\n    npm run dev\n   ```\n   The backend server will be running at http://localhost:3001.\n\n### Frontend\n\n1. **Navigate to the frontend directory:**\n   ```bash\n    cd ../client\n   ```\n2. **Install dependencies:**\n   ```bash\n    npm install\n   ```\n3. **Start the Frontend server:**\n   ```bash\n   npm run dev\n   ```\n   The frontend server will be running at http://localhost:5173.\n\n### Project Structure\n\n    ├── server/\n    │ ├── src/\n    │ │ ├── controllers/\n    │ │ ├── middleware/\n    │ │ ├── services/\n    │ │ ├── routes/\n    │ │ ├── utils/\n    │ │ ├── validators/\n    │ │ └── index.ts\n    │ │ └── types.ts\n    │ ├── prisma/\n    │ │ ├── migrations/\n    │ │ └── schema.prisma\n    │ ├── .env\n    │ └── package.json\n    │\n    ├── client/\n    │ ├── src/\n    │ │ ├── components/\n    │ │ ├── hooks/\n    │ │ ├── pages/\n    │ │ ├── store/\n    │ │ ├── utils/\n    │ │ ├── App.tsx\n    │ │ ├── index.css\n    │ │ └── main.tsx\n    │ │ └── vite-env.d.ts\n    │ ├── assets/\n    │ ├── README.md\n    │ ├── postcss.config.js\n    │ ├── tailwind.config.js\n    │ ├── tsconfig.app.json\n    │ ├── tsconfig.json\n    │ ├── tsconfig.node.json\n    │ └── package.json\n    │ └── vite.config.ts\n    │\n    └── README.md\n\n### Best Practices\n\n- Secure Token Storage: Use HTTP-only cookies for storing refresh tokens to prevent XSS attacks.\n- State Management: Use Zustand for managing global state in a scalable way.\n- Role-Based Access: Implement middleware on the backend to protect routes and ensure proper authorization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoozef315%2Frbac-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoozef315%2Frbac-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoozef315%2Frbac-system/lists"}