Skip to content

devbynikhil/flatup

Repository files navigation

FlatUp - Feature-Rich Flat Listing Web Application

A comprehensive full-stack web platform that connects people looking for places to live with flat owners, brokers, or current residents who have spare rooms. Built with Next.js 14, MongoDB Atlas, and modern web technologies.

πŸš€ Features

πŸ‘₯ User Roles & Functionalities

πŸ§β€β™‚οΈ Listers (Paid Users)

  • Broker (β‚Ή1000/month): Registered broker managing multiple properties
  • Owner (β‚Ή800/month): Property owner renting directly
  • Room Sharer (β‚Ή500/month): Individual renting spare rooms

Lister Features:

  • Full user registration with profile photos
  • Secure online payment via Razorpay
  • Role-based personal dashboard
  • Comprehensive flat listing with multiple images
  • Listing analytics (views, inquiries)
  • Subscription management and renewal
  • Payment history and invoices

🌐 General Users (Visitors)

  • Browse listings without registration
  • Advanced filtering and search
  • Grid and list layout toggle
  • Detailed flat information with image carousel
  • Contact listers directly
  • Share listings on social media

πŸ›‘οΈ Super Admin

  • Complete platform oversight
  • User and listing management
  • Real-time analytics dashboard
  • Revenue tracking
  • Subscription management
  • Broadcasting and notifications

πŸ’³ Payment Integration

  • Razorpay integration for INR payments
  • Monthly subscription billing
  • Secure checkout flow
  • Webhook integration for payment verification
  • Automated invoice generation
  • Email notifications

🎨 UI/UX Features

  • Modern, responsive design with Tailwind CSS
  • Dark/light theme toggle
  • Smooth animations with Framer Motion
  • Mobile-first responsive design
  • Elegant color palette and typography

πŸ› οΈ Tech Stack

  • Frontend: Next.js 14 (App Router), React, TypeScript
  • Styling: Tailwind CSS, Custom CSS Variables
  • Backend: Next.js API Routes, MongoDB with Mongoose
  • Authentication: NextAuth.js with Google OAuth & Credentials
  • Payment: Razorpay
  • Image Upload: Cloudinary
  • Email: Nodemailer
  • Real-time: Socket.IO/Pusher (configured)
  • Deployment: Vercel-ready

πŸ“¦ Installation & Setup

Prerequisites

  • Node.js 18+ and npm
  • MongoDB Atlas account
  • Cloudinary account
  • Razorpay account
  • Google OAuth credentials
  • Email service (Gmail recommended)

1. Clone the Repository

git clone <repository-url>
cd flatup
npm install

2. Environment Variables

Create a .env.local file in the root directory and add the following:

# Database
MONGODB_URI=mongodb+srv://username:password@cluster0.mongodb.net/flatup?retryWrites=true&w=majority

# NextAuth.js
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-super-secret-key-here-change-this-in-production

# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Razorpay
RAZORPAY_KEY_ID=your-razorpay-key-id
RAZORPAY_KEY_SECRET=your-razorpay-key-secret

# Cloudinary
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret

# Email (Nodemailer)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password

# Google Maps
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your-google-maps-api-key

# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000

3. Service Setup

MongoDB Atlas

  1. Create a MongoDB Atlas account
  2. Create a new cluster
  3. Create a database user
  4. Get your connection string
  5. Replace the MONGODB_URI in .env.local

Cloudinary

  1. Sign up for Cloudinary
  2. Get your cloud name, API key, and API secret
  3. Add them to .env.local

Razorpay

  1. Create a Razorpay account
  2. Get your Key ID and Key Secret from the dashboard
  3. Add them to .env.local

Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URIs: http://localhost:3000/api/auth/callback/google
  6. Add credentials to .env.local

Email Setup (Gmail)

  1. Enable 2-factor authentication on your Gmail account
  2. Generate an app password
  3. Use your Gmail and app password in .env.local

4. Run the Application

npm run dev

The application will be available at http://localhost:3000

πŸ—‚οΈ Project Structure

src/
β”œβ”€β”€ app/                    # Next.js 14 App Router
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”œβ”€β”€ auth/              # Authentication pages
β”‚   β”œβ”€β”€ dashboard/         # User dashboard
β”‚   β”œβ”€β”€ admin/             # Admin dashboard
β”‚   β”œβ”€β”€ browse/            # Browse listings
β”‚   β”œβ”€β”€ flat/              # Flat details
β”‚   β”œβ”€β”€ payment/           # Payment pages
β”‚   └── pricing/           # Pricing page
β”œβ”€β”€ components/            # Reusable components
β”‚   β”œβ”€β”€ layout/           # Layout components
β”‚   └── ui/               # UI components
β”œβ”€β”€ lib/                  # Utility functions
β”œβ”€β”€ models/               # MongoDB models
└── types/                # TypeScript types

πŸ” Authentication Flow

  1. User registers with role selection
  2. Email verification (optional)
  3. Redirect to payment page for subscription
  4. Payment processing via Razorpay
  5. Account activation and dashboard access

πŸ’° Subscription Plans

Plan Price Features
Room Sharer β‚Ή500/month Basic listing, 5 photos, email support
Property Owner β‚Ή800/month Unlimited listings, 10 photos, priority support
Broker β‚Ή1000/month Premium features, 15 photos, client management

πŸš€ Deployment

Vercel Deployment

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy

Environment Variables for Production

Update the following for production:

  • NEXTAUTH_URL: Your production domain
  • NEXT_PUBLIC_APP_URL: Your production domain
  • NEXTAUTH_SECRET: Generate a new secret for production

πŸ§ͺ Testing

# Run development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

πŸ“± Features Implemented

βœ… User authentication with NextAuth.js βœ… Role-based access control βœ… Payment integration with Razorpay βœ… Image upload with Cloudinary βœ… Responsive design with Tailwind CSS βœ… Dark/light theme toggle βœ… Advanced filtering and search βœ… Real-time analytics dashboard βœ… Email notifications βœ… Admin panel with full control βœ… Mobile-responsive design βœ… SEO optimization

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support, email support@flatup.com or create an issue in the repository.


Built with ❀️ using Next.js 14, MongoDB, and modern web technologies.

About

A full-stack flat listing and rental platform connecting tenants, owners, brokers, and room sharers. Built with Next.js, MongoDB, and Razorpay, featuring role-based dashboards, payments, and advanced property search.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors