Skip to content

FahimFBA/crowdcredit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

234 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CrowdCredit - Loan Management Platform

A modern web application built with React, TypeScript, and Vite for managing crowd-funding and loan operations.

πŸš€ Tech Stack

  • Frontend Framework: React 18.3
  • Language: TypeScript
  • Build Tool: Vite
  • State Management: Redux Toolkit
  • Styling: TailwindCSS
  • UI Components: Radix UI
  • Authentication: Supabase Auth
  • Routing: React Router DOM
  • Form Handling: Custom Form Components
  • Date Handling: Day.js
  • Analytics: React GA4
  • Toast Notifications: Sonner

πŸ“ Project Structure

src/
β”œβ”€β”€ _Hooks/               # Custom React hooks
β”œβ”€β”€ _Variables/           # Global variables and constants
β”œβ”€β”€ assets/              # Static assets
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ Cards/          # Card components
β”‚   β”œβ”€β”€ Form/           # Form components
β”‚   β”œβ”€β”€ Layout/         # Layout components
β”‚   β”œβ”€β”€ Modal/          # Modal dialogs
β”‚   β”œβ”€β”€ Sheets/         # Sheet components
β”‚   β”œβ”€β”€ Skeleton/       # Loading states
β”‚   β”œβ”€β”€ Text/           # Text components
β”‚   └── ui/             # Base UI components
β”œβ”€β”€ config/             # Configuration files
β”œβ”€β”€ lib/                # Utility functions
β”œβ”€β”€ pages/             # Application pages
β”‚   β”œβ”€β”€ Authenticated/  # Protected routes
β”‚   β”œβ”€β”€ GeneralPages/   # Public routes
β”‚   └── utils/         # Routing utilities
β”œβ”€β”€ store/             # Redux store configuration
β”‚   β”œβ”€β”€ API/           # API integration
β”‚   β”œβ”€β”€ Slices/        # Redux slices
β”‚   └── hooks/         # Store hooks
└── types/             # TypeScript types and interfaces

πŸ› οΈ Setup & Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Copy .env.example to .env and configure environment variables
  4. Start development server:
    npm run dev

πŸ“œ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run lint - Run ESLint
  • npm run preview - Preview production build

🎯 Key Features

Authentication

  • Supabase-based authentication system
  • Protected routes for authenticated users
  • Password reset functionality
  • Session management

Profile Management

  • Personal details management
  • Address information
  • Professional details
  • University information
  • Profile completion tracking

Crowdfunding

  • Create and manage crowdfunding posts
  • Detailed view of funding requests
  • Progress tracking
  • Interactive funding process

Loan Management

  • Loan request creation
  • Loan details viewing
  • Status tracking
  • Document management

πŸ“Έ Screenshots

Homepage

Homepage

Logged In Dashboard

Logged In Dashboard

Crowdfunding Page

Crowdfunding Page

Loan Page

Loan Page

Create Crowdfunding Project

Create Crowdfunding Project

Create Loan Project

Create Loan Project

🧩 Components

Cards

  • CrowdFundingPost: Displays crowdfunding opportunities
  • Post: Generic post display component
  • Profile Cards:
    • AddressDetails: User address information
    • PersonalDetails: Basic user information
    • ProfessionCard: Professional information
    • UniversityDetails: Educational background

Forms

  • Custom form components with validation
  • Pre-built templates for common forms
  • Input fields with error handling
  • Text area components

Layout

  • Responsive navbar with mobile support
  • Footer component
  • Mobile sidebar for navigation
  • Theme-aware components

Modals & Sheets

  • Base modal component
  • Delete confirmation modal
  • Sheet components for profile sections
  • Crowdfunding interaction sheets

πŸ”„ State Management

The application uses Redux Toolkit for state management with the following slices:

  • userSlice: User authentication and profile data
  • systemSlice: Application-wide settings and states
  • notificationsSlice: Toast notifications and alerts

🎣 Custom Hooks

  • useAuthStateChange: Manages authentication state changes
  • useControlledState: Controlled form state management
  • useRemainingHeight: Dynamic height calculations
  • useTheme: Theme management

πŸ” Authentication Flow

  1. User signs up/logs in through Supabase Auth
  2. Authentication state is managed through Redux
  3. Protected routes are handled by RouteLogic component
  4. Session persistence using redux-persist

πŸ”Œ API Integration

API calls are organized in the store/API directory:

  • tableDataAPI: Database table operations
  • userAuthAPI: Authentication-related operations

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a pull request

πŸ”§ Configuration

ESLint

The project uses a custom ESLint configuration with:

  • TypeScript support
  • React-specific rules
  • Strict type checking

Tailwind

  • Custom configuration with animations
  • Theme support
  • Responsive design utilities

πŸ—οΈ Architecture Decisions

  1. Component Structure

    • Atomic design principles
    • Separation of concerns
    • Reusable base components
  2. State Management

    • Centralized Redux store
    • Local state when appropriate
    • Persistent storage for critical data
  3. Routing

    • Protected routes
    • Role-based access
    • Clean URLs
  4. Performance

    • Code splitting
    • Lazy loading
    • Optimized builds

πŸ“š Type System

The project uses TypeScript with:

  • Strict type checking
  • Interface-first design
  • Enum usage for constants
  • Comprehensive type definitions

Types are organized in:

  • types/interface.ts: Interface definitions
  • types/types.ts: Type aliases
  • types/enum.ts: Enumerations

πŸ” Development Guidelines

  1. Code Style

    • Use functional components
    • Implement proper error handling
    • Write meaningful comments
    • Follow TypeScript best practices
  2. Testing

    • Write unit tests for utilities
    • Component testing
    • Integration testing
  3. Performance

    • Optimize renders
    • Implement proper memoization
    • Monitor bundle size
  4. Security

    • Implement proper authentication
    • Validate user input
    • Handle sensitive data appropriately

πŸ“¦ Dependencies

Production Dependencies

  • React and React DOM
  • Redux Toolkit and React-Redux
  • Supabase for authentication
  • Radix UI components
  • TailwindCSS for styling
  • Day.js for date handling
  • React Router for navigation

Development Dependencies

  • TypeScript
  • ESLint
  • Vite
  • Various type definitions
  • Development utilities

πŸš€ Deployment

The application can be deployed using:

  1. Build the application: npm run build
  2. Preview the build: npm run preview
  3. Deploy the dist directory to your hosting platform

🀝 Support

For support, please:

  1. Check existing documentation
  2. Review issue tracker
  3. Create a new issue if needed

This project is maintained with ❀️ by the CrowdCredit team.

About

A friendly money lending and crowdfunding platform inclusive for an institute

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors