A modern web application for managing tasks and assignments with email reminders, built with Express.js, PostgreSQL, and Auth0 authentication.
- 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
Before you begin, ensure you have the following:
- Node.js (v14 or higher)
- PostgreSQL database
- Auth0 account (free tier available)
git clone https://github.com/Aarondoran/Task-zen.git
cd Task-zennpm installCopy the .env.example file to .env and fill in your credentials:
cp .env.example .envThen edit .env with your actual values:
- DATABASE_URL: Your PostgreSQL connection string
- Format:
postgres://username:password@host:port/database - You can use services like Heroku Postgres, Railway, Render, or Neon
- Format:
- Create a free account at Auth0
- Create a new application (choose "Regular Web Application")
- 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'))"
- 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)
- Allowed Callback URLs:
- BASE_URL: Your application's URL
- Local:
http://localhost:3000 - Production:
https://your-domain.com
- Local:
- PORT: The port to run the server on (default: 3000)
- API_SECRET: A secret key for securing machine-to-machine API endpoints
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 toolAlternatively, 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);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.
Edit the following files as needed:
public/robots.txt: Configure search engine crawling rulespublic/sitemap.xml: Update with your actual domain and pages
npm startThe application will be available at http://localhost:3000
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
GET /- Landing pageGET /is-auth0- Check authentication status
GET /dashboard- User dashboardGET /user-id- Get current user's IDGET /assignments- Get all assignments for logged-in userPOST /add-assignment- Create a new assignmentDELETE /delete-assignment/:id- Delete an assignment
GET /trigger-email-reminder- Trigger email reminders for tasks due today
- Never commit your
.envfile to version control - Use strong, randomly generated secrets for
AUTH0_SECRETandAPI_SECRET - Enable SSL/HTTPS in production
- Keep your dependencies up to date:
npm auditandnpm update
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:
- Create a new Google Apps Script project
- Set up a time-driven trigger to run daily
- Call your
/trigger-email-reminderendpoint
# 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- Connect your GitHub repository
- Add a PostgreSQL database
- Set all environment variables from
.env.example - Deploy!
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is open source and available under the MIT License.
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