Laporan progress tugas besar cloning Facebook dapat diakses melalui tautan berikut:
Laporan Progress Tugas Besar Cloning Facebook
PPWL Clone Facebook merupakan aplikasi media sosial berbasis web yang dibuat sebagai proyek cloning Facebook. Aplikasi ini menyediakan pengalaman dasar seperti autentikasi, beranda feed, pembuatan postingan, upload gambar, like, komentar, notifikasi, serta pengelolaan profil pengguna.
Proyek ini menggunakan struktur monorepo agar frontend, backend, dan tipe data bersama dapat dikelola dalam satu repositori. Frontend dibangun dengan React dan Vite, backend menggunakan Elysia di atas Bun, sedangkan akses database menggunakan Prisma dengan adapter libSQL/Turso. Aplikasi juga sudah disiapkan untuk deployment frontend ke AWS S3 + CloudFront dan backend ke AWS Lambda Function URL.
- Login dan registrasi akun manual
- Login menggunakan OAuth Google
- Proteksi route untuk halaman privat
- Beranda dengan tampilan menyerupai Facebook
- Feed postingan dari database
- Membuat postingan baru
- Upload gambar pada postingan
- Edit dan hapus postingan milik sendiri
- Like dan unlike postingan
- Detail postingan
- Tambah, edit, dan hapus komentar
- Notifikasi untuk like dan komentar
- Status notifikasi terbaca dan belum terbaca
- Dropdown notifikasi di beranda
- Edit profil pengguna
- Ubah avatar, nama, email, dan password
- Logout dari beranda
- Reset password berbasis token
- Struktur frontend yang modular
- Bun
- React 19
- Vite 8
- TypeScript
- Tailwind CSS 4
- Lucide React
- Elysia
- Prisma 7
- libSQL / Turso
- AWS S3
- AWS CloudFront
- AWS Lambda Function URL
- Docker untuk build image Lambda API
- ESLint
ppwl-clone-facebook/
│── apps/
│ ├── api/
│ │ ├── prisma/
│ │ │ ├── migrations/
│ │ │ ├── dev.db
│ │ │ ├── schema.prisma
│ │ │ └── seed-home-feed.sql
│ │ ├── src/
│ │ │ ├── db/
│ │ │ │ └── prisma.ts
│ │ │ ├── generated/
│ │ │ ├── http/
│ │ │ │ ├── auth.ts
│ │ │ │ └── errors.ts
│ │ │ ├── routes/
│ │ │ │ ├── auth/
│ │ │ │ ├── comments/
│ │ │ │ ├── notifications/
│ │ │ │ ├── posts/
│ │ │ │ ├── profile/
│ │ │ │ └── users/
│ │ │ └── index.ts
│ │ ├── Dockerfile.lambda
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── prisma.config.ts
│ └── web/
│ ├── public/
│ │ ├── picture/
│ │ └── favicon.svg
│ ├── src/
│ │ ├── components/
│ │ │ └── ui/
│ │ ├── layouts/
│ │ │ └── AppLayout.tsx
│ │ ├── lib/
│ │ │ ├── navigation.ts
│ │ │ └── utils.ts
│ │ ├── routes/
│ │ │ ├── auth/
│ │ │ ├── home/
│ │ │ │ ├── components/
│ │ │ │ ├── data/
│ │ │ │ └── HomePage.tsx
│ │ │ ├── notifications/
│ │ │ ├── posts/
│ │ │ ├── profile/
│ │ │ └── users/
│ │ ├── services/
│ │ │ └── api.ts
│ │ ├── types/
│ │ │ └── social.ts
│ │ ├── App.tsx
│ │ ├── index.css
│ │ └── main.tsx
│ ├── components.json
│ ├── eslint.config.js
│ ├── index.html
│ ├── package.json
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
│── packages/
│ └── shared/
│ ├── src/
│ │ └── index.ts
│ ├── tsconfig.json
│ └── package.json
│── .dockerignore
│── .gitignore
│── bun.lock
│── package.json
│── README.md
└── tsconfig.base.json
-
Persiapan Lingkungan: Pastikan komputer sudah terinstal Bun, Git, dan Docker jika ingin build image backend untuk Lambda.
-
Clone Repositori: Clone repositori dari GitHub.
git clone git@github.com:franzxml/ppwl-clone-facebook.git
Jika menggunakan HTTPS:
git clone https://github.com/franzxml/ppwl-clone-facebook.git
-
Masuk ke Folder Proyek:
cd ppwl-clone-facebook -
Install Dependensi:
bun install
-
Siapkan Environment Frontend: Buat file environment frontend dari contoh.
cp apps/web/.env.example apps/web/.env
Contoh nilai yang digunakan:
VITE_API_URL=http://localhost:3001
-
Siapkan Environment Backend: Buat file environment backend dari contoh.
cp apps/api/.env.example apps/api/.env
Isi konfigurasi database dan secret sesuai kebutuhan lokal. Contoh variabel yang umum digunakan:
DATABASE_URL=file:./dev.db JWT_SECRET=your-secret-key GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret
-
Generate Prisma Client:
bun run prisma:generate
-
Jalankan Migrasi Database Lokal:
bun run prisma:migrate
-
Jalankan Frontend dan Backend Bersamaan:
bun run dev
-
Akses Aplikasi Lokal: Buka browser dan kunjungi:
http://localhost:5173
Backend lokal berjalan di:
http://localhost:3001
bun run devuntuk menjalankan frontend dan backend secara bersamaan.bun run dev:webuntuk menjalankan frontend Vite.bun run dev:apiuntuk menjalankan backend Elysia dengan watch mode.bun run builduntuk build shared package, backend, dan frontend.bun run build:shareduntuk build tipe package shared.bun run build:apiuntuk build backend.bun run build:webuntuk build frontend.bun run build:web:s3untuk build frontend sebelum deployment S3.bun run typecheckuntuk menjalankan typecheck semua workspace.bun run typecheck:shareduntuk typecheck package shared.bun run typecheck:apiuntuk typecheck backend.bun run typecheck:webuntuk typecheck frontend.bun run lintuntuk menjalankan ESLint pada frontend.bun run prisma:generateuntuk generate Prisma Client.bun run prisma:migrateuntuk menjalankan migrasi database lokal.bun run docker:build:apiuntuk build Docker image backend Lambda.bun run deploy:web:s3untuk upload hasil build frontend ke AWS S3.bun run deploy:web:invalidateuntuk membuat invalidation CloudFront.
Frontend production dapat diakses melalui:
https://d3b2jcy5w87rzf.cloudfront.net/
Backend production dapat diakses melalui:
https://2gtrnedjhmootg6bu5e24kwdmq0oyuns.lambda-url.us-east-1.on.aws/
Resource AWS yang digunakan:
- Frontend CDN: AWS CloudFront
- CloudFront Distribution ID:
E3PHP2PBFP7CIC - Frontend Storage: AWS S3
- S3 Bucket:
s3-monorepo-frontend-prod-2026 - Backend Runtime: AWS Lambda
- Lambda Function:
ppwl-clone-facebook-api - Lambda Region:
us-east-1 - Lambda Function URL:
https://2gtrnedjhmootg6bu5e24kwdmq0oyuns.lambda-url.us-east-1.on.aws/
Dikembangkan oleh:
- @franzxml
- @h1101241039-cmd
- @ghinaaa09
- @arifquuu
- @isanctuarry