A modern, secure, and feature-rich frontend for the BAWES ERP system, built with Next.js, TypeScript, and Shadcn UI.
- Authentication & Authorization flow
- Component structure
- SDK integration
- Best practices
- Core features status
- SDK integration status
- UI components status
- Testing status
- Documentation status
- Missing SDK features
- Frontend requirements
- Integration requirements
- Security requirements
- Performance requirements
- SDK overview
- Available APIs
- Configuration
- Error handling
- Best practices
- Dashboard components
- Shared components
- Hooks and utilities
- Best practices
- JWT-based authentication
- Automatic token refresh
- Protected routes
- Debug panel for JWT/permissions
- Responsive layout
- Collapsible sidebar
- User profile management
- Permission-based navigation
- User listing
- Role assignment
- Status management
- Bulk operations (planned)
- Role management
- Permission matrix
- Visual permission indicators
- Role hierarchy (planned)
-
Installation
npm install
-
Environment Setup
cp .env.example .env.local # Edit .env.local with your settings -
Development
npm run dev
-
Build
npm run build
src/
├── app/ # Next.js 13+ app directory
│ ├── dashboard/ # Dashboard pages
│ ├── auth/ # Authentication pages
│ └── api/ # API routes
├── components/
│ ├── dashboard/ # Dashboard components
│ ├── ui/ # Shadcn UI components
│ └── shared/ # Shared components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
└── services/ # API services
The frontend integrates with the BAWES ERP API using the auto-generated SDK:
import { AuthenticationApi, PeopleApi, Configuration } from '@bawes/erp-api-sdk';
// Create API instance
const config = new Configuration({
basePath: process.env.NEXT_PUBLIC_API_URL,
});
const api = new AuthenticationApi(config);
// Use API methods
const response = await api.authControllerLogin({
email,
password,
});-
Code Style
- Use TypeScript for all files
- Follow ESLint rules
- Use Prettier for formatting
-
Components
- Use Shadcn UI components
- Follow atomic design principles
- Implement proper prop types
-
State Management
- Use React hooks for local state
- Implement proper loading states
- Handle errors gracefully
-
Testing
- Write unit tests for hooks
- Write integration tests for flows
- Test error scenarios
-
Authentication
- JWT tokens in localStorage
- Automatic token refresh
- Protected routes middleware
-
Authorization
- Role-based access control
- Permission-based UI
- Secure API calls
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
For detailed documentation, see the /docs directory: