selfire1 / todoist-focus-mode

Flowist is a Focus Mode companion for Todoist
https://flowist.joschua.io
33 stars 3 forks source link

Add contributing/building instructions #16

Closed ronilaukkarinen closed 3 days ago

ronilaukkarinen commented 3 days ago

I could help with tasks like #14, but I'm not very familiar with Netlify. Can you write up to README.md on how to contribute and develop, how to set up a local environment?

What I gathered we need .env (could use an .env.example for this):

TODOIST_OAUTH_CLIENT_ID=
TODOIST_OAUTH_CLIENT_SECRET=
URL=http://localhost:8888

And the README.md addition would be something like this:

Development

To contribute to Flowist, follow these steps:

  1. Set up a Todoist app:

    • Go to Todoist Developer Console and create a new app.
    • Note down your TODOIST_OAUTH_CLIENT_ID and TODOIST_OAUTH_CLIENT_SECRET.
  2. Environment variables:

    • Create a .env file in the root of your project.
    • Add the following lines, replacing the placeholders with your actual credentials:

      TODOIST_OAUTH_CLIENT_ID=
      TODOIST_OAUTH_CLIENT_SECRET=
      URL=http://localhost:8888
  3. Install Netlify CLI:

    • Ensure you have Node.js installed.
    • Install Netlify CLI globally by running: npm install -g netlify-cli.
  4. Run locally:

    • Use the Netlify CLI to serve your project locally: netlify dev.
    • This will start a local server and you can access your app at http://localhost:8888.

Is this correct? With these I get Cannot GET /.netlify/functions/auth-before when trying to authenticate. Am I missing a step?

selfire1 commented 3 days ago

Hi! Thank you so much for being willing to contribute.

The source code in this repository was actually outdated. Sorry about you spending your efforts on it! I've updated the code base, and also added details to contribute as per your recommendation.

Let me know if you're able to get the local development up and running with the updated docs!

ronilaukkarinen commented 3 days ago

Thanks! After using the correct node version I get the server up and running, but it instantly crashes to white page with text:

Error
We are sorry, something went wrong.

If you think something is broken, please report it to [the Flowist issue tracker](https://github.com/selfire1/todoist-focus-mode/issues).

Message
'undefined' is not a valid GTM-ID (/^GTM-[0-9A-Z]+$/). Did you mean 'GTM-UNDEFINED'?
Clear error

Can GTM be disabled in dev?

selfire1 commented 2 days ago

Thanks for bearing with me! I pushed a commit that should remove that error.

ronilaukkarinen commented 2 days ago

Thanks for bearing with me! I pushed a commit that should remove that error.

No probs! Tested the newest master, GTM error is now gone, but I noticed the envs are these:

NUXT_OAUTH_TODOIST_CLIENT_ID=
NUXT_OAUTH_TODOIST_CLIENT_SECRET=

After adding these the auth seems to work, but I have http://localhost:3000 as OAuth redirect URL so it just redirects me back to http://localhost:3000/?code=my_code_is_here

I get the Login with Todoist button / landing page after this... is there a proper callback URL and how to let the app know I'm authed? I think this final step is missing from the README.md? Please inform on how to proceed.