Skip to content

ashu6783/crestkeys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CrestKeys 🏑

landingp

Your Ultimate Real Estate Platform

License: MIT Node.js React TypeScript MongoDB

πŸ“‹ Overview

CrestKeys is a comprehensive real estate platform that connects property buyers, renters, and vacation seekers with available listings. The platform offers a seamless experience for users to browse, create, and manage property listings with an intuitive interface.

Who is it for?

  • Property Owners: List your properties for sale, rent, or as vacation stays
  • Home Buyers: Find your dream home with detailed listings and photos
  • Renters: Discover rental properties that match your preferences
  • Vacationers: Book the perfect vacation spot for your next getaway
image image
Image 1 image
image Image 4
Image 5

✨ Features

For All Users

  • Property Search: Browse comprehensive property listings with detailed information
  • Advanced Filtering: Find properties by category (Buy, Rent, Vacation), location, price range, and amenities
  • Favorites: Save properties to revisit later
  • Enquiries: Contact property owners directly through the platform
  • Interactive Maps: Visualize property locations and explore neighborhoods

For Registered Users

  • User Profiles: Manage your personal information and preferences
  • Property Listings: Create and manage your own property listings
  • Image Management: Upload multiple high-quality photos via Cloudinary integration
  • Dashboard: Track your property listings, saved favorites, and enquiries
  • Notifications: Receive updates on your listings and enquiries

πŸ› οΈ Technology Stack

Frontend

  • React: Component-based UI library for building the user interface
  • TypeScript: For type-safe code development
  • Vite: Next-generation frontend tooling
  • Context API: For state management across the application
  • Axios: For API requests to the backend

Backend

  • Node.js: JavaScript runtime environment
  • Express.js: Web application framework for Node.js
  • MongoDB: NoSQL database for storing application data
  • Mongoose: MongoDB object modeling for Node.js
  • JWT: JSON Web Tokens for secure authentication

Cloud Services

  • Cloudinary: Cloud-based image and video management service
  • Vercel: Deployment and hosting platform

