Skip to content

infolyt/ReactTailwindAccessKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ ReactTailwindAccessKit

React TailwindCSS shadcn/ui RBAC Status

A full-featured report/project management dashboard with Role-Based Access Control (RBAC), built on modern web technologies. ✨

✨ Features

  • πŸ” Authentication System

    • JWT-based token authentication
    • User registration and login
    • Secure password hashing with bcrypt
  • πŸ›‘οΈ Role-Based Access Control (RBAC)

    • Three default roles: Admin, Editor, Viewer
    • Permission-based access management
    • Role assignment to users
  • πŸ“Š Dashboard Modules

    • Analytics - Overview with charts and statistics
    • Reports - Report management and tracking
    • Projects - Project management with progress tracking
    • Team - User and role management
    • Calendar - Event scheduling calendar
    • Invoices - Invoice tracking and management
    • Messages - Internal messaging system
    • Settings - Application configuration
  • 🎨 Theme System

    • 6 Color Themes: Slate, Blue, Emerald, Rose, Amber, Purple
    • Dark/Light mode support
    • System preference detection
    • Persistent theme preferences
  • πŸ“± Modern UI Components

    • shadcn/ui-style components
    • Responsive design
    • Accessible components (Radix UI)

πŸ› οΈ Tech Stack

Technology Version
Next.js 15.x
React 19.x
TypeScript 5.x
Tailwind CSS 3.4.x
SQLite (better-sqlite3)
Vitest 2.x

⏱️ Quick Start

πŸ“‹ Prerequisites

  • Node.js 18+
  • npm or pnpm

πŸ› οΈ Installation

# Clone the repository
cd ReactTailwindAccessKit

# Install dependencies
npm install

# Copy environment file
cp .env.example .env

# Create admin user
npm run db:create-admin

# Start development server
npm run dev

πŸ”— Access the Application

πŸ“‚ Project Structure

ReactTailwindAccessKit/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”œβ”€β”€ dashboard/          # Dashboard pages
β”‚   β”œβ”€β”€ login/             # Login page
β”‚   β”œβ”€β”€ register/           # Registration page
β”‚   β”œβ”€β”€ layout.tsx          # Root layout
β”‚   └── page.tsx           # Landing page
β”œβ”€β”€ components/             # React components
β”‚   β”œβ”€β”€ ui/               # shadcn/ui primitives
β”‚   β”œβ”€β”€ ThemeProvider.tsx  # Theme context
β”‚   β”œβ”€β”€ ThemeSwitcher.tsx   # Theme switcher
β”‚   β”œβ”€β”€ AuthProvider.tsx    # Auth context
β”‚   β”œβ”€β”€ PermissionGuard.tsx # RBAC guard
β”‚   └── RoleBadge.tsx      # Role badge
β”œβ”€β”€ lib/                   # Utilities
β”‚   β”œβ”€β”€ auth.ts            # JWT utilities
β”‚   β”œβ”€β”€ db.ts             # Database connection
β”‚   β”œβ”€β”€ cn.ts             # classnames utility
β”‚   └── themes.ts         # Theme configuration
β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   β”œβ”€β”€ use-permission.ts  # Permission hook
β”‚   β”œβ”€β”€ use-roles.ts     # Roles hook
β”‚   └── use-users.ts     # Users hook
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ scripts/                # Utility scripts
β”œβ”€β”€ Dockerfile             # Docker build
β”œβ”€β”€ docker-compose.yml     # Docker Compose
β”œβ”€β”€ package.json           # Dependencies
β”œβ”€β”€ tailwind.config.js    # Tailwind config
└── tsconfig.json        # TypeScript config

πŸ“œ Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm test Run tests
npm run test:ui Run tests with UI
npm run db:create-admin Create admin user

πŸ—„οΈ Database Schema

πŸ“Š Tables

  • users - User accounts
  • sessions - JWT session tokens
  • roles - RBAC roles
  • projects - Project data
  • project_members - Project access control

πŸ‘€ Default Roles

Role Permissions
Admin Full system access
Editor Create/edit projects
Viewer View only

🎨 Theme Customization

🌈 Supported Themes

  • Slate (default)
  • Blue
  • Emerald
  • Rose
  • Amber
  • Purple

πŸ”§ Adding Custom Themes

  1. Add colors to tailwind.config.js
  2. Add theme entry to lib/themes.ts

🐳 Docker Deployment

πŸ‘¨β€πŸ’» Development

docker-compose up --build

πŸš€ Production

docker-compose -f docker-compose.yml up -f docker-compose.prod.yml up --build

πŸ”Œ API Endpoints

πŸ”‘ Authentication

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login user
POST /api/auth/logout Logout user

πŸ‘€ Users

Method Endpoint Description
GET /api/users List all users
POST /api/users Create user
GET /api/users/[id] Get user
PUT /api/users/[id] Update user
DELETE /api/users/[id] Delete user

πŸ›‘οΈ Roles

Method Endpoint Description
GET /api/roles List all roles
POST /api/roles Create role
PUT /api/roles/[id] Update role
DELETE /api/roles/[id] Delete role

βš™οΈ Environment Variables

Variable Description Required
JWT_SECRET Secret key for JWT signing Yes
NODE_ENV Environment (development/production) No

πŸ§ͺ Testing

# Run all tests
npm test

# Run tests in watch mode
npm test -- --watch

# Run tests with coverage
npm test -- --coverage

🀝 Contributing

Contributions are welcome! Please read the CONTRIBUTING.md file for guidelines.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ’¬ Support

For issues and feature requests, please open an issue on GitHub.

πŸ™ Acknowledgments


πŸ“Έ Screenshots

Login Page

Login Light

Dashboard - Light Theme

Dashboard Light

Dashboard - Light Red Theme

Dashboard Light Red

Dashboard - Dark Red Theme

Dashboard Dark Red

About

A full-featured report/project management dashboard with Role-Based Access Control (RBAC), built on modern web technologies.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors