management system boarding house build with react and firebase
-
frontend
- react
- tailwind (styling)
- react hook form (form management)
- zustand (state management)
- swr (data fetching)
-
backend / services
- hono
- firebase
- cloudflare r2
-
testing
- playwright
-
database
- firestore
- login as admin
- crud kos
- crud kamar
- crud penghuni
- crud petugas
- crud transaksi (soft delete)
- archive transaksi
- invoice
- dashboard
clone project
git clone --depth 1 https://github.com/nursyah21/kosinstallation dependecies
cd kos
yarn
cd api-upload
yarnprepare for firebase
- create project in firebase and activate firestore, and authentication
- get service-account.json from your firebase project and place it in root folder
- copy .env.example to .env
- set .env based on your firebase project
note: VITE_UPLOAD_* based on your backend api
note: you need to enable indexes, for collection transaksi in firebase so it can use where with order by
prepare for cloudflare
- you need an custom domain for public domain your cloud storage
- create r2 bucket and set custom domain
- copy wrangler.jsonc.example to wrangler.jsonc
- set all vars in wranglerc based on your cloudflare project
deploy backend api
in folder api-upload
yarn deployin root folder
yarn seed:user
yarn seed run in development
yarn devrun production on local
yarn build
yarn previewrun testing
yarn testfor backend you can use httpie to run test. just import httpie-collection-api-upload.json from folder api-upload to httpie
build and up
yarn prod:upstop docker
yarn prod:downsofware and hardware
- os: windows 10
- ram: 8gb
- cpu: i5 6200u
run load testing in preview mode
# make sure you run it before run test
yarn previewyarn loadtest:previewresult preview
- Running 10s test @ http://localhost:3000
- 200 connection
- latency
- avg: 206ms
- max: 436ms
- stdev: 46.8ms
- req/s
- avg: 963
- min: 761
- stdev: 135
- total 10k request in 10.25s
run load testing in production mode
# make sure you run it before run test
yarn prod:upyarn loadtest:prodresult prod
- Running 10s test @ http://localhost:3000
- 200 connection
- latency
- avg: 91ms
- max: 89.27ms
- stdev: 1819ms
- req/s
- avg: 2,196
- min: 574
- stdev: 621.85
- total 22k request in 10.59s