Getting Started

  1. Folder structure:
       crestkeys/
       β”‚
       β”œβ”€β”€ api/                      # Backend API source code
       β”‚   β”œβ”€β”€ controllers/          # Controllers to handle business logic
       β”‚   β”‚   β”œβ”€β”€ auth.controller.ts
       β”‚   β”‚   β”œβ”€β”€ post.controller.ts
       β”‚   β”‚   β”œβ”€β”€ user.controller.ts
       β”‚   β”‚   └── verify.controller.ts
       β”‚   β”‚
       β”‚   β”œβ”€β”€ middleware/           # Middleware for request validation and auth
       β”‚   β”‚   └── verifyToken.ts
       β”‚   β”‚
       β”‚   β”œβ”€β”€ models/               # Mongoose models for database schemas
       β”‚   β”‚   β”œβ”€β”€ post.ts
       β”‚   β”‚   β”œβ”€β”€ postDetail.ts
       β”‚   β”‚   β”œβ”€β”€ savedPost.ts
       β”‚   β”‚   └── user.ts
       β”‚   β”‚
       β”‚   β”œβ”€β”€ routes/               # API routes grouped by feature
       β”‚   β”‚   β”œβ”€β”€ auth.route.ts
       β”‚   β”‚   β”œβ”€β”€ post.route.ts
       β”‚   β”‚   β”œβ”€β”€ test.route.ts
       β”‚   β”‚   └── user.route.ts
       β”‚   β”‚
       β”‚   β”œβ”€β”€ db.ts                 # MongoDB connection setup
       β”‚   β”œβ”€β”€ index.ts              # Entry point for backend server
       β”‚   └── types/express/        # Custom typings for Express (if any)
       β”‚
       β”œβ”€β”€ estate/                   # Frontend React app (inside src)
       β”‚   β”œβ”€β”€ assets/               # Images and static assets
       β”‚   β”œβ”€β”€ components/           # React components organized by feature
       β”‚   β”‚   β”œβ”€β”€ card/
       β”‚   β”‚   β”œβ”€β”€ filter/
       β”‚   β”‚   β”œβ”€β”€ list/
       β”‚   β”‚   β”œβ”€β”€ map/
       β”‚   β”‚   β”œβ”€β”€ navbar/
       β”‚   β”‚   β”œβ”€β”€ pin/
       β”‚   β”‚   β”œβ”€β”€ searchbar/
       β”‚   β”‚   β”œβ”€β”€ slider/
       β”‚   β”‚   └── uploadWidget/
       β”‚   β”‚
       β”‚   β”œβ”€β”€ context/              # React Contexts for state management (e.g. Auth)
       β”‚   β”‚   β”œβ”€β”€ AuthContext.ts
       β”‚   β”‚   └── AuthProvider.tsx
       β”‚   β”‚
       β”‚   β”œβ”€β”€ lib/                  # Utility libraries (API requests, loaders, notifications)
       β”‚   β”‚   β”œβ”€β”€ ApiRequest.ts
       β”‚   β”‚   β”œβ”€β”€ Loaders.ts
       β”‚   β”‚   └── NotificationStore.ts
       β”‚   β”‚
       β”‚   β”œβ”€β”€ routes/               # Page-level components (views)
       β”‚   β”‚   β”œβ”€β”€ HomePage/
       β”‚   β”‚   β”œβ”€β”€ RequireAuth.tsx   # Component to protect routes
       β”‚   β”‚   β”œβ”€β”€ about/
       β”‚   β”‚   β”œβ”€β”€ layout/
       β”‚   β”‚   β”œβ”€β”€ listPage/
       β”‚   β”‚   β”œβ”€β”€ login/
       β”‚   β”‚   β”œβ”€β”€ newPostPage/
       β”‚   β”‚   β”œβ”€β”€ profilePage/
       β”‚   β”‚   β”œβ”€β”€ profileUpdatePage/
       β”‚   β”‚   β”œβ”€β”€ register/
       β”‚   β”‚   └── singlePage/
       β”‚   β”‚
       β”‚   β”œβ”€β”€ types.ts              # TypeScript types used in frontend
       β”‚   β”œβ”€β”€ App.tsx               # Main React app component
       β”‚   β”œβ”€β”€ main.tsx              # React app entry point
       β”‚   β”œβ”€β”€ index.css             # Global styles
       β”‚   └── vite.config.ts        # Vite config for frontend bundling
       β”‚
       β”œβ”€β”€ estate/                   # (If used) possibly static content or deployment related
       β”œβ”€β”€ public/                   # Public static files (images, favicon, etc.)
       β”‚
       β”œβ”€β”€ .gitignore                # Git ignore rules
       β”œβ”€β”€ README.md                 # This README file
       β”œβ”€β”€ package.json              # Project dependencies & scripts
       β”œβ”€β”€ tsconfig.json             # TypeScript config
       β”œβ”€β”€ vite.config.ts            # Vite configuration
       β”œβ”€β”€ vercel.json               # Vercel deployment config
       └── eslint.config.js          # ESLint rules for code linting
    
    
    
    

πŸ”’ Authentication Flow

  1. Registration:

    • User submits registration form with email, username, password
    • Backend validates the data and creates a new user account
    • JWT token is generated and returned to the client
  2. Login:

    • User submits login credentials
    • Backend validates credentials and issues a JWT token
    • Token is stored in the client using Context API
  3. Protected Routes:

    • JWT token is sent with each request to protected endpoints
    • Backend middleware verifies the token before processing requests
    • Unauthorized requests are rejected with appropriate error messages

πŸ“· Image Upload

CrestKeys uses Cloudinary for image management:

  1. User selects images for upload
  2. Images are sent directly to Cloudinary via the frontend
  3. Cloudinary returns image URLs after processing
  4. URLs are saved in the database as part of the property listing

🌐 API Endpoints

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Log in an existing user

Users

  • GET /api/users/profile - Get user profile
  • PUT /api/users/profile - Update user profile
  • GET /api/users/saved - Get user's saved properties

Properties

  • GET /api/posts - Get all properties (with filters)
  • GET /api/posts/:id - Get property details
  • POST /api/posts - Create new property listing
  • PUT /api/posts/:id - Update property listing
  • DELETE /api/posts/:id - Delete property listing
  • POST /api/posts/:id/inquire - Send inquiry about a property

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages