Giter Site home page Giter Site logo

djshubs / opentask Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flsilva/opentask

0.0 0.0 0.0 2.2 MB

OpenTask is a fully functional and responsive PWA MVP built with Next.js 14 and the new App Router.

Home Page: https://opentask.app

License: MIT License

JavaScript 0.36% TypeScript 84.39% CSS 0.97% MDX 14.28%

opentask's Introduction

Welcome to OpenTask

To report bugs, please open an issue.

To share ideas with the community, ask questions, and new features, please start a discussion.

How to run OpenTask locally

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

It uses Supabase as the backend service, which is built on top of Postgres.

You need Node.js v20.3.1+ to run OpenTask locally.

How to set up your local machine

These instructions should be followed only once:

  1. Clone this repo.
  2. Install dependencies: npm install.
  3. Install Docker Desktop.
  4. Make a copy of .env.example file and name it .env. You won't need to change this file as it already contains the localhost database URL. You can change it if you want to set up authentication with OAuth.
  5. Make a copy of .env.local.example file and name it .env.local. You'll make a change to this file after you start Supabase (see next).

How to run the app locally

These instructions should be followed every time you want to run the app locally:

  1. Open Docker Desktop.
  2. Start Supabase: npx supabase start -x realtime,storage-api,imgproxy. That will exclude unused Supabase services to save on RAM. If you forget to open Docker Desktop you'll get an error message starting with Cannot connect to the Docker daemon.
  3. You'll get some URLs and anon key. Copy the value of anon key and past it in your .env.local file as the value of the NEXT_PUBLIC_SUPABASE_ANON_KEY variable. You only have to do this once.
  4. Run Prisma migrations: npx prisma migrate dev.
  5. Run Next.js local development server: npm run dev.
  6. Open http://localhost:3000 with your browser to use the app.

How to sign in locally

It's easier to sign in with an email on localhost, as there's no need to set up OAuth apps.

Email sign in is enabled on localhost only, there's no such option on production.

You can use a fake email like [email protected]. See how next.

  1. Visit the Sign In page, enter an email and hit continue. You should be redirected to http://localhost:3000/auth/sign-in/check-email-link.
  2. Open http://localhost:54324/monitor in a new browser tab. That's Inbucket, an email testing app running locally alongside Supabase.
  3. You should see an email with the subject Confirm Your Email. Open it, then click on the link Confirm your email address.
  4. You should be redirected to a URL that starts with http://localhost/auth/v1/verify. It used to work correctly, but after some tests it stopped adding the necessary port number to the URL. So go ahead and manually add :54321 to the URL so that it starts with http://localhost:54321/auth/v1/verify instead (keep the rest of URL as is). We should fix this issue, but for now this extra step will make it.
  5. Hit enter and you should be logged in and redirected to http://localhost:3000/app/today.
  6. You can now test the app locally. Enjoy!

That email confirmation link expires pretty quickly, so if you take a while to click it you might be redirected back to the Sign In page with the following URL:

http://localhost:3000/auth/sign-in#error=invalid_request&error_code=400&error_description=No+associated+flow+state+found.+400%253A+Flow+state+is+expired.

If that happens, just try again. If you can't sign in, please open a issue.

We should also improve the UX by adding a message telling the user that an error happened and they should try again.

How to stop running the app locally

  1. Stop Supabase: npx supabase stop. If you want to clear all database data, run this instead: npx supabase stop --no-backup.
  2. Close Docker Desktop.
  3. Stop the Next.js development server.

If you find any problems with the instructions above, please open an issue.

opentask's People

Contributors

flsilva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.