An open API service indexing awesome lists of open source software.

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.

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 โค๏ธ.