Skip to content

alamrumman/1fi-emi-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

1Fi - Smart EMI Platform πŸ’³

1Fi Banner React Node.js MongoDB Express.js Tailwind CSS

Turn Your Mutual Funds into Buying Power

Live Demo β€’ Report Bug β€’ Request Feature


πŸ“– About The Project

1Fi is an innovative fintech platform that enables users to purchase premium smartphones ,laptops and a lot more through flexible EMI plans backed by mutual fund investments. Users can maintain their investments while gaining purchasing power through low-interest credit lines.

✨ Key Features

  • πŸ›οΈ Smart Shopping - Browse premium smartphones and laptops
  • 🎨 Multiple Variants - Choose from different colors and storage options
  • πŸ’° Flexible Downpayment - 15% or 30% downpayment options
  • πŸ“… EMI Plans - 3, 6, 9, or 12 months at just 8% p.a.
  • πŸ’Ž Investment-Backed - Keep your mutual funds growing while you spend
  • 🚫 Zero Fees - No processing charges, no hidden costs
  • πŸ“± Responsive Design - Seamless experience across all devices

πŸ–₯️ Tech Stack

Frontend

  • React 18 - UI library
  • Vite - Build tool and dev server
  • Tailwind CSS - Utility-first CSS framework
  • Lucide React - Beautiful icon library
  • React Router - Client-side routing

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB object modeling
  • CORS - Cross-origin resource sharing
  • dotenv - Environment variable management

πŸš€ Getting Started

Follow these steps to set up the project locally.

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB Atlas account or local MongoDB installation
  • Git

Installation

  1. Clone the repository
   git clone https://github.com/alamrumman0/1fi-emi-platform.git
   cd 1fi-emi-platform
  1. Setup Backend
   cd Server
   npm install

Create .env file in Server directory:

   PORT=3000
   MONGO_URI=your_mongodb_connection_string
   NODE_ENV=development
  1. Setup Frontend
   cd ../client
   npm install

Create .env.development file in client directory:

   VITE_API_URL=http://localhost:3000/api
  1. Seed the Database
   cd ../Server
   npm run seed
  1. Run the Application

    Terminal 1 - Backend:

   cd Server
   npm run dev

Terminal 2 - Frontend:

   cd client
   npm run dev
  1. Open in Browser
   Frontend: http://localhost:5173
   Backend API: http://localhost:3000/api

πŸ“ Project Structure

1fi-emi-platform/
β”œβ”€β”€ client/                 # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”œβ”€β”€ api/          # API integration
β”‚   β”‚   β”œβ”€β”€ App.jsx       # Main app component
β”‚   β”‚   └── main.jsx      # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”‚
β”œβ”€β”€ Server/                # Backend Node.js application
β”‚   β”œβ”€β”€ models/           # Mongoose schemas
β”‚   β”‚   └── Product.js
β”‚   β”œβ”€β”€ routes/           # API routes
β”‚   β”‚   └── productRoutes.js
β”‚   β”œβ”€β”€ controllers/      # Route controllers
β”‚   β”‚   └── productController.js
β”‚   β”œβ”€β”€ scripts/          # Database seed scripts
β”‚   β”‚   └── seed.js
β”‚   β”œβ”€β”€ server.js         # Express server
β”‚   └── package.json
β”‚
β”œβ”€β”€ .gitignore
└── README.md

πŸ”Œ API Documentation

Base URL

Development: http://localhost:3000/api
Production: https://your-backend-url.onrender.com/api

Endpoints

Get All Products

GET /products

Response:

{
  "success": true,
  "count": 9,
  "data": [
    {
      "id": "...",
      "name": "Apple iPhone 17 Pro",
      "brand": "Apple",
      "price": 134900,
      "variants": [...],
      "emiPlans": [...]
    }
  ]
}

Get Single Product

GET /products/:id

Response:

