- Project Overview
- Features
- Technology Stack
- Project Structure
- Data Models
- API Services
- Error Handling
- State Management
- User Interface
- Component Architecture
- Development Practices
- Installation & Setup
- Usage Guide
RegisTrack is a comprehensive member registration and activity tracking system designed to streamline member management for organizations. The application provides a modern, responsive interface built with React and TypeScript, powered by a robust Node.js/Express backend with MongoDB as the database.
- Frontend: Built with React 18.3.1, TypeScript, and Vite
- Backend: Node.js with Express and TypeScript
- Database: MongoDB with Mongoose ODM
- Styling: Tailwind CSS with Headless UI components
- Routing: React Router v7 for client-side navigation
- State Management: Redux Toolkit & React Query for comprehensive state management
- Form Handling: React Hook Form with validation
- API Documentation: Swagger/OpenAPI support
- Testing: Vitest for unit tests, Playwright for E2E tests
- Code Quality: ESLint and Prettier for consistent code style
- Member Management: Create, view, update, and delete member records with detailed profiles
- Activity Tracking: Monitor and log all member activities and system events
- User Authentication: Secure login and role-based access control (RBAC)
- Dashboard Analytics: Visualize member statistics and activity trends
- Responsive Design: Fully responsive interface that works on all devices
- API-First Architecture: RESTful API for easy integration with other systems
- Activity Logging: Comprehensive audit trail of all system activities
- Search & Filtering: Advanced search and filtering capabilities for members and activities
- Framework: React 18.3.1 with TypeScript
- Build Tool: Vite
- State Management: Redux Toolkit & React Query (@tanstack/react-query)
- UI Components: Headless UI with custom Tailwind CSS components
- Form Handling: React Hook Form with Yup validation
- Routing: React Router v7
- Testing: Vitest & Playwright
- Runtime: Node.js with Express
- Language: TypeScript
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- API Documentation: Swagger/OpenAPI
- Logging: Custom activity logger middleware
- Validation: Express Validator
- Package Manager: pnpm
- Linting: ESLint with TypeScript support
- Code Formatting: Prettier
- Version Control: Git with GitHub
- CI/CD: GitHub Actions (configurable)
.
βββ apps/
β βββ app/ # Frontend React application
β β βββ src/
β β β βββ app/ # App configuration and store
β β β β βββ store.ts # Redux store configuration
β β β β
β β β βββ components/ # Reusable UI components
β β β β βββ auth/ # Authentication components
β β β β β βββ LoginForm.tsx
β β β β β βββ RegisterForm.tsx
β β β β β βββ ProtectedRoute.tsx
β β β β β
β β β β βββ common/ # Shared UI components
β β β β β βββ Button.tsx
β β β β β βββ DropdownMenu.tsx
β β β β β βββ Loader.tsx
β β β β β βββ Badge.tsx
β β β β β βββ Card.tsx
β β β β β βββ Input.tsx
β β β β β βββ ...
β β β β β
β β β β βββ dashboard/ # Dashboard components
β β β β β βββ RecentActivity.tsx
β β β β β βββ StatsGrid.tsx
β β β β β
β β β β βββ layout/ # Layout components
β β β β β βββ Layout.tsx
β β β β β βββ Navbar.tsx
β β β β β βββ Sidebar.tsx
β β β β β
β β β β βββ members/ # Member management components
β β β β βββ MemberDetail.tsx
β β β β βββ MemberForm.tsx
β β β β βββ MemberTable.tsx
β β β β βββ MemberFilters.tsx
β β β β
β β β βββ contexts/ # React contexts
β β β β βββ AuthContext.tsx
β β β β βββ ThemeContext.tsx
β β β β
β β β βββ features/ # Feature modules with RTK Query APIs
β β β β βββ activity/ # Activity tracking
β β β β βββ auth/ # Authentication
β β β β βββ members/ # Member management
β β β β βββ ui/ # UI state management
β β β β
β β β βββ layouts/ # Page layouts
β β β β βββ MemberLayout.tsx
β β β β
β β β βββ lib/ # Library code
β β β β βββ api/ # API client configuration
β β β β βββ queryClient.ts # React Query configuration
β β β β
β β β βββ pages/ # Page components
β β β β βββ Dashboard.tsx
β β β β βββ MembersPage.tsx
β β β β βββ Profile.tsx
β β β β βββ Settings.tsx
β β β β βββ NotFound.tsx
β β β β βββ Unauthorized.tsx
β β β βββ types/ # TypeScript type definitions
β β β βββ utils/ # Utility functions
β β β βββ hooks/ # Custom React hooks
β β β
β β βββ public/ # Static assets
β β
β βββ backend/ # Backend Express application
β β βββ src/
β β β βββ config/ # Configuration files
β β β βββ controllers/ # Request handlers
β β β βββ middleware/ # Express middleware
β β β βββ models/ # Database models
β β β βββ routes/ # API routes
β β β βββ services/ # Business logic
β β
β βββ app-e2e/ # Frontend E2E tests
β βββ backend-e2e/ # Backend E2E tests
- Authentication details (email, hashed password)
- Role-based access control
- Profile information
- Timestamps for creation and updates
- Personal information (name, contact details)
- Membership status and type
- Associated activities and events
- Profile photo storage
- Custom fields and metadata
- Action type and description
- Associated user and member
- Timestamp and IP address
- Request and response data
- Status and error information
- User registration and login
- JWT token management
- Password reset functionality
- Role-based access control
- CRUD operations for member profiles
- Bulk import/export
- Advanced search and filtering
- Photo upload and management
- Member statistics and analytics
- Activity feed and audit logs
- System health and usage metrics
- User management
- System configuration
- Data backup and restore
- Client-Side: Custom error boundaries and toast notifications
- Server-Side: Centralized error handling middleware
- Validation: Request validation with meaningful error messages
- Logging: Detailed error logging for debugging
- Monitoring: Integration with monitoring tools (configurable)
- Global State: Redux Toolkit for application-wide state
- Server State: React Query (@tanstack/react-query) for data fetching and caching
- Local State: React hooks for component-level state
- RTK Query: Integrated API layer for seamless data management
- Optimistic Updates: For better user experience
- Color Scheme:
- Primary:
#2879fe(blue) - Main brand color - Text:
#333- Main text color - Light Text:
#777- Secondary text - Border:
#e0e0e0- Border color - Background:
#f5f5f5- Light background - Error:
#ff4d4f- Error/validation - Success:
#52c41a- Success messages
- Primary:
-
Navbar
- Responsive navigation with mobile menu
- User profile and notifications
- Quick access to important features
-
Sidebar
- Main navigation menu
- Collapsible sections
- Role-based menu items
-
Data Tables
- Sortable and filterable
- Pagination support
- Row actions and bulk operations
-
Forms
- Form validation
- Field types for all data needs
- Responsive layout
-
Modals & Dialogs
- Confirmation dialogs
- Form modals
- Responsive behavior
-
Dashboard (
/dashboard)- Overview of key metrics
- Recent activities
- Quick actions
-
Members (
/members)- Member directory
- Advanced search and filtering
- Bulk operations
-
Member Detail (
/members/:id)- Complete member profile
- Activity history
- Related records
-
Settings (
/settings)- User preferences
- System configuration
- Data management
- Layout: Page templates and containers
- UI Elements: Buttons, inputs, modals, etc.
- Data Display: Cards, tables, lists
- Feedback: Loaders, toasts, error states
- Navigation: Breadcrumbs, pagination, tabs
- Feature-based Structure: Components grouped by feature
- Shared Components: Reusable UI elements
- Type Definitions: TypeScript interfaces and types
- API Services: Centralized API calls with RTK Query
- Hooks: Custom hooks for reusable logic
- Tailwind CSS: Utility-first CSS framework
- Component-scoped Styles: Tailwind classes with custom components
- Design Tokens: Consistent spacing, colors, and typography
- Responsive Design: Mobile-first approach
- Unit Tests: Vitest for component and utility testing
- Integration Tests: Component interactions
- E2E Tests: Playwright for user flows
- Snapshot Testing: For UI consistency
- Node.js (v18 or later recommended)
- pnpm (v8 or later)
- MongoDB (v6 or later) running locally
- Git
-
Clone the repository:
git clone https://github.com/your-username/regis-track.git cd regis-track -
Install dependencies:
pnpm install
-
Set up environment variables:
-
Create a
.envfile in the root directory -
Add the following environment variables:
# Database MONGODB_URI=mongodb://localhost:27017/regis-track # JWT JWT_SECRET=your-super-secret-jwt-key # Server PORT=3000 NODE_ENV=development # Frontend API URL VITE_API_URL=http://localhost:3000/api
-
-
Start MongoDB (if not already running):
# On macOS with Homebrew brew services start mongodb-community # Or using Docker docker run --name mongodb -p 27017:27017 -d mongo:latest
-
Start the backend server in development mode:
npx nx serve backend
The backend will be available at
http://localhost:3000by default.- API documentation:
http://localhost:3000/swagger
- API documentation:
-
In a separate terminal, start the frontend development server:
npx nx serve app
The frontend will be available at
http://localhost:4200by default.
-
Registration
- Navigate to the registration page
- Fill in your details (name, email, password)
- Submit the form to create a new account
-
Login
- Go to the login page
- Enter your email and password
- Click "Sign In" to access your dashboard
- View an overview of member statistics and recent activities
- Quick access to important features via the sidebar
- Responsive design works on both desktop and mobile devices
-
View All Members
- Navigate to "Members" in the sidebar
- Browse the list of registered members
- Use search and filters to find specific members
-
Add New Member
- Click the "Add Member" button
- Fill in the member details
- Submit the form to add the member
-
Edit Member
- Click on a member to view details
- Click the "Edit" button
- Update the necessary information
- Save your changes
-
Delete Member
- Locate the member in the list
- Click the delete icon (ποΈ)
- Confirm the deletion
- Click on your profile picture in the top-right corner
- Select "Profile" to view and edit your account information
- Update your password or personal details as needed
- Access application settings from the user menu
- Configure preferences and notification settings
- Manage account security options
For developers integrating with the RegisTrack API:
- Access the interactive API documentation at
http://localhost:3000/swaggerwhen the backend is running - The API follows RESTful principles
- All API endpoints require authentication except for login/registration
- Include the JWT token in the
Authorizationheader for authenticated requests
# Get current user profile
curl -X GET 'http://localhost:3000/api/users/me' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'
# Get all members
curl -X GET 'http://localhost:3000/api/members' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'# Run all unit tests
pnpm test
# Run tests for a specific project
npx nx test app
npx nx test backend# Run frontend E2E tests
npx nx e2e app-e2e
# Run backend E2E tests
npx nx e2e backend-e2eTo build the applications for production:
# Build both frontend and backend
pnpm build
# Or build individually
npx nx build app
npx nx build backendThe production builds will be available in the dist/ directory of each app.
- API documentation is available at
/swaggerwhen the backend is running - Component documentation is available in the source code using JSDoc
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE for details.