A modern React-based frontend application for managing S4 Bucket storage, built with TypeScript, Vite, and Tailwind CSS.
- Authentication System: JWT-based login/logout with protected routes
- Bucket Management: Create and manage storage buckets
- File Management: Upload, download, and delete files
- Modern UI: Clean, responsive design with Tailwind CSS
- Type Safety: Full TypeScript support
- State Management: Zustand for lightweight state management
- Enterprise Ready: Follows React best practices and conventions
- Framework: React 18 + TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- State Management: Zustand
- Routing: React Router v6
- HTTP Client: Axios
- UI Components: Headless UI + Heroicons
- Form Handling: React Hook Form + Zod
- Node.js 18+
- npm or yarn
- S4 Bucket API running (see API Guide)
npm install
Create a .env
file in the root directory:
API_BASE_URL=http://localhost:3000
Note: Replace the URL with your actual S4 Bucket API endpoint.
npm run dev
The application will be available at http://localhost:5173
npm run build
src/
βββ components/ # Reusable UI components
β βββ ui/ # Base components (Button, Input, Card)
β βββ layout/ # Layout components
β βββ features/ # Feature-specific components
βββ hooks/ # Custom hooks
βββ services/ # API services
βββ stores/ # Zustand stores
βββ types/ # TypeScript interfaces
βββ utils/ # Helper functions
βββ pages/ # Route components
The application uses JWT tokens for authentication:
- Login: Users authenticate with username/password
- Token Storage: JWT tokens are stored in localStorage
- Protected Routes: All main routes require authentication
- Auto-logout: Tokens expire after 1 hour (handled by API)
The frontend integrates with the S4 Bucket API:
- Base URL: Configurable via environment variables
- Endpoints: Authentication, buckets, files, folders
- Error Handling: Comprehensive error handling with user feedback
- Interceptors: Automatic token management and 401 handling
- Button: Multiple variants (primary, secondary, danger) and sizes
- Input: Form inputs with validation and error states
- Card: Content containers with consistent styling
- Header: Navigation header with user menu
- Sidebar: Navigation sidebar with active states
- Layout: Main layout wrapper
The application is fully responsive and works on:
- Desktop (1024px+)
- Tablet (768px - 1023px)
- Mobile (320px - 767px)
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
- ESLint: Code linting and formatting
- Prettier: Code formatting
- TypeScript: Static type checking
- Conventional Commits: Commit message standards
The application uses the following environment variables:
- API_BASE_URL: Base URL for the S4 Bucket API (required)
- API_TIMEOUT: Request timeout in milliseconds (optional, default: 10000)
Custom configuration in tailwind.config.js
with:
- Primary color palette
- Custom component classes
- Responsive breakpoints
Build configuration in vite.config.ts
with:
- React plugin
- TypeScript support
- Environment variable handling
- Project setup with Vite + TypeScript
- Tailwind CSS configuration
- Authentication system
- Basic UI components
- Layout structure
- Dashboard page
- API service layer
- State management with Zustand
- Environment variable configuration
- Bucket management pages
- File upload/download
- File management interface
- Advanced error handling
- Performance optimization
- Testing setup
- Additional features
- Follow the established project structure
- Use TypeScript for all new code
- Follow the existing component patterns
- Add proper error handling
- Include loading states for async operations
- Frontend API Guide - API integration details
- Development Plan - Project roadmap and phases
- Configuration Guide - Environment setup instructions
- API Connection Errors: Check your
.env
file and API server status - Build Errors: Ensure all dependencies are installed
- Type Errors: Run
npm run build
to check TypeScript compilation - CSS Not Loading: Verify Tailwind CSS configuration
- Check the console for error messages
- Verify API endpoint configuration in
.env
- Ensure all dependencies are properly installed
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using modern React best practices
Serves your React app (static files) Handles React Router (SPA routing) Doesn't interfere with external API calls