A role-based user management system with audit logging capabilities, built with React, Express.js, and PostgreSQL.
- 🔐 Role-based access control (Admin, Moderator, User)
- 👥 User management with permissions
- 📝 Audit logging for user actions
- 🎨 Responsive UI with Tailwind CSS
- 🔒 Secure authentication with JWT
- 🛡️ TypeScript for type safety
- 🐘 PostgreSQL with Prisma ORM
- 🐳 Docker support
- Node.js 18+
- PostgreSQL 14+
- Docker (optional)
-
Clone the repository:
git clone https://github.com/yourusername/config2page.git cd config2page
-
Install dependencies:
# Install backend dependencies cd server npm install # Install frontend dependencies cd ../client npm install
-
Set up environment variables:
# Backend cd server cp .env.example .env # Edit .env with your database credentials # Frontend cd ../client cp .env.example .env
-
Run database migrations:
cd server npx prisma migrate dev
-
Start the development servers:
# Start backend (from server directory) npm run dev # Start frontend (from client directory) npm start
-
Open http://localhost:3000 in your browser
Run the entire application stack using Docker Compose:
docker-compose up -d
Detailed documentation is available in the memory-bank
folder:
-
- System design
- Tech stack
- Directory structure
-
Authentication & Authorization
- Authentication flow
- Role-based access control
- JWT implementation
-
- User model
- CRUD operations
- Permission system
-
- Event tracking
- Data structure
- Implementation details
-
- Endpoints
- Request/Response formats
- Error handling
-
- Component architecture
- State management
- UI/UX design
config2page/
├── client/ # Frontend React application
│ ├── public/ # Static files
│ └── src/
│ ├── components/ # Reusable React components
│ ├── context/ # React Context providers
│ ├── pages/ # Page components
│ ├── services/ # API services
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
│
├── server/ # Backend Express application
│ ├── config/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Express middleware
│ ├── models/ # Data models
│ ├── prisma/ # Prisma schema and migrations
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ └── utils/ # Utility functions
│
├── docker/ # Docker configuration
├── prd/ # Product requirement documents
└── memory-bank/ # Technical documentation
cd server
# Development
npm run dev
# Build
npm run build
# Production
npm start
# Database
npx prisma migrate dev # Create migration
npx prisma migrate reset # Reset database
npx prisma generate # Generate Prisma client
cd client
# Development
npm start
# Build
npm run build
# Tests
npm test
# Type checking
npm run typecheck
# Server Configuration
PORT=5000
NODE_ENV=development
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/config2page
# JWT Configuration
JWT_SECRET=your-secret-key
# Cookie Configuration
COOKIE_SECRET=your-cookie-secret
# CORS Configuration
CLIENT_URL=http://localhost:3000
REACT_APP_API_URL=http://localhost:5000/api
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.