Skip to content

Task zen is an open source html css and nodejs task manager that anyone can use with the gplv3 license

License

Notifications You must be signed in to change notification settings

Aarondoran/Task-zen

Repository files navigation

Task-zen 🧘

A modern web application for managing tasks and assignments with email reminders, built with Express.js, PostgreSQL, and Auth0 authentication.

🌟 Features

  • User Authentication: Secure login with Auth0
  • Task Management: Create, view, and delete assignments
  • Due Date Tracking: Visual indicators for tasks due today or overdue
  • Email Reminders: Automated email notifications for tasks due today
  • Responsive Design: Works seamlessly on desktop and mobile devices

πŸ“‹ Prerequisites

Before you begin, ensure you have the following:

  • Node.js (v14 or higher)
  • PostgreSQL database
  • Auth0 account (free tier available)

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/Aarondoran/Task-zen.git
cd Task-zen

2. Install Dependencies

npm install

3. Set Up Environment Variables

Copy the .env.example file to .env and fill in your credentials:

cp .env.example .env

Then edit .env with your actual values:

Database Setup

  • DATABASE_URL: Your PostgreSQL connection string

Auth0 Setup

  1. Create a free account at Auth0
  2. Create a new application (choose "Regular Web Application")
  3. In your Auth0 application settings, find:
    • AUTH0_CLIENT_ID: Your Application's Client ID
    • AUTH0_ISSUER: Your Auth0 domain (e.g., https://your-tenant.auth0.com)
    • AUTH0_SECRET: Generate a random 32+ character string
      node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
  4. Configure Auth0 Callback URLs:
    • Allowed Callback URLs: http://localhost:3000/callback (add your production URL too)
    • Allowed Logout URLs: http://localhost:3000 (add your production URL too)
    • Allowed Web Origins: http://localhost:3000 (add your production URL too)

Application Configuration

  • BASE_URL: Your application's URL
    • Local: http://localhost:3000
    • Production: https://your-domain.com
  • PORT: The port to run the server on (default: 3000)
  • API_SECRET: A secret key for securing machine-to-machine API endpoints

4. Set Up the Database

The easiest way to set up the database is to use the included SQL script:

# If you have psql installed locally
psql your_database_url -f setup-database.sql

# Or copy the contents of setup-database.sql and run it in your database management tool

Alternatively, you can manually create the required table by running the following SQL:

CREATE TABLE assignments (
  id SERIAL PRIMARY KEY,
  user_id VARCHAR(255) NOT NULL,
  email VARCHAR(255) NOT NULL,
  title VARCHAR(255) NOT NULL,
  text TEXT NOT NULL,
  date_due DATE NOT NULL,
  date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  reminder_sent BOOLEAN DEFAULT FALSE
);

-- Create an index for faster queries
CREATE INDEX idx_user_id ON assignments(user_id);
CREATE INDEX idx_date_due ON assignments(date_due);

5. Customize Your Application (Optional)

Update Branding and Meta Tags

Edit public/index.html to customize:

  • Website title and description
  • Author information
  • Social media meta tags (Open Graph and Twitter)
  • Domain names and URLs
  • Logo and favicon

Look for comments marked with <!-- CUSTOMIZE: ... --> in the file.

Update Site Information

Edit the following files as needed:

  • public/robots.txt: Configure search engine crawling rules
  • public/sitemap.xml: Update with your actual domain and pages

6. Run the Application

npm start

The application will be available at http://localhost:3000

πŸ“ Project Structure

Task-zen/
β”œβ”€β”€ dashboard/          # Protected dashboard for logged-in users
β”‚   β”œβ”€β”€ app.js         # Dashboard JavaScript logic
β”‚   β”œβ”€β”€ index.html     # Dashboard HTML
β”‚   └── styles.css     # Dashboard styles
β”œβ”€β”€ public/            # Public landing page
β”‚   β”œβ”€β”€ assets/        # Public assets (images, CSS, JS)
β”‚   β”œβ”€β”€ index.html     # Landing page
β”‚   β”œβ”€β”€ robots.txt     # Search engine directives
β”‚   └── sitemap.xml    # Site map for SEO
β”œβ”€β”€ server.js          # Express server and API routes
β”œβ”€β”€ package.json       # Dependencies and scripts
β”œβ”€β”€ .env.example       # Environment variables template
└── README.md          # This file

πŸ”§ API Endpoints

Public Endpoints

  • GET / - Landing page
  • GET /is-auth0 - Check authentication status

Protected Endpoints (Require Login)

  • GET /dashboard - User dashboard
  • GET /user-id - Get current user's ID
  • GET /assignments - Get all assignments for logged-in user
  • POST /add-assignment - Create a new assignment
  • DELETE /delete-assignment/:id - Delete an assignment

Machine-to-Machine Endpoints

  • GET /trigger-email-reminder - Trigger email reminders for tasks due today

πŸ” Security Notes

  • Never commit your .env file to version control
  • Use strong, randomly generated secrets for AUTH0_SECRET and API_SECRET
  • Enable SSL/HTTPS in production
  • Keep your dependencies up to date: npm audit and npm update

πŸ“§ Email Reminders Setup

The /trigger-email-reminder endpoint can be called by external services (like Google Apps Script, Zapier, or cron jobs) to send email reminders for tasks due today.

Example setup with Google Apps Script:

  1. Create a new Google Apps Script project
  2. Set up a time-driven trigger to run daily
  3. Call your /trigger-email-reminder endpoint

πŸš€ Deployment

Deploy to Heroku

# Login to Heroku
heroku login

# Create a new Heroku app
heroku create your-app-name

# Add PostgreSQL addon
heroku addons:create heroku-postgresql:mini

# Set environment variables
heroku config:set AUTH0_CLIENT_ID=your_client_id
heroku config:set AUTH0_ISSUER=your_issuer
heroku config:set AUTH0_SECRET=your_secret
heroku config:set BASE_URL=https://your-app-name.herokuapp.com

# Deploy
git push heroku main

Deploy to Railway, Render, or Other Platforms

  1. Connect your GitHub repository
  2. Add a PostgreSQL database
  3. Set all environment variables from .env.example
  4. Deploy!

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

πŸ“ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

  • Landing page design by HTML5 UP
  • Authentication powered by Auth0

πŸ“ž Support

If you have any questions or need help setting up, please open an issue in the GitHub repository.


Made with ❀️ by the Task-zen team

About

Task zen is an open source html css and nodejs task manager that anyone can use with the gplv3 license

Topics

Resources

License

Contributing

Stars

Watchers

Forks