Frontend
| public | ||
| scripts | ||
| src | ||
| .gitignore | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tailwind.config.js | ||
| vite.config.js | ||
RegisterFrontend
This is a modern React + Vite + Tailwind CSS frontend for a registration and dashboard system. It features authentication, user onboarding, admin management, and responsive UI components, structured for scalability and maintainability.
📁 Project Structure
- src/features/
Feature-based folders (e.g.,login,dashboard,admin) each with their owncomponents/,pages/, and (optionally)hooks/,api/, and__tests__/. - src/shared/
Reusable components, hooks, utilities, and store logic shared across features. - src/auth/AuthWrapper.jsx
Handles authentication, token refresh, and protected route logic. - src/store/
Zustand stores for global state (e.g., authentication). - src/pages/
Top-level route pages (may be migrated into features as the project evolves). - tailwind.config.js
Tailwind CSS configuration. - vite.config.js
Vite build and dev server configuration.
🚀 Getting Started (Local Development)
1. Clone the Repository
git clone <your-repo-url>
cd REGISTERFRONTEND
2. Install Dependencies
npm install
# or
yarn install
3. Environment Variables
Create a .env file in the root directory. Example:
VITE_API_BASE_URL=http://localhost:3001
VITE_CENTRAL_SERVER_ENDPOINT=http://localhost:3001
Adjust these URLs to match your backend API endpoints.
4. Run the Development Server
npm run dev
# or
yarn dev
The app will be available at http://localhost:5173 (or the port shown in your terminal).
🛠️ Key Features
- Authentication:
Login, token refresh, and protected routes viaAuthWrapper. - Feature-based Structure:
Each major feature (login, dashboard, admin, etc.) is isolated for scalability. - Responsive Design:
Built with Tailwind CSS and responsive utility classes. - State Management:
Uses Zustand for global state (auth, user). - API Integration:
Fetches data from a backend API, with credentials support for secure cookies. - Referral Link Generation:
Referral links are generated without specifying a registration type. The type (personal/company) is now selected by the user during the registration process, not during referral link creation. - Registration Flow:
During registration, users select their registration type (personal or company) via a toggle/slider. This selection is sent to the backend as part of the registration request.
🧑💻 Development Notes
- Mobile Support:
The app is being refactored for improved mobile responsiveness. Test your changes on various screen sizes. - Token Handling:
Access tokens are stored in Zustand and sessionStorage; refresh logic is handled inAuthWrapper.jsx. - Custom Hooks & API Utilities:
As the project grows, move repeated logic intohooks/andapi/folders within each feature.
🤝 Contributing
- Fork the repo and create a feature branch.
- Follow the existing folder structure and naming conventions.
- Test your changes locally before submitting a pull request.
📄 License
This project is for internal use. Please contact the maintainer for licensing details.