A modern, full-stack real estate application built with SvelteKit (Frontend) and Flask (Backend), powered by Firebase for data and authentication.
- Property Listings: Browse properties with details like price, location, bedrooms, and amenities.
- Interactive Maps: View property locations on an interactive map (Leaflet/OpenStreetMap).
- Admin Dashboard: Secure admin interface to add and manage property listings.
- User Authentication: Sign up and login functionality using Firebase Auth.
- Responsive Design: Beautiful, mobile-first UI built with TailwindCSS and Shadcn-Svelte.
- Image Carousel: View multiple images for each property.
- Framework: SvelteKit (Svelte 5)
- Styling: TailwindCSS, Shadcn-Svelte
- Maps: Leaflet.js
- State Management: Svelte Stores
- Build Tool: Vite
- Framework: Flask (Python)
- Database: Firebase Firestore
- Storage: Firebase Storage
- Authentication: Firebase Auth
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.10 or higher)
- Git
git clone https://github.com/arzvaak/KrishnaProperties.git
cd KrishnaPropertiesThe backend is a Flask application that serves the API.
-
Navigate to the backend directory:
cd backend -
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Configure Firebase Credentials:
- Go to your Firebase Console.
- Navigate to Project Settings > Service accounts.
- Click Generate new private key.
- Save the downloaded JSON file as
serviceAccountKey.jsoninside thebackend/directory. - Note: This file is sensitive and is ignored by git. DO NOT commit it.
-
(Optional) Seed Database: If you want to populate the database with dummy data:
python seed_data.py
-
Run the backend server:
python app.py
The server will start at
http://localhost:5000.
The frontend is a SvelteKit application.
-
Open a new terminal and navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Configure Environment Variables:
- Create a file named
.envin thefrontend/directory. - Add your Firebase configuration keys (found in Firebase Console > Project Settings > General > Your apps > SDK setup and configuration > Config).
Example
.envfile:VITE_FIREBASE_API_KEY=your_api_key VITE_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com VITE_FIREBASE_PROJECT_ID=your_project_id VITE_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id VITE_FIREBASE_APP_ID=your_app_id
- Note: This file is ignored by git. DO NOT commit it.
- Create a file named
-
Run the development server:
npm run dev
The app will be available at
http://localhost:5173.
KrishnaProperties/
├── backend/ # Flask Backend
│ ├── routes/ # API Routes (properties, users)
│ ├── app.py # Main application entry point
│ ├── firebase_config.py # Firebase initialization logic
│ ├── seed_data.py # Script to seed dummy data
│ ├── requirements.txt # Python dependencies
│ └── serviceAccountKey.json # (Ignored) Firebase Admin SDK key
│
├── frontend/ # SvelteKit Frontend
│ ├── src/
│ │ ├── lib/ # Shared components and utilities
│ │ │ ├── components/ # UI Components (Map, Navbar, etc.)
│ │ │ └── firebase.js # Firebase client initialization
│ │ └── routes/ # Application pages (File-based routing)
│ ├── static/ # Static assets
│ ├── .env # (Ignored) Environment variables
│ └── package.json # Node.js dependencies
│
├── .gitignore # Root gitignore
└── README.md # Project documentation
- CORS Errors: Ensure the backend is running and
flask-corsis installed and configured inapp.py. - Firebase Errors:
- Backend: Ensure
serviceAccountKey.jsonis present inbackend/and has correct permissions. - Frontend: Ensure
.envfile exists infrontend/and contains valid keys. Restart the Vite server after changing.env.
- Backend: Ensure
- Map Not Loading: Ensure you have an internet connection as Leaflet loads tiles from OpenStreetMap.
This repository is configured to exclude sensitive files (.env, serviceAccountKey.json) from version control. Never force push these files to GitHub.
This project is open source and available under the MIT License.