https://github.com/aanujkhurana/fullstack-findmylease
An enterprise-grade rental property management platform built with Next.js and AWS, designed for seamless property listing, tenant management, and secure transactions.
https://github.com/aanujkhurana/fullstack-findmylease
amplify aws cognito ec2 expressjs gateway-api nextjs nodejs prostgres react relational-databases shadcn sql
Last synced: about 2 months ago
JSON representation
An enterprise-grade rental property management platform built with Next.js and AWS, designed for seamless property listing, tenant management, and secure transactions.
- Host: GitHub
- URL: https://github.com/aanujkhurana/fullstack-findmylease
- Owner: aanujkhurana
- Created: 2025-03-01T07:58:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-24T01:45:00.000Z (about 1 year ago)
- Last Synced: 2025-05-24T02:35:09.724Z (about 1 year ago)
- Topics: amplify, aws, cognito, ec2, expressjs, gateway-api, nextjs, nodejs, prostgres, react, relational-databases, shadcn, sql
- Language: TypeScript
- Homepage: https://main.dykb851k9y38f.amplifyapp.com
- Size: 19.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
FindMyLease - Rental Management System ๐ข
An enterprise-grade rental property management platform
Built with Next.js,
AWS, and
PostgreSQL for seamless listings, secure authentication, and tenant/manager management.
## ๐ Tech Stack
- **Frontend**: [Next.js 13+](https://nextjs.org/), [Mapbox](https://www.mapbox.com/), [Amazon Cognito](https://aws.amazon.com/cognito/), [Tailwind CSS](https://tailwindcss.com/)
- **Backend**: [Node.js](https://nodejs.org/), [Express](https://expressjs.com/), [Prisma ORM](https://www.prisma.io/)
- **Database**: [PostgreSQL (RDS)](https://aws.amazon.com/rds/postgresql/)
- **Cloud Infrastructure**: [AWS S3](https://aws.amazon.com/s3/), [EC2](https://aws.amazon.com/ec2/), [Amplify](https://aws.amazon.com/amplify/), [API Gateway](https://aws.amazon.com/api-gateway/), [VPC](https://aws.amazon.com/vpc/), [Cognito](https://aws.amazon.com/cognito/)
- **Dev Tools**: [PM2](https://pm2.keymetrics.io/), [Postman](https://www.postman.com/), [Figma](https://www.figma.com/), [pgAdmin](https://www.pgadmin.org/), [Mermaid](https://mermaid.js.org/)
- **Extras**: `.npmrc` for [React 19](https://react.dev/) legacy support
## โจ Features
- ๐ Secure login with AWS Cognito
- ๐ Property listings with location via Mapbox
- ๐ท Image uploads to AWS S3
- ๐ฅ Role-based access for tenants and managers
- ๐ Admin dashboard with analytics (planned)
- ๐๏ธ Organized backend via Node.js and Prisma
- โ๏ธ Fully deployed using AWS services (Amplify, EC2, RDS, S3, API Gateway)
## ๐ Quick Links
- ๐ [Live Demo](https://main.dykb851k9y38f.amplifyapp.com)
- ๐จ [UI Design](./docs/ui-preview.jpg)
- ๐ [Entity Relationship Diagram](./docs/entity-diagram.jpg)
## ๐๏ธ Architecture
```mermaid
graph TD
A[Client - Next.js + Mapbox] -->|API Requests| B(API Gateway)
B --> C[EC2 Backend - Node.js + Prisma]
C --> D[RDS - PostgreSQL]
C --> E[S3 - Image Storage]
C --> F[Cognito - Auth]
C --> G[VPC - Network]
```
## ๐ User Flow
```mermaid
sequenceDiagram
participant User
participant Client
participant Backend
participant DB
participant Cognito
User->>Client: Sign up / login
Client->>Cognito: Authenticate user
Cognito-->>Client: Token
Client->>Backend: Fetch listings
Backend->>DB: Query
DB-->>Backend: Return results
Backend-->>Client: Send data
```
## ๐งญ Entity Flow Diagram
```mermaid
flowchart TD
Manager -->|hasMany| Applications
Manager -->|hasMany| Property
Property -->|hasOne| Location
Property -->|hasMany| Leases
Leases -->|hasMany| Payments
Applications -->|evaluatedBy| Decision{Approved?}
Decision -->|YES| LeadsToLease
LeadsToLease -->|creates| Tenant
Location -->|usedBy| Tenant
Tenant -->|hasOne| CurrentResidences
LeadsToLease -->|generates| Payments
```
#### ๐ Notes:
> - Applications are created by a Manager and evaluated for approval.
> - Upon approval, they lead to a lease, which creates a Tenant and triggers a Payment.
> - A Property is linked to a single Location but can have multiple Leases.
> - A Tenant is associated with a CurrentResidence (likely a view or latest Lease).
## ๐ Folder Structure
```bash
fullstack-FindMyLease/
โโโ client/ # Next.js frontend (Amplify)
โ โโโ .env # Frontend env vars
โ โโโ .npmrc # React 19 compatibility
โโโ server/
โ โโโ service/ # Node.js backend source code
โ โโโ prisma/ # DB schema & seeds
โ โโโ .env # Server env vars
โ โโโ ecosystem.config.js # PM2 config
โโโ docs/ # Diagrams, UI mocks
```
## ๐งช Local Development Setup
### 1. Clone the Repository
```bash
git clone https://github.com/aanujkhurana/fullstack-FindMyLease.git
cd fullstack-FindMyLease
```
### 2. Configure Environment Variables
#### `client/.env`
```env
NEXT_PUBLIC_API_BASE_URL=http://localhost:3001
NEXT_PUBLIC_AWS_COGNITO_USER_POOL_ID=
NEXT_PUBLIC_AWS_COGNITO_USER_POOL_CLIENT_ID=
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=
```
#### `server/.env`
```env
DATABASE_URL="postgresql://postgres:0000@localhost:5432/findmylease?schema=public"
S3_BUCKET_NAME="findmylease-s3-image"
PORT=3002
```
### 3. Install Dependencies
```bash
cd client && npm install
cd ../server && npm install
```
### 4. Prisma Setup (server)
```bash
npx prisma migrate reset
npm run prisma:generate
npx prisma migrate dev --name init
npm run seed
```
### 5. Start Backend
```bash
pm2 start ecosystem.config.js
# or
npm run dev
```
> Server runs on port `3002`.
### 6. Start Frontend
In a new terminal:
```bash
cd client
npm run dev
```
> App runs at [http://localhost:3001](http://localhost:3001)
## ๐ค Contribution Guide
To contribute:
1. Fork and clone the repository
2. Create a new branch
3. Make your changes
4. Submit a pull request
## ๐ License
This project is licensed under the [MIT License](./LICENSE)
---
> Built with โ๏ธ cloud power and โค๏ธ.