Prerequisites
Before installing Inmobiliaria Web, ensure you have the following installed:- Node.js 18.x or higher
- npm 9.x or higher (comes with Node.js)
- PostgreSQL 14.x or higher
- Git (for cloning the repository)
This guide assumes you’re setting up a local development environment. For production deployment, see the Deployment Guide.
Installation Steps
Install Dependencies
Install all required npm packages:This installs the following key dependencies:
Import Database Schema
Import the complete database schema from This creates all necessary tables:Authentication Tables:
inmobiliaria_complete_schema.sql:users- User accounts (Better Auth compatible)accounts- OAuth provider accountssessions- User sessionsverification_tokens- Email verification tokensuser_passwords- Password hashes for email/password auth
property_types- Casa, Departamento, PH, etc.property_subtypes- Monoambiente, Casa en country, etc.operation_types- Venta, Alquiler, etc.property_statuses- Activo, Vendido, Alquilado, etc.currencies- ARS, USD, EURproperties- Main property listingsproperty_locations- Address and coordinatesproperty_images- Property photosproperty_features- Amenities and featuresproperty_tags- Tags for categorizationconditions- Property conditionsfavorites- User favorite properties
Configure Environment Variables
Create a
.env file in the root directory with the following variables:Getting API Keys
Google Maps API Key
Google Maps API Key
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the following APIs:
- Maps JavaScript API
- Places API
- Geocoding API
- Create credentials (API Key)
- Restrict the API key to your domain for production
Google OAuth Credentials
Google OAuth Credentials
- Go to Google Cloud Console
- Navigate to “APIs & Services” > “Credentials”
- Create OAuth 2.0 Client ID
- Add authorized redirect URI:
http://localhost:10000/api/auth/callback/google - Copy Client ID and Client Secret to
.env
Running the Application
- Development Mode
- Production Build
- Linting
Start the development server with hot reload:The application will be available at:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:10000/api
Vite dev server runs on port 5173 by default. The backend API must be running separately on port 10000.
Project Structure
After installation, your project structure will look like this:Verify Installation
To ensure everything is set up correctly:Check Database Connection
Verify that PostgreSQL is running and the database is accessible:Expected output:
14 (number of property types in the schema)Test API Connection
Open your browser and navigate to
http://localhost:5173The application should load without errors. Check the browser console for any configuration issues.Troubleshooting
Database connection failed
Database connection failed
Error:
ECONNREFUSED or connection refusedSolutions:- Ensure PostgreSQL is running:
sudo service postgresql start - Check database credentials in
.env - Verify database exists:
psql -U postgres -l - Check PostgreSQL is listening on port 5432
Google Maps not loading
Google Maps not loading
Error:
VITE_GOOGLE_MAPS_API_KEY is not setSolutions:- Verify
.envfile exists in project root - Check environment variable name is exactly
VITE_GOOGLE_MAPS_API_KEY - Restart development server after adding environment variables
- Ensure Google Maps APIs are enabled in Google Cloud Console
Type errors during build
Type errors during build
Error: TypeScript compilation errorsSolutions:
- Run
npm installto ensure all type definitions are installed - Check
tsconfig.jsonconfiguration - Clear TypeScript cache:
rm -rf node_modules/.vite - Verify you’re using TypeScript 5.8.3 or compatible version
Port already in use
Port already in use
Error:
Port 5173 is already in useSolutions:- Stop other Vite processes:
pkill -f vite - Use a different port:
npm run dev -- --port 3000 - Check what’s using the port:
lsof -i :5173
API requests failing
API requests failing
Error:
Failed to fetch or CORS errorsSolutions:- Ensure backend API is running on port 10000
- Check
VITE_API_URLin.envmatches backend URL - Verify CORS is configured on backend to allow
http://localhost:5173 - Check browser network tab for detailed error messages
Next Steps
Now that your environment is set up:Quickstart Guide
Create your first property listing in minutes
Authentication Setup
Configure user authentication and roles
API Reference
Explore all available API endpoints
Component Library
Learn about available UI components
Additional Configuration
Tailwind CSS
Tailwind is pre-configured intailwind.config.js. To customize:
Better Auth Configuration
Better Auth is configured insrc/lib/auth-client.ts:
Vite Configuration
Vite is configured with React and TanStack Router plugins:For production deployment, see the Deployment Guide for instructions on hosting with Caddy, Docker, or other platforms.