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.
Viewing readonly version of main branch: v5View latest version
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