A web application for managing apartment listings.
- Next.js - React framework for production
- NextUI - Modern component library
- Tailwind CSS - Utility-first CSS framework
- Prettier - Code formatter for consistent styling
- Fastify - Fast and lightweight web framework
- Fastify Multipart - Plugin for handling file uploads
- Fastify Static - Plugin for serving static images
- Fastify CORS - Plugin for Cross-Origin Resource Sharing
- Drizzle ORM - High-performance TypeScript ORM
- Type-safe
- Intuitive schema creation and query building
- High level database migrations
- Superior performance compared to other ORMs
- PostgreSQL - Relational database
- Perfect for structured data like apartment listings
- Docker
- Consistent development environment
- Easy deployment across different platforms
The backend is exposed at http://localhost:8000.
The backend provides the following REST API endpoints:
/check-server- Health check endpoint to verify server status/apartments- Retrieve all apartment listings/apartments/:id- Get details of a specific apartment by ID/wipe-apartments- Development endpoint to clear all apartments (use with caution)
/apartments- Create a new apartment listing- Accepts multipart form data with the following required fields:
title(string) - Apartment listing title, max 255 charactersaddress(string) - Location address, max 255 charactersarea(number) - Apartment area in square metersprice(number) - Apartment priceunitnumber(string) - Unit identifier, max 50 charactersproject(string) - Project developer name, max 255 charactersdescription(string, optional) - Detailed apartment descriptionimage(files, optional) - Zero or more image files for the apartment
- Handles multiple image uploads
- Validates all required fields before creation
- Accepts multipart form data with the following required fields:
/apartments/:id- Delete a specific apartment by ID
- Docker and Docker Compose installed on your system
- Copy
.env.exampleto.env
Execute the following command in the root directory:
docker compose upOr to enusre that no dangling images or unused cache layers or dangling volumes remain :
docker compose up --build -d && docker system prune -f && docker volume prune -fThis will:
- Build and start both the frontend and backend services
- Set up the necessary database connections
- Install all required dependencies
The setup includes:
- Hot-reloading for both frontend and backend development
- Persistent PostgreSQL data storage
For testing purposes, there are two sample images included in the backend/src directory: test.jpg test 2.webp
Once the services are running, you can access the main page on http://localhost:3000 where you'll find:
- An "Add Apartment" button to create new apartment listings
- Search fields to filter apartments based on different criteria
- Each search field operates independently
- Fields will turn red individually if no matches are found for that specific criteria
- This provides immediate visual feedback on which search parameters are too restrictive
Each apartment card displayed is clickable and redirects to a detailed view page where you can:
- View an image gallery of the apartment
- See all apartment details and specifications
- Delete the apartment listing if needed
The application features a fully responsive design:
- The navigation bar adapts to different screen sizes
- Images automatically resize to maintain proper proportions
- The apartment grid layout dynamically adjusts its column count based on screen width
- For best demonstration of the responsive grid, create at least 5 apartment records and try resizing your browser window
The following features are planned for future releases:
-
Dark Mode Toggle
-
Google Maps Integration
- Visual representation of apartment locations
- Quick access to directions
-
GitHub Workflows
-
Automated linting pipeline
-
CI/CD pipeline with:
- Deployment to DigitalOcean Docker droplet
- Cloudflare DNS records management
OR
- Google Cloud Compute Engine
- Browser-based SSH access through Cloud Console
- No manual public/private key setup required only google account access
-
-
Production Configuration
- Optimized Dockerfiles for production builds
- Production-ready docker-compose
- nginx image
- Dynamic environment variables:
- API endpoints configured via ENV
- Automatic host detection for fetch requests