Features β’ Tech Stack β’ Getting Started β’ Project Structure β’ Scripts
|
|
|
Building UI with the latest React features including hooks, context, and modern patterns. |
Lightning-fast HMR and optimized production builds. |
Utility-first CSS framework for rapid UI development. |
| Package | Version | Purpose |
|---|---|---|
| react | 19.2.0 | UI library |
| react-router-dom | 7.13.0 | Client-side routing |
| zustand | 5.0.11 | State management |
| axios | 1.13.5 | HTTP client |
| framer-motion | 12.34.0 | Animation library |
| react-hot-toast | 2.6.0 | Toast notifications |
| react-icons | 5.5.0 | Icon library |
| @fontsource/poppins | 5.2.7 | Custom font |
Before you begin, ensure you have the following installed:
Node.js >= 18.x
npm >= 9.x (or yarn)- Clone the repository
git clone https://github.com/JomsCode21/Bare-Minimum-Planner-Front-End.git
cd Bare-Minimum-Planner-Front-End- Install dependencies
npm install- Configure environment (if needed)
The frontend is pre-configured to proxy API requests to http://localhost:5000.
To change the backend URL, update vite.config.ts:
server: {
proxy: {
"/api": {
target: "http://your-backend-url:port",
changeOrigin: true,
},
},
}- Start the development server
npm run devThe application will be available at http://localhost:5173 π
frontend/
βββ public/ # Static assets
βββ src/
β βββ api/ # API service layer
β β βββ auth.ts # Authentication API calls
β β βββ tasks.ts # Task management API calls
β β
β βββ assets/ # Images, icons, etc.
β β
β βββ axios/ # Axios configuration
β β βββ axios-instance.ts # Axios instance with interceptors
β β
β βββ components/ # React components
β β βββ dashboard/ # Dashboard-specific components
β β β βββ AddTaskModal.tsx
β β β βββ ButtonNav.tsx
β β β βββ DashboardCard.tsx
β β β βββ DeleteTaskModal.tsx
β β β βββ DeletesuccessModal.tsx
β β β βββ EditTaskModal.tsx
β β β βββ ViewTaskModal.tsx
β β β
β β βββ forgotpassword/ # Password reset components
β β β βββ ForgotPasswordCard.tsx
β β β βββ ResetPasswordCard.tsx
β β β
β β βββ login/ # Login components
β β β βββ Logincard.tsx
β β β
β β βββ register/ # Registration components
β β β βββ RegisterCard.tsx
β β β βββ TermsModal.tsx
β β β
β β βββ routes/ # Route protection
β β β βββ ProtectedRoutes.tsx
β β β βββ PublicRoutes.tsx
β β β
β β βββ ui/ # Reusable UI components
β β βββ Buttons.tsx
β β βββ InputField.tsx
β β βββ UniversalButton.tsx
β β
β βββ pages/ # Page components (routes)
β β βββ dashboard/
β β β βββ Dashboard.tsx
β β βββ forgotpassword/
β β β βββ ForgotPasswordPage.tsx
β β β βββ ResetPasswordPage.tsx
β β βββ login/
β β β βββ LoginPage.tsx
β β βββ register/
β β β βββ RegisterPage.tsx
β β βββ LandingPage.tsx
β β
β βββ store/ # Zustand state management
β β βββ authStore.ts # Authentication state
β β βββ taskStore.ts # Task management state
β β
β βββ types/ # TypeScript type definitions
β β βββ auth.ts
β β βββ dashboard.ts
β β βββ forgotpassword.ts
β β βββ task.ts
β β βββ terms&condition.ts
β β βββ ui.ts
β β
β βββ utils/ # Utility functions
β β
β βββ App.tsx # Main application component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
β
βββ .eslintrc.js # ESLint configuration
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.app.json # App-specific TS config
βββ tsconfig.node.json # Node-specific TS config
βββ vite.config.ts # Vite configuration
βββ package.json # Dependencies and scripts
βββ README.md # This file
graph LR
A[Landing Page] -->|New User| B[Register]
A -->|Existing User| C[Login]
B -->|Success| D[Dashboard]
C -->|Success| D
C -->|Forgot Password| E[Reset Password]
E -->|Email Link| F[New Password]
F -->|Success| C
D -->|Protected| G[Task Management]
The application uses Zustand for simple and efficient state management:
- Manages user authentication state
- Handles login/logout
- Persists authentication across page refreshes
- Provides auth status to components
- Manages task list
- CRUD operations for tasks
- Loading states
- Error handling
| Route | Component | Protection | Description |
|---|---|---|---|
/ |
LandingPage |
β Public | Welcome page |
/login |
LoginPage |
π Public only | User login |
/register |
RegisterPage |
π Public only | User registration |
/forgotpassword |
ForgotPasswordPage |
π Public only | Request password reset |
/resetpassword |
ResetPasswordPage |
π Public only | Reset password with token |
/dashboard |
Dashboard |
π Protected | Main task dashboard |
Route Guards:
PublicRoutes- Redirects authenticated users to dashboardProtectedRoutes- Redirects unauthenticated users to login
| Command | Description |
|---|---|
npm run dev |
π₯ Start development server with hot reload at http://localhost:5173 |
npm run build |
ποΈ Build for production (TypeScript check + Vite build) |
npm run preview |
π Preview production build locally |
npm run lint |
β¨ Run ESLint to check code quality |
# Start development server
npm run dev
# Features:
# - Hot Module Replacement (HMR)
# - Fast refresh
# - Source maps
# - Development optimizations
# Build for production
npm run build
# Steps:
# 1. TypeScript compilation check
# 2. Vite production build
# 3. Asset optimization
# 4. Code minification
# Preview production build
npm run preview
# Test production build locally before deployment
# Lint code
npm run lint
# Checks for:
# - Code quality issues
# - Unused variables
# - React best practices
# - TypeScript errorsThe project uses Tailwind CSS v4 with the Vite plugin for optimal performance.
Key Features:
- π― Utility-first approach
- π± Responsive design utilities
- π¨ Custom color palette
- π€ Poppins font family
- β‘ JIT (Just-In-Time) compilation
// Example: Button component with Tailwind
<button
className="px-4 py-2 bg-blue-500 hover:bg-blue-600
text-white rounded-lg transition-colors
duration-200 ease-in-out"
>
Click Me
</button>The application uses a configured Axios instance with:
- Base URL: Automatically proxied through Vite
- Credentials: Included for cookie-based auth
- Interceptors: Handle auth tokens and errors
- Type Safety: Full TypeScript support
-login(email, password) -
register(userData) -
logout() -
checkAuth() -
forgotPassword(email) -
resetPassword(token, newPassword);-fetchTasks() -
addTask(title, description) -
updateTask(id, updates) -
deleteTask(id) -
toggleTaskCompletion(id);Smooth, performant animations using Framer Motion:
- Page transitions
- Modal animations
- List item animations
- Hover effects
- Loading states
React Hot Toast provides:
- Success messages
- Error alerts
- Loading indicators
- Custom styling
- Auto-dismiss
The project uses strict TypeScript settings for maximum type safety:
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true
}
}Configured with:
- React-specific rules
- React Hooks rules
- TypeScript ESLint
- React Refresh plugin
# Create production build
npm run build
# Output will be in: dist/If deploying, ensure your backend URL is properly configured:
# .env (for non-Vite deployments)
VITE_API_URL=https://your-backend-api.comDevelopment server won't start
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Check if port 5173 is available
netstat -ano | findstr :5173API requests failing
- Ensure backend is running on
http://localhost:5000 - Check proxy configuration in
vite.config.ts - Verify CORS settings in backend
- Check browser console for errors
TypeScript errors
# Run type checking
npm run build
# Check specific file
npx tsc --noEmitStyling not working
- Ensure Tailwind CSS is properly configured
- Check if
index.cssis imported inmain.tsx - Clear browser cache
- Restart dev server
- π React Documentation
- β‘ Vite Guide
- π¨ Tailwind CSS Docs
- π» Zustand Documentation
- π Framer Motion
Contributions are welcome! Here's how you can help:
- π΄ Fork the repository
- πΏ Create a 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
- Follow existing code style
- Write meaningful commit messages
- Add comments for complex logic
- Update documentation as needed
- Test thoroughly before submitting
This project is licensed under the ISC License.
JomsCode21 π» π¨ π |
- π React Team - For the incredible framework
- β‘ Vite Team - For the blazing-fast tooling
- π¨ Tailwind Labs - For the amazing CSS framework
- π» Zustand Community - For simple state management
- π Framer - For beautiful animations
- π§ Backend Repository
- π Project Documentation
- π Report Issues
- π¬ Discussions
Made with β€οΈ and β by the Bare Minimum Planner Team