{
  "success": true,
  "data": {
    "id": "...",
    "name": "Apple iPhone 17 Pro",
    "description": "...",
    "images": [...],
    "variants": [...],
    "emiPlans": [...],
    "downpaymentOptions": [...]
  }
}

πŸ—„οΈ Database Schema

Product Model

{
  name: String,              // Product name
  brand: String,             // Apple, Samsung, ASUS, etc.
  category: String,          // Smartphone, Laptop
  description: String,       // Product description
  images: [{
    url: String,
    alt: String
  }],
  basePrice: Number,         // Starting price
  variants: [{
    color: String,
    colorCode: String,       // Hex color code
    storage: String,         // 256 GB, 512 GB, etc.
    price: Number,
    stock: Number,
    sku: String
  }],
  emiPlans: [{
    tenure: Number,          // 3, 6, 9, 12 months
    interestRate: Number,    // Interest rate percentage
    label: String           // "10% EMI" badge
  }],
  downpaymentOptions: [{
    percentage: Number,      // 15, 30
    amount: Number
  }],
  features: [String],
  isActive: Boolean,
  isFeatured: Boolean,
  slug: String
}

🎨 Design System

Color Palette

/* Primary Colors */
--slate-950: #020617    /* Background */
--slate-900: #0f172a    /* Cards */
--slate-800: #1e293b    /* Borders */

/* Accent Colors */
--violet-600: #7c3aed   /* Primary CTA */
--violet-500: #8b5cf6   /* Hover states */
--violet-400: #a78bfa   /* Text highlights */

/* Text Colors */
--white: #ffffff        /* Headings */
--gray-300: #d1d5db     /* Body text */
--gray-400: #9ca3af     /* Secondary text */

Typography

  • Headings: System font stack (optimized for each OS)
  • Body: Inter, system-ui, sans-serif
  • Monospace: Fira Code, monospace

πŸ“± Features Showcase

Product Listing

  • Grid layout with responsive design
  • Product cards with images and pricing
  • EMI badges for quick identification
  • Hover effects and smooth transitions

Product Details

  • Multiple image gallery
  • Variant selector (color + storage)
  • Downpayment calculator
  • EMI plan comparison
  • Real-time price updates

EMI Calculator

  • Dynamic EMI calculation based on:
    • Product price
    • Selected variant
    • Downpayment amount
    • Tenure selection

πŸš€ Deployment

Frontend (Vercel)

cd client
vercel login
vercel
vercel --prod

Environment Variables:

VITE_API_URL=https://your-backend.onrender.com/api

Backend (Render)

  1. Connect GitHub repository
  2. Set root directory to Server
  3. Build command: npm install
  4. Start command: npm start

Environment Variables:

MONGO_URI=your_mongodb_atlas_uri
PORT=3000
NODE_ENV=production

Database (MongoDB Atlas)

  • Free tier: 512MB storage
  • Automatic backups
  • Global distribution

πŸ§ͺ Testing

# Run backend tests
cd Server
npm test

# Run frontend tests
cd client
npm test

πŸ“Š Performance

  • Lighthouse Score: 95+ (Performance, Accessibility, Best Practices, SEO)
  • First Contentful Paint: < 1.5s
  • Time to Interactive: < 3.0s
  • Bundle Size: < 200KB (gzipped)

πŸ› οΈ Available Scripts

Backend (Server/)

npm run dev      # Start development server with nodemon
npm start        # Start production server
npm run seed     # Seed database with sample data

Frontend (client/)

npm run dev      # Start Vite dev server
npm run build    # Build for production
npm run preview  # Preview production build

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

πŸ‘¨β€πŸ’» Author

Rumman


πŸ™ Acknowledgments


πŸ“ž Support

For support, email rummanalam.dev@gmail.com or create an issue in this repository.


Made with ❀️ for 1Fi SDE Assignment

⭐ Star this repository if you found it helpful!

About

Smart EMI platform for buying products with mutual fund backed loans

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages