|
All checks were successful
Deploy to Firebase Hosting / deploy (push) Successful in 1m8s
Reviewed-on: #11 Reviewed-by: danshtu <mrdanilkos@gmail.com> |
||
|---|---|---|
| .forgejo | ||
| dist | ||
| src | ||
| .firebaserc | ||
| .gitignore | ||
| components.json | ||
| eslint.config.js | ||
| firebase.json | ||
| index.html | ||
| package.json | ||
| pnpm-lock.yaml | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| TODO.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
Cafe Ledger
A non-profit coffee shop expense tracker built with React, TypeScript, and Firebase.
Prerequisites
Installation
Clone the repository and install dependencies:
git clone <repo-url>
cd cafe-ledger-hosting
pnpm install
Running locally
pnpm dev
The app will be available at http://localhost:5173.
Building for production
pnpm build
Output is written to the dist/ directory. You can preview the production build locally with:
pnpm preview
Firebase setup
The project connects to a Firebase backend (Firestore + Authentication). The Firebase config is hardcoded in src/lib/firebase.ts. To use your own Firebase project:
- Go to console.firebase.google.com and create a project.
- Enable Authentication → Email/Password sign-in.
- Create a Cloud Firestore database (start in test mode).
- Go to Project Settings → General, add a Web App, and copy the
firebaseConfigobject. - Replace the config values in
src/lib/firebase.ts:
const firebaseConfig = {
apiKey: "...",
authDomain: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
appId: "...",
};
Recommended Firestore rules
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /expenses/{doc} {
allow read, write: if request.auth != null;
}
}
}
Deploying to Firebase Hosting
Automatic Deployment (CI/CD)
This repository is configured with Forgejo Actions to automatically deploy to Firebase Hosting when changes are merged to the master branch.
Setup: See .forgejo/SETUP.md for instructions on configuring the Firebase service account secret.
Workflow: The deployment happens automatically on every push to master. Monitor progress in the Actions tab.
Manual Deployment
You can also deploy manually using the Firebase CLI:
npm install -g firebase-tools
firebase login
pnpm build
firebase deploy --only hosting