Skip to content

MMansy19/ta7wila

Repository files navigation

πŸš€ Ta7wila - Advanced Payment Gateway Platform

Ta7wila Logo

Next.js TypeScript React Tailwind CSS License

🌟 Overview

Ta7wila is a comprehensive, modern payment gateway platform that enables businesses to accept payments through multiple Egyptian mobile wallet services. Built with cutting-edge technologies, it provides a seamless, secure, and user-friendly payment experience with real-time WhatsApp integration for transaction notifications.

✨ Key Features

  • 🏦 Multi-Payment Support: Instapay, VF Cash, Orange Cash, Etisalat Cash, and more
  • 🌍 Internationalization: Full Arabic and English support with RTL layout
  • πŸ“± WhatsApp Integration: Real-time transaction notifications and status updates
  • πŸ” Secure Authentication: JWT-based authentication with role-based access control
  • πŸ“Š Advanced Dashboard: Comprehensive analytics and transaction management
  • 🎨 Modern UI/UX: Dark theme with responsive design and smooth animations
  • ⚑ Real-time Updates: Live payment status tracking and notifications
  • πŸ”„ API Integration: RESTful API with comprehensive documentation

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 15.3.0 with App Router
  • Language: TypeScript 5.8.3
  • Styling: Tailwind CSS 3.4.1 + Framer Motion
  • State Management: Redux Toolkit + React Query
  • Forms: Formik + Yup validation
  • UI Components: Radix UI + Headless UI
  • Icons: Heroicons + React Icons + FontAwesome

Backend Integration

  • API Client: Axios with interceptors
  • Authentication: JWT tokens with cookies-next
  • Internationalization: next-intl with locale detection
  • Notifications: React Hot Toast

Development Tools

  • Package Manager: npm
  • Bundler: Next.js built-in (Turbopack)
  • Linting: ESLint + Prettier
  • Type Checking: TypeScript strict mode

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/MMansy19/ta7wila.git
    cd ta7wila
  2. Install dependencies

    npm install
  3. Environment setup

    cp .env.example .env.local

    Configure your environment variables:

    NEXT_PUBLIC_API_BASE_URL=https://api.ta7wila.com/v3
    NEXT_PUBLIC_APP_URL=http://localhost:3000
    NEXTAUTH_SECRET=your-secret-key
    NEXTAUTH_URL=http://localhost:3000
  4. Start development server

    npm run dev
  5. Open your browser Navigate to http://localhost:3000

πŸ“± WhatsApp Integration Setup

To enable WhatsApp notifications:

# Start WhatsApp service (development)
npm run whatsapp:simple

# Start full development environment
npm run dev:full

πŸ“‹ Available Scripts

Script Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm run whatsapp:simple Start WhatsApp integration
npm run dev:full Start both web and WhatsApp services
npm run start:production Start production with WhatsApp

πŸ—οΈ Project Structure

ta7wila/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ app/
β”‚   β”‚   β”œβ”€β”€ πŸ“ [lang]/              # Internationalized routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ dashboard/       # Admin dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ public-payment/  # Public payment pages
β”‚   β”‚   β”‚   └── page.tsx            # Landing page
β”‚   β”‚   └── πŸ“ api/                 # API routes
β”‚   β”œβ”€β”€ πŸ“ components/              # Reusable components
β”‚   β”œβ”€β”€ πŸ“ hooks/                   # Custom React hooks
β”‚   β”œβ”€β”€ πŸ“ lib/                     # Utility libraries
β”‚   β”œβ”€β”€ πŸ“ types/                   # TypeScript definitions
β”‚   └── πŸ“ styles/                  # Global styles
β”œβ”€β”€ πŸ“ public/                      # Static assets
β”œβ”€β”€ πŸ“ lib/                         # WhatsApp integration
└── πŸ“„ Configuration files

πŸ”§ Configuration

Internationalization

The app supports Arabic and English with automatic locale detection:

// i18n-config.ts
export const i18n = {
  defaultLocale: 'en',
  locales: ['en', 'ar']
} as const

Payment Methods

Supported payment options:

const paymentMethods = [
  { name: "VF Cash", key: "vcash", img: "/vcash.svg" },
  { name: "Orange Cash", key: "ocash", img: "/ocash.svg" },
  { name: "Etisalat Cash", key: "ecash", img: "/ecash.svg" },
  { name: "InstaPay", key: "instapay", img: "/instapay.svg" }
]

πŸ“– API Documentation

The platform integrates with Ta7wila's RESTful API. Key endpoints include:

Authentication

POST /auth/login
POST /auth/register
POST /auth/refresh

Payments

POST /checkout/generate
POST /transactions/public-payment
GET /payments/{id}

Applications

GET /applications
POST /applications
PUT /applications/{id}

For complete API documentation, visit: API Docs

πŸ” Security Features

  • JWT Authentication: Secure token-based authentication
  • Input Validation: Comprehensive form validation with Yup
  • XSS Protection: Built-in Next.js security features
  • CSRF Protection: Token-based request validation
  • Environment Variables: Sensitive data protection

🌍 Internationalization

Full RTL support for Arabic language:

  • Dynamic Language Switching: Real-time locale changes
  • RTL Layout: Proper right-to-left text direction
  • Localized Content: Translated UI and error messages
  • Number Formatting: Locale-specific number and currency formatting

πŸ“± Responsive Design

Optimized for all devices:

  • Mobile First: Progressive enhancement approach
  • Tablet Optimized: Perfect tablet experience
  • Desktop Enhanced: Rich desktop functionality
  • Touch Friendly: Optimized touch interactions

πŸš€ Performance Optimizations

  • Next.js App Router: Latest routing system for optimal performance
  • Image Optimization: Automatic image optimization with Next.js Image
  • Code Splitting: Automatic code splitting for faster loads
  • Caching: Intelligent caching strategies
  • Bundle Analysis: Optimized bundle sizes

πŸ§ͺ Testing

# Run tests
npm run test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

πŸ“¦ Deployment

Vercel (Recommended)

  1. Deploy to Vercel

    npx vercel
  2. Configure environment variables in Vercel dashboard

  3. Set up domain and SSL certificates

Docker Deployment

# Build Docker image
docker build -t ta7wila .

# Run container
docker run -p 3000:3000 ta7wila

Manual Deployment

# Build for production
npm run build

# Start production server
npm run start

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use conventional commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure responsive design
  • Test in both Arabic and English

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments

  • Next.js Team for the amazing framework
  • Vercel for hosting and deployment
  • Tailwind CSS for the utility-first CSS framework
  • All contributors who have helped improve this project

Made with ❀️ by the Ta7wila Team

⭐ Star this repository | πŸ› Report Bug | πŸ’‘ Request Feature

About

Managing recurring revenue has become easier and smarter with our integrated platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors