Hosted on AWS Amplify with CI/CD (Live Demo: https://ayushwritescode-react.up.railway.app)
This repository contains the React frontend for the EasyGenerator application. It leverages:
- Responsive Design for cross device compatibility
- Redux Toolkit for state management
- Tailwind CSS for styling
- Axios for secure API calls
- AOS for scroll-based animations
- JWT-based authentication (access token in Redux, refresh token in HTTP-only cookie in order to prevent XSS attacks)
-
Modular Design
- Organized by feature (e.g.,
views/Login,views/Signup), plus shared components in/components.
- Organized by feature (e.g.,
-
Redux Toolkit for State Management
- Uses slices (e.g.
authSlice) and async thunks for API interactions (login, signup, refresh token).
- Uses slices (e.g.
-
Tailwind CSS for Styling
- Utility-first approach for rapid UI development, responsive design, and consistency.
-
Animations & AOS Integration
- Scroll animations, fade effects, and smooth transitions for an enhanced UX.
-
Secure API Calls with Axios
- Implements interceptors for automatic token handling (refresh, authorization headers).
-
CSRF Protection & Secure Requests
- Ensures all API requests follow CSRF protection mechanisms.
-
Strict Content Security Policy (CSP) Implementation
- Helps prevent XSS attacks by restricting content sources.
-
Lazy Loading & Code Splitting
- Improves performance by loading only required components and splitting large bundles.
frontend/
├─ src/
│ ├─ components/
│ ├─ views/
│ ├─ store/
│ ├─ hooks/
│ ├─ utils/
│ ├─ assets/
│ └─ App.tsx
├─ package.json
└─ README.md
store/: Redux slices (auth, user, etc.) + thunks.components/: Reusable UI components (EGInput, EGButton, etc.).views/: Page-level features (Login, Signup, Dashboard).hooks/: Custom React hooks for better code abstraction.utils/: Helper functions for API calls, validations, and configurations.assets/: Static assets like images and icons.App.tsx: Root component handling routes, global providers, etc.
- Node.js v16+
- npm or yarn
- Running Backend API (NestJS, Express, etc.) to handle requests
git clone https://github.com/ayushwritescode/easygenerator.web.git
cd easygenerator.webnpm install
# or
yarn installCheck for .env or .env.development:
VITE_API_BASE_URL=http://localhost:3000
Adjust if your backend is on a different host/port.
npm run dev
# or
yarn devOpen the URL shown in the terminal (commonly http://localhost:5173) in your browser.
npm run build
npm run preview
# or
yarn build
yarn previewThe compiled assets go into dist/. You can serve them with Nginx or any static file server.
- Node.js v16+
- npm or yarn
- Access to the Backend API for authentication and data
- Fork the repository
- Create a branch:
git checkout -b feature/my-feature - Commit changes:
git commit -m 'Add some feature' - Push to GitHub:
git push origin feature/my-feature - Open a Pull Request
MIT © 2025 ayushwritescode
