A modern, fullstack building management platform built with cutting-edge technologies
Features β’ Tech Stack β’ Getting Started β’ Architecture β’ Roadmap
Daniel Segura
- GitHub: @daniseguraf
- LinkedIn: linkedin.com/in/daniel-segura-fang
My Buildings is a fullstack building management application designed to simplify property administration. It includes authentication, authorization, and a modern UI, showcasing end-to-end feature delivery and real-world business logic.
- Fullstack TypeScript β React + Node.js with shared types
- Authentication & RBAC β JWT with role-based access
- Scalable Architecture β Monorepo structure and clean separation of concerns
- Modern UI β Responsive interface built with Mantine
- Production Ready β Deployed on Vercel (frontend) and Railway (backend)
- Dockerized DB β Easy local setup and deployment
-
π Authentication & Authorization
- JWT authentication and secure session handling
- Role-based access (Admin, Manager, Resident)
- Protected routes and API endpoints
- Login / Logout flows
-
π’ Building Management
- Full CRUD operations for buildings
- Property type classification (Residential, Commercial, Mixed)
- Detailed infor (floors, address, contact data)
- Role-based permissions for building operations
-
ποΈ Common Areas
- CRUD operations for common areas
- Capacity management and active/inactive status
- Association with specific buildings
- Operating hours configuration
-
π Reservation System
- Date and time booking
- Automatic operating-hours validation
- Overlap prevention system
- Maximum duration enforcement
- Reservation statuses (Confirmed, Cancelled, On Review, Finished)
- View and manage personal reservations
- π« Maintenance ticket system
- π Analytics dashboard
- π§ Email notifications
- π PDF report generation for buildings and reservations
- π§ͺ Testing coverage
Secure authentication with JWT tokens
Manage all your buildings in one place
Detailed common areas list
Amenities
Building general information
Create new building form
Reservations Calendar
My reservations lists
Create reservation form
Manage Reservations
Buildings page
Building detail page dark theme
- NestJS - Progressive Node.js framework for scalable server-side applications
- Prisma - Next-generation ORM for type-safe database access
- PostgreSQL - Advanced open-source relational database
- pdfmake - Client/server-side PDF printing
- Swagger/OpenAPI - API documentation and type generation
- class-validator - Decorator-based validation
- React 19 - Latest React with React Compiler for automatic optimization
- Mantine UI - Comprehensive React component library
- TanStack Query - Powerful data synchronization and caching
- React Router 7 - Modern routing solution
- Zod - TypeScript-first schema validation
- Axios - Promise-based HTTP client
- Vite - Next-generation frontend tooling
- pnpm - Fast, disk space efficient package manager
- Docker - Containerization platform
- TypeScript - Static type checking
- ESLint - Code quality and consistency
- Prettier - Code formatting
my-buildings/
βββ packages/
β βββ backend/ # NestJS API server
β β βββ src/
β β β βββ auth/ # Authentication module (JWT, Guards, Strategies)
β β β βββ buildings/ # Buildings CRUD module
β β β βββ common-areas/ # Common areas module
β β β βββ reservations/ # Reservations system
β β β βββ seed/ # Database seeding
β β β βββ printer/ # PDF generation service
β β β βββ prisma/ # Database service
β β β βββ config/ # Environment configuration
β β β βββ common/ # Shared decorators & validators
β β β βββ main.ts # Application entry point
β β βββ prisma/
β β β βββ schema.prisma # Database schema
β β β βββ migrations/ # Database migrations
β β βββ fonts/ # Fonts for PDF generation
β β βββ test/ # E2E tests
β β
β βββ frontend/ # React application
β β βββ src/
β β β βββ app/ # App configuration & routes
β β β β βββ layouts/ # Layout components
β β β β βββ routes/ # Route definitions
β β β βββ features/ # Feature-based modules
β β β β βββ auth/ # Authentication (Login, Context)
β β β β βββ buildings/ # Buildings & Common Areas
β β β β βββ reservations/ # Reservation system
β β β βββ components/ # Shared UI components
β β β βββ hooks/ # Custom React hooks
β β β βββ lib/ # Axios & QueryClient configs
β β β βββ utils/ # Helper functions
β β β βββ theme.ts # Mantine theme configuration
β β βββ public/ # Static assets
β β
β βββ shared/ # Shared types between FE & BE
β βββ src/
β βββ types/ # Generated TypeScript types
β
βββ docs/
β βββ screenshots/ # Application screenshots
βββ docker-compose.yaml # Docker services configuration
βββ pnpm-workspace.yaml # Monorepo workspace config
- Module-based architecture in NestJS for separation of concerns
- Feature-based structure in React for scalability
- Type generation from OpenAPI specs for type safety across FE/BE
- Repository pattern with Prisma for data access
- DTO validation with class-validator decorators
- Error handling with global exception filters
- API versioning for backward compatibility
- Soft deletes for data integrity
- Node.js >= 18.x
- pnpm >= 10.23
- Docker & Docker Compose (for database)
- PostgreSQL 14+ (or use Docker)
- Clone the repository
git clone https://github.com/daniseguraf/my-buildings.git
cd my-buildings- Install dependencies
pnpm install- Set up environment variables
Create a .env file in the packages/backend directory:
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/my_buildings?schema=public"
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=my_buildings
# Server
PORT=3000
NODE_ENV=development- Start the database
docker-compose up -d- Run database migrations
cd packages/backend
pnpm migrate- Generate Prisma client and types
cd packages/backend
pnpm generateRun both frontend and backend concurrently:
# From root directory
pnpm devOr run them separately:
# Backend only (http://localhost:3000)
pnpm dev:backend
# Frontend only (http://localhost:5173)
pnpm dev:frontend# Build all packages
pnpm build
# Build individually
pnpm build:backend
pnpm build:frontend
# Start production server
cd packages/backend
pnpm start:prodOnce the backend is running, access the interactive API documentation:
- Swagger UI: http://localhost:3000/api/docs
- OpenAPI JSON: Generated automatically in development mode
Authentication (/api/v1/auth)
POST /auth/register- Register new userPOST /auth/login- Login and get JWT tokenGET /auth/me- Get current user profileGET /auth/check-auth-status- Verify authentication status
Buildings (/api/v1/buildings)
GET /buildings- List all buildings (with filters)POST /buildings- Create a new building (Admin/Manager)GET /buildings/:id- Get building detailsPATCH /buildings/:id- Update building (Admin/Manager)DELETE /buildings/:id- Soft delete building (Admin)PATCH /buildings/:id/restore- Restore deleted building (Admin)
Common Areas (/api/v1/common-areas)
GET /common-areas/building/:buildingId- List areas by buildingPOST /common-areas- Create common area (Manager)GET /common-areas/:id- Get area detailsPATCH /common-areas/:id- Update common area (Manager)DELETE /common-areas/:id- Delete common area (Manager)
Reservations (/api/v1/reservations)
POST /reservations- Create new reservation (Resident)GET /reservations/building- Get reservations by resident's buildingDELETE /reservations/:id- Cancel reservation (Resident/Admin)
Seed (/api/v1/seed)
GET /seed- Populate database with test data (Development only)
The application uses PostgreSQL with Prisma ORM. The schema includes:
-
User: Application users with role-based access (Admin, Manager, Resident)
- Authentication credentials (email, password)
- Role assignment and building association
- Relationship with reservations and managed buildings
-
Building: Core entity for property management
- Property information (name, address, type, year built)
- Soft delete support with
deletedAtfield - Amenities (parking, security, elevator, etc.)
-
CommonArea: Shared spaces within buildings
- Type classification (Gym, Pool, Event Room, etc.)
- Capacity and availability management
- Operating hours and days configuration
- Maximum reservation duration rules
-
Reservation: Booking system for common areas
- Time slot management with overlap prevention
- Status tracking (In Review, Confirmed, Cancelled, Finished)
- User and common area associations
- Attendees count and notes
User (Manager) ββ< manages >ββ Building
User (Resident) ββ< lives in >ββ Building
Building ββ< has >ββ CommonArea
User ββ< makes >ββ Reservation
CommonArea ββ< has >ββ Reservation
For detailed schema, see packages/backend/prisma/schema.prisma
See ROADMAP.md for detailed development plan.
Upcoming Features:
- β NestJS with modular architecture and dependency injection
- β Prisma ORM with complex relationships and migrations
- β Complete JWT authentication (Strategy, Guards, Decorators)
- β Complex business validations (no-overlapping reservations)
- β DTOs with class-validator for request validation
- β RESTful API design with proper HTTP methods
- β Proper error handling with custom exceptions
- β Database seeders for test data
- β Soft deletes for data integrity
- β Role-based authorization at endpoint level
- β React 19 with TypeScript and strict type checking
- β Context API for global state management
- β TanStack Query for data fetching, caching, and mutations
- β Mantine UI for modern component library
- β Complex forms with real-time validation
- β Protected routes with role-based access control
- β Axios interceptors for authentication
- β Feature-based scalable architecture
- β Custom hooks for reusable logic
- β Loading states, error handling, and empty states
- β Monorepo structure with pnpm workspaces
- β Docker Compose for local development
- β Deployment on Railway (backend + PostgreSQL)
- β Deployment on Vercel (frontend)
- β Environment variables per environment
- β Automatic CI/CD with GitHub integration
- β CORS configuration for production
- β Database migrations in production












