FastM8 is a Progressive Web App (PWA) designed to help users track their fasting windows and eating periods. It provides real-time notifications and a simple interface to start, stop, and monitor fasts.
- Track fasting windows with a simple start/stop button.
- View fasting history and analytics.
- Receive push notifications for fasting milestones.
- Progressive Web App (PWA) functionality for offline use.
- Backend API for data storage and processing.
- React/Vue (TBD)
- Service Workers (for PWA support)
- GitHub Pages
- Node.js with Express.js
- SQLite for lightweight database storage
- Hosted on a Raspberry Pi
- Push Notification support
fastm8-frontend/ (Vue PWA)
fastm8-backend/ (Node.js API + SQLite)
- Clone the backend repository:
git clone https://github.com/mattattaq/fastm8-backend.git
- Install dependencies:
cd fastm8-backend npm install - Start the server:
npm start
- Clone the frontend repository:
git clone https://github.com/mattattaq/fastm8-frontend.git
- Install dependencies:
cd fastm8-frontend npm install - Start the development server:
npm run dev
| Method | Endpoint | Description |
|---|---|---|
| GET | /status |
Check API status |
| POST | /api/users |
Create a new user (requires username, email, password) |
| POST | /api/login |
Login user (requires email, password) |
| POST | /api/logs |
Create a new fasting log (requires userId, startTime, isComplete) |
| GET | /api/open-logs |
Get open fasting logs for a user (requires JWT token, optional startTime/endTime) |
| PUT | /api/logs/edit |
Edit multiple fasting logs (requires logIds and edits array) |
| DELETE | /api/logs |
Delete open fasting logs for a user (requires userId query parameter) |
All endpoints except /status and /api/users require a JWT token in the Authorization header:
Authorization: Bearer <token>
For endpoints accepting dates, use either:
- Full ISO format:
YYYY-MM-DDTHH:mm:ss.sssZ(e.g., "2025-02-01T01:00:00.000Z") - Date-only format:
YYYY-MM-DD(e.g., "2025-02-01")
- Deploy backend to Raspberry Pi.
- Add push notification support.
- Add Users
- Store user fasting history.
- Add Postman to repo
- OPTIONAL Add tokenization or solution to not send raw passwords in request. Maybe JWT token, I haven't decided yet.
- Add proper database connection handling and cleanup
- Implement connection pooling
- Add database indexes for frequently queried columns
- Add proper database migrations system
- Implement centralized error handling middleware
- Create custom error classes
- Add proper logging using Winston or similar
- Add more specific error messages
- Split routes into separate files (auth.js, logs.js)
- Move database queries to service layer
- Create middleware for common operations
- Add TypeScript for better type safety
- Add rate limiting
- Implement input sanitization
- Configure specific CORS settings
- Add helmet.js for security headers
- Add refresh token mechanism
- Implement token blacklisting for logout
- Add password reset functionality
- Add caching for frequently accessed data
- Optimize database queries
- Add compound indexes where needed
- Add unit tests
- Add integration tests
- Add API tests
- Add API documentation using Swagger/OpenAPI
- Move configuration to dedicated config file
- Add development/production configurations
- Add environment variable validation
If you'd like to contribute, feel free to open an issue or submit a pull request!
MIT License