ums Tailwind Templates

Ums

User Management System (UMS) is a full-stack MERN template for managing users and roles with secure authentication, dynamic permissions, and CRUD functionality. Built with React, Node.js, MongoDB, and TypeScript, it features a customizable UI with ShadCN and Tailwind CSS.

✨ User Management System (UMS) ✨

šŸš€ Introduction

UMS (User Management System) is a MERN-based starter template designed for full-stack projects requiring a robust user and role management system. It provides authentication, dynamic role-based permissions, and a structured way to manage users. The project utilizes ShadCN and Tailwind CSS for the UI, with TypeScript on both frontend and backend.

✨ Features

  • User Table: Displays all registered users.
  • Admin Controls:
    • Lock/unlock users.
    • Create, update, and delete users.
    • Create, update, and delete roles dynamically.
    • Assign permissions to roles.
  • Role Management:
    • Users can have multiple roles.
    • Roles follow precedence: lower-ranked users can't edit higher-ranked users.
    • Permissions are assigned dynamically.
  • Authentication:
    • Secure authentication system.
    • JWT-based authentication.
  • Audit Log Support:
    • Frontend: Paginated audit log table with filters; view-only access for users.
    • Backend: Logs all security actions, ensuring immutability for admin and system tracking.
  • Full CRUD Support:
    • CRUD operations for users and roles.

šŸ› ļø Tech Stack

Frontend

  • React (Vite)
  • TypeScript
  • ShadCN (UI Components)
  • Tailwind CSS
  • Zustand (State Management)
  • Tanstack Query (Data Fetching, Caching, Synchronization)
  • Zod (Validation Library)

Backend

  • Node.js (Express)
  • TypeScript
  • MongoDB (Mongoose ORM)
  • JWT Authentication
  • Bcrypt (Hashing Library)

šŸ“‚ Project Structure

UMS/
ā”œā”€ā”€ server/
│   ā”œā”€ā”€ src/
│   │   ā”œā”€ā”€ config/
│   │   ā”œā”€ā”€ controllers/
│   │   ā”œā”€ā”€ models/
│   │   ā”œā”€ā”€ routes/
│   │   ā”œā”€ā”€ utils/
│   │   ā”œā”€ā”€ index.ts
│   │   └── seed.ts
│   ā”œā”€ā”€ package-lock.json
│   ā”œā”€ā”€ package.json
│   ā”œā”€ā”€ pnpm-lock.yaml
│   └── tsconfig.json
│
ā”œā”€ā”€ client/
│   ā”œā”€ā”€ src/
│   │   ā”œā”€ā”€ components/
│   │   ā”œā”€ā”€ context/
│   │   ā”œā”€ā”€ hooks/
│   │   ā”œā”€ā”€ lib/
│   │   ā”œā”€ā”€ pages/
│   │   ā”œā”€ā”€ scss/
│   │   ā”œā”€ā”€ store/
│   │   ā”œā”€ā”€ utils/
│   │   ā”œā”€ā”€ App.tsx
│   │   ā”œā”€ā”€ index.css
│   │   ā”œā”€ā”€ main.tsx
│   │   └── vite-env.d.ts
│   ā”œā”€ā”€ components.json
│   ā”œā”€ā”€ eslint.config.js
│   ā”œā”€ā”€ index.html
│   ā”œā”€ā”€ package-lock.json
│   ā”œā”€ā”€ package.json
│   ā”œā”€ā”€ pnpm-lock.yaml
│   ā”œā”€ā”€ postcss.config.js
│   ā”œā”€ā”€ tailwind.config.ts
│   ā”œā”€ā”€ tsconfig.app.json
│   ā”œā”€ā”€ tsconfig.json
│   ā”œā”€ā”€ tsconfig.node.json
│   ā”œā”€ā”€ vercel.json
│   └── vite.config.ts
ā”œā”€ā”€ LICENSE
└── README.md

šŸ—ļø Installation & Setup

1ļøāƒ£ Clone the Repository

git clone https://github.com/s-adi-dev/ums.git
cd ums

2ļøāƒ£ Server Setup

cd server
npm install
cp .env.example .env  # Configure your environment variables
npm run seed # For creating a super admin
npm run dev

3ļøāƒ£ Client Setup

cd ../client
npm install
cp .env.example .env
npm run dev

šŸ”‘ Environment Variables

Create a .env file in the server directory with the following:

PORT=3000
JWT_SECRET="your_secret"
NODE_ENV="development" # remove this for production
MONGO=your_mongodb_uri
SUPER_ADMIN_USERNAME="your_username"
FRONTEND_URL="http://localhost:5173" #url where frontend will run

Create a .env file in the client directory with the following:

VITE_BACK_END_PORT="http://localhost:3000" #url where backend will run

šŸ¤ Contributing

Feel free to contribute by submitting issues or pull requests.

šŸ“œ License

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

šŸ“§ Contact

For any queries, reach out via github.

Top categories

Loading Svelte Themes