A comprehensive resource management portal for IT assets and user management with role-based access control, built with Next.js 14, SQLite, and TypeScript.
- Secure user authentication with bcrypt password hashing
- Role-based access control (Admin, Power User, Regular User)
- Session management with HTTP-only cookies
- Complete user CRUD operations
- User registration by admins
- User profile management
- Role assignment and management
- Resource registration and tracking
- Resource assignment to users
- Complete resource lifecycle management
- Resource search and filtering
- Real-time statistics and metrics
- Role-specific dashboard views
- Recent activity tracking
- Quick action buttons
- Global search functionality
- Search suggestions and autocomplete
- Recent search history
- Filtered search results
- Responsive design for all devices
- Loading indicators and smooth transitions
- Toast notifications for user feedback
- Clean and intuitive interface
- Frontend: Next.js 14, React 18, TypeScript
- Backend: Next.js API Routes, Server Actions
- Database: SQLite with better-sqlite3 (For Development) & PostgreSQL used for Production
- UI Components: shadcn/ui, Tailwind CSS
- Authentication: Custom implementation with bcrypt
- Icons: Lucide React
- Date Handling: date-fns
Before running this project, make sure you have the following installed:
- Node.js (version 18 or higher)
- npm or yarn package manager
```bash git clone cd resource-management-portal ```
```bash npm install
yarn install ```
The application uses SQLite database which will be automatically created in the data directory when you first run the application. No additional environment variables are required for basic setup.
```bash npm run dev
yarn dev ```
The application will be available at http://localhost:3000
The application comes with pre-configured demo accounts:
Admin Account:
- Email:
harshdeo7543@gmail.com - Password:
12345678
Power User Account:
- Email:
poweruser@example.com - Password:
12345678
Regular User Account:
- Email:
user@example.com - Password:
12345678
The application uses SQLite database with the following features:
- Automatic Setup: Database and tables are created automatically on first run
- Location: Database file is stored in
data/resource-management.db - Sample Data: Includes default users and sample resources
- Migrations: Schema is managed through the initialization script
The application includes three main tables:
- users - User accounts and profiles
- resources - IT resources and assets
- activity_log - System activity tracking
``` βββ app/ # Next.js app directory β βββ actions/ # Server actions β βββ dashboard/ # Dashboard pages β βββ login/ # Authentication pages β βββ resources/ # Resource management pages β βββ search/ # Search functionality β βββ settings/ # Settings pages β βββ users/ # User management pages βββ components/ # Reusable UI components β βββ ui/ # shadcn/ui components βββ lib/ # Utility libraries β βββ models/ # Database models β βββ utils.ts # Helper functions βββ data/ # SQLite database (auto-created) βββ public/ # Static assets ```
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
- Full access to all features
- Create, edit, and delete users
- Manage all resources
- View all system activities
- Access to user management
- Create and edit resources
- View assigned team resources
- Limited user management access
- Resource assignment capabilities
- View assigned resources
- Access personal dashboard
- View resource details
- Limited system access
```bash npm run build npm run start ```
The SQLite database can be backed up by copying the data/resource-management.db file.
For production deployment, consider setting:
NODE_ENV=production- Configure proper session secrets
- Set up proper CORS policies
- Password hashing with bcrypt
- HTTP-only cookies for session management
- Role-based access control
- SQL injection prevention
- XSS protection
- CSRF protection through Next.js
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For support and questions, please open an issue in the repository.
This project is licensed under the MIT License.