Skip to content

benwilson34/lyfe-schedule

Repository files navigation

LyfeSchedule

the todo app for people that get things done eventually™

Screenshots

Key Features

📆 Task Scheduling: Easily schedule tasks for today, tomorrow, or a year from now.

🔜 Date Ranges: Many day-to-day tasks don't have a single, strict "due date" - give a task a date range and its priority will scale accordingly.

🔁 Repeating Tasks: Set up tasks to repeat every day, week, month, year, or somewhere in between.

⏱️ Time Estimates: Estimate how long your tasks will take so you can plan around them.

Be sure to read the user-facing documentation for more info.

This app can be run locally on any machine that supports Node and MongoDB, or it can be deployed remotely "on the cloud". If you just want to try it out, there is an invite-only instance running for beta testing purposes. Send us an email to request access.

Tech Stack

This is a Next.js project bootstrapped with create-next-app.

  • TypeScript (statically-typed JavaScript)
  • React (front-end framework)
  • Tailwind CSS (style framework)
  • Node.js and Express.js (web & dev server framework)
  • MongoDB (data store)
  • Webpack (build and bundling tools)
  • Nodemailer, MJML, and Handlebars (email templating & sending)
  • NextAuth.js (user authentication)
  • Jest (automated testing)

Run the App

Installation

You'll need the following dependencies:

  1. Node.js v20.18.0 or greater.
  2. npm, yarn, or pnpm.
  3. MongoDB connection string - either a local installation, or a remote instance, like on MongoDB Atlas for example.
    1. Create a database, recommended name LyfeSchedule_beta and initial collection user. Keep the defaults for all other options.
  4. A SMTP email service.
    1. For a local instance or for testing, consider using a dummy SMTP server like smtp4dev or maildev.
  5. A clone of this repo.

Finally, install Node dependencies:

# from inside the project directory
npm install
# or
yarn install
# or
pnpm install

Environment

See the .env.example for info on required and optional environment variables. Either create a .env.local file at the project root or define the variables another way.

TODO more info on configuration options here, like IS_REGISTRATION_INVITE_ONLY?

Run the (production) server

Build and run the server:

npm run build && npm start
# or yarn or pnpm

Open http://localhost:3000 with your browser to see the result.

Create initial user account(s)

In order to set up the initial user, it's recommended to insert a dummy user and follow the password reset flow.

  1. Using the MongoDB CLI or Compass, create the user collection if it doesn't exist. Then insert a record/document in the user collection like { "email": "<your-email>" }; for example, { "email": "me@website.com" }.
  2. Get the ObjectID for that record/document and copy it into the ADMIN_USER_ID env var.
  3. Restart the server.
  4. Visit /auth/request-reset-password, type in your email from Step 1, and click "Send password reset email". Follow the instructions from the password reset email you receive.
  5. Sign in with your email and newly set password.
  6. If there are other users you want to invite, you can do so through the /auth/send-invitation page. They will get an invite email with further instructions on how to register.

Here's an alternate, more UI-centric approach:

  1. Set the IS_REGISTRATION_INVITE_ONLY env var to false.
  2. Restart the server.
  3. Visit /auth/register and create as many users as needed.
  4. [Recommended] Set the IS_REGISTRATION_INVITE_ONLY env var back to true to prevent further registrations. Only skip this step if you know what you're doing.
  5. [Optional] Using the MongoDB CLI or Compass, check the user collection and get the ObjectID for the admin user (probably you). Copy this ID into the ADMIN_USER_ID env var.
  6. If any env vars were changed, restart the server.

Development

TODO contribution guide

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Installation and Environment

See the Installation and Environment sections above.

Run the dev server

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result. Pages will auto-update as you edit and save the files.

Demo build

It is also possible to make a "demo build" where all the data storage is handled in the client via window.localStorage. This build is meant to serve as a low-cost, low-risk demonstration for how the app works. Mongo is not needed for this build and the API endpoints and auth flows are stripped out. This is driven by the IS_DEMO_MODE env var, but it's easiest to use the provided demo-specific npm scripts:

  1. You can run the demo dev server with npm run dev:demo.
  2. You can build the demo app with npm run build:demo, which can then be started with npm start.

TODO blog post?

Testing

This project uses Jest for automated testing. Run the tests:

npm test
# or
npm run test:watch
# or yarn or pnpm

Create initial user account(s)

See the Create initial user account(s) section above.

Suggested tools

  • VS Code (TODO extensions?)
  • ESLint
  • MongoDB Compass
  • Postman

Feedback

Please let us know if you find a bug or have thoughts on what could be improved by sending an email to feedback@lyfeschedule.com.

License

TODO, I haven't decided yet 😉

About

the todo app for people who get things done eventually™

Resources

Stars

Watchers

Forks

Releases

No releases published