untitled-4063
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://rohitr21--957905803eea11f0bdac76b3cceeab13.web.val.run
A comprehensive digital gym management solution built with modern web technologies to replace paper-based receipt systems and manual communication processes.
This system addresses key challenges in gym management:
- Digital Receipt Management: Eliminates paper receipts with secure digital storage
- Automated Notifications: Streamlines communication between gym owners and members
- Comprehensive Member Management: Complete CRUD operations for member data
- Payment Tracking: Automated billing and fee management
- Future-Ready: Expandable for supplement stores, nutrition advice, and personal training
- Frontend: React 18.2.0 with TypeScript
- Backend: Hono.js API framework
- Database: Firebase Firestore
- Authentication: Firebase Auth
- Styling: TailwindCSS
- Hosting: Val Town Platform
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Admin Panel │ │ Member Portal │ │ User Portal │
│ │ │ │ │ │
│ • Member CRUD │ │ • View Bills │ │ • View Details │
│ • Billing │ │ • Notifications │ │ • Search Records│
│ • Notifications │ │ • Profile Mgmt │ │ • Public Info │
│ • Reports │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
│
┌─────────────────┐
│ Hono API │
│ │
│ • Authentication│
│ • CRUD Ops │
│ • Billing Logic │
│ • Notifications │
└─────────────────┘
│
┌─────────────────┐
│ Firebase │
│ │
│ • Firestore DB │
│ • Authentication│
│ • Cloud Storage │
└─────────────────┘
- ✅ Secure login system
- ✅ Add/Update/Delete members
- ✅ Create and manage bills
- ✅ Assign fee packages
- ✅ Monthly notification system
- ✅ Export reports
- ✅ Supplement store management
- ✅ Diet details management
- ✅ Member login portal
- ✅ View digital bill receipts
- ✅ Receive bill notifications
- ✅ Profile management
- ✅ Public login
- ✅ View gym details
- ✅ Search member records (authorized)
├── backend/
│ ├── database/
│ │ ├── firebase.ts # Firebase configuration
│ │ ├── models.ts # Data models and types
│ │ └── queries.ts # Database query functions
│ ├── routes/
│ │ ├── admin.ts # Admin routes
│ │ ├── members.ts # Member routes
│ │ ├── auth.ts # Authentication routes
│ │ └── static.ts # Static file serving
│ ├── middleware/
│ │ ├── auth.ts # Authentication middleware
│ │ └── logging.ts # Request logging
│ ├── utils/
│ │ ├── logger.ts # Logging utility
│ │ └── validation.ts # Input validation
│ └── index.ts # Main API entry point
├── frontend/
│ ├── components/
│ │ ├── admin/ # Admin components
│ │ ├── member/ # Member components
│ │ ├── common/ # Shared components
│ │ └── App.tsx # Main app component
│ ├── pages/
│ │ ├── AdminDashboard.tsx
│ │ ├── MemberDashboard.tsx
│ │ └── Login.tsx
│ ├── services/
│ │ ├── api.ts # API service layer
│ │ └── firebase.ts # Firebase client config
│ ├── utils/
│ │ └── helpers.ts # Utility functions
│ ├── index.html # Main HTML template
│ ├── index.tsx # Frontend entry point
│ └── style.css # Custom styles
├── shared/
│ ├── types.ts # Shared TypeScript types
│ └── constants.ts # Shared constants
└── tests/
├── unit/ # Unit tests
├── integration/ # Integration tests
└── e2e/ # End-to-end tests
- Val Town account
- Firebase project setup
- Environment variables configured
FIREBASE_API_KEY=your_api_key FIREBASE_AUTH_DOMAIN=your_auth_domain FIREBASE_PROJECT_ID=your_project_id FIREBASE_STORAGE_BUCKET=your_storage_bucket FIREBASE_MESSAGING_SENDER_ID=your_sender_id FIREBASE_APP_ID=your_app_id
-
Clone/Fork this Val Town project
-
Configure Firebase:
- Create a new Firebase project
- Enable Firestore Database
- Enable Authentication (Email/Password)
- Add environment variables to Val Town
-
Deploy:
- The project auto-deploys on Val Town
- Access via the provided HTTP endpoint
- ✅ Valid login credentials
- ✅ Invalid login attempts
- ✅ Session management
- ✅ Role-based access control
- ✅ Add new member with valid data
- ✅ Update existing member information
- ✅ Delete member and cascade operations
- ✅ Search and filter members
- ✅ Create bills with different fee packages
- ✅ Payment processing and receipt generation
- ✅ Notification delivery
- ✅ Report generation
- ✅ Input validation
- ✅ Database constraints
- ✅ Error handling
- ✅ Data backup and recovery
# Unit tests npm test # Integration tests npm run test:integration # E2E tests npm run test:e2e
- Lazy Loading: Components loaded on demand
- Memoization: React.memo for expensive components
- Debouncing: Search and input operations
- Bundle Splitting: Separate chunks for admin/member/user modules
- Serverless: Val Town's serverless architecture for auto-scaling
- CDN: Static assets served via CDN
- Database Indexing: Optimized Firestore queries
- Caching: Client-side caching for frequently accessed data
- Compound Queries: Efficient Firestore query patterns
- Pagination: Large datasets handled with pagination
- Real-time Updates: Firestore listeners for live data
- Offline Support: PWA capabilities for offline access
- Authentication: Firebase Auth with secure token management
- Authorization: Role-based access control (Admin/Member/User)
- Input Validation: Server-side validation for all inputs
- Data Encryption: Firebase handles encryption at rest and in transit
- Audit Logging: Comprehensive logging for all operations
- Request Logging: All API requests logged with timestamps
- Error Logging: Detailed error tracking with stack traces
- User Actions: Audit trail for all user operations
- Performance Metrics: Response times and resource usage
ERROR
: System errors and exceptionsWARN
: Warning conditionsINFO
: General informationDEBUG
: Detailed debugging information
-
Supplement Store Module
- Product catalog management
- Inventory tracking
- Online ordering system
-
Nutrition Module
- Diet plan creation
- Calorie tracking
- Nutritionist consultations
-
Personal Training Module
- Trainer scheduling
- Workout plan management
- Progress tracking
-
Mobile App
- React Native mobile application
- Push notifications
- Offline capabilities
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation wiki
Built with ❤️ using Val Town Platform