This React-based frontend application provides a user interface for a payment processing system. It includes a payment form for users to submit transactions and an admin dashboard to view the payment history.
- Payment form with input validation
- Admin dashboard to view transaction history
- Secure handling of credit card information
- Real-time payment status updates
- Integration with a Rails backend API
- Node.js (v16 or higher)
- npm or yarn package manager
- Modern web browser
- Running backend API (see backend repository)
- Clone the repository:
git clone https://github.com/isaaclvs/payment-system-frontend.git
cd payment-system-frontend- Install dependencies:
npm install
# or
yarn install- Set up environment variables:
Create a
.envfile in the project root and add:
REACT_APP_API_URL=http://localhost:3000- Start the development server:
npm start
# or
yarn startsrc/
├── components/
│ ├── PaymentForm/
│ ├── AdminDashboard/
│ └── common/
├── contexts/
│ └── AuthContext/
├── hooks/
│ └── usePayment/
├── services/
│ └── api/
├── utils/
└── App.js
Collects payment information:
- Cardholder name
- Card number
- Expiration date
- CVV
- Payment amount
- Implements form validation
- Displays transaction status and feedback
- Requires authentication
- Displays all transactions
- Shows transaction details:
- Customer name
- Last 4 digits of the card
- Transaction amount
- Payment status
The frontend communicates with the Rails backend through RESTful endpoints:
POST /api/payments- Processes new paymentsGET /api/payments- Retrieves payment history (admin only)
- Credit card data is never stored locally
- HTTPS is required for all API communication
- Input validation in all forms
- JWT-based authentication for admin access
npm start- Runs the development servernpm test- Runs the test suitenpm run build- Builds the app for productionnpm run lint- Runs ESLint for code linting
Você pode ver uma demonstração completa da aplicação no seguinte link:
Here are some screenshots of the application:
You can view a full demo of the application at the following link:
The project uses Jest and React Testing Library to test components. The tests ensure key UI elements function correctly.
src/
├── components/
│ ├── PaymentForm/
│ │ ├── index.js
│ │ └── PaymentForm.test.js
│ └── ...
- Renders the payment form
- Correctly displays the payment amount
- Renders the payment button
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch- Jest
- @testing-library/react
- @testing-library/jest-dom
To check test coverage:
npm test -- --coverageThis project is licensed under the MIT License – see the LICENSE file for details.



