An intelligent web application that helps you maximize your time off by strategically planning annual leave around public holidays. Using AI, it generates optimized leave schedules tailored to your location and preferences.
- π Support for multiple countries and regions
- π€ AI-powered leave optimization
- π Strategic holiday planning
- ποΈ Vacation activity suggestions
- β‘ Fast response with caching
- π± Mobile-friendly interface
Visit https://timeoffai.com/ to try the application.
- Node.js (v18 or higher)
- npm (Node Package Manager)
- A Perplexity AI API key (Get one here)
- Clone the repository:
git clone https://github.com/Zeb88/timeoff.git
cd timeoff
- Install dependencies:
npm install
- Create a
.env
file in the root directory:
PERPLEXITY_API_KEY=your_api_key_here
- Start the server:
node server.js
- Access the application at
http://localhost:3000
# Using docker-compose (recommended)
docker-compose up -d
# Or using Docker directly
docker build -t timeoff .
docker run -p 3000:3000 -e PERPLEXITY_API_KEY=your_api_key_here timeoff
POST /optimize-leave
Content-Type: application/json
{
"country": "Australia",
"state": "New South Wales",
"year": 2024
}
Returns a markdown-formatted string containing:
- Summary of the optimization strategy
- Detailed breakdown of leave periods
- Public holiday information
- Activity recommendations
The application can be configured through environment variables:
Variable | Default | Description |
---|---|---|
PORT | 3000 | Server port |
PERPLEXITY_API_KEY | required | Your Perplexity AI API key |
RATE_LIMIT_WINDOW | 3600000 | Rate limit window in ms |
RATE_LIMIT_MAX | 1000 | Max requests per window |
CACHE_TTL | 2629800000 | Cache duration in ms |
See .env.example
for a template of all available configuration options.
- Copy
.env.example
to.env
:
cp .env.example .env
- Edit
.env
and add your Perplexity AI API key:
PERPLEXITY_API_KEY=your_api_key_here
- Start the application using either Docker or Node.js as described in the installation sections above.
- Frontend: HTML, Alpine.js, Tailwind CSS
- Backend: Node.js, Express
- AI: Perplexity AI API
- Caching: node-persist
- Rate Limiting: express-rate-limit
βββ public/
β βββ index.html
β βββ script.js
β βββ styles.css
βββ server.js
βββ package.json
βββ README.md
npm test
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Rate limiting prevents API abuse
- Environment variables protect sensitive data
- Regular dependency updates
- Input validation and sanitization
- Response caching improves speed
- Optimized AI prompt generation
- Efficient state management
- Minimal dependencies
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
This project is licensed under the MIT License - see the LICENSE file for details.