Photo by Renáta-Adrienn / Unsplash

[Suspended] Project DREAMER - Never stop dreaming

Projects May 23, 2022

Project DREAMER is a todo list + time planner + calendar viewer. Dreamer should be fully dockerized and self-hostable, provide a web interface as well as mobile applications, and incorporate complete automated testing and CI/CD. While the project is still just in my brain, it should be my first large-scale project since I started programming.

I decided to build this service because of the death of my previous project - Lazy1922. Although Lazy1922 was definitely not a difficult project, I wasted to much time during the proccess and its debut ended up too late.

I've always wanted an easy time planner that provided drag-and-drop functionality so that I could easily plan my day, however, nothing came close to what I imagined. So here I decided to just build one as my next side project.

The name Dreamer comes from myself. Dreamers are fools that don't care about reality. Dreamers are selfish and only perceive their own goals. Dreamers are failures that do not realize that they are. However, dreamers continue to do what they want to do, from today, to tomorrow, to the day after.

Yes, I'm a failure, whose APP was rendered useless after merely 5 days. Nonetheless, I would do what I like, cause who cares!

Repository

GitHub - Enquestor/dreamer
Contribute to Enquestor/dreamer development by creating an account on GitHub.

Planned Features

  • Todo List
  • Drag-and-Drop Time Planning

Stacks

  • Flutter - iOS, Android, and Desktop Apps.
  • Hasura + Postgres - API, Database.
  • Node.js + Express - Authentication Server.

Tasks

  • App routing/login.
  • Database modeling.
  • Set up auto-deploy to test and production environments.
  • Make README.md, with badges showing test, build status, and version number.

Finished

  • Set up Jest + Supertest for testing, with database mocks working.
  • Containerizing Node.js and running tests on image build, while also having environment variables sorted out.
  • GitHub repo and actions that can build on master branch commits.

Project Log

2022.6.13

A week later, and we now have some significant progress :)

First, node and Hasura are both containerized and can be started easily with an .env file and docker-compose. Next, we have finished writing Jest tests for the auth server (database calling repository still has to be tested in the future). Then, we have set up automatic Hasura migrations. All migrations will be automatically applied on container startup. Finally, GitHub Actions are set up to automatically run tests and build + push docker containers. SUBARASHI!

Anyway, I also thought about doing README and adding build/test badges first, but I thought that doing it with auto-deploy would be better. However, I would have to get a test environment first, so I guess I'll stop here and move on to some other errands.

2022.6.6

Finally produced some working code today.

Authentication Node.js + Express server is complete, currently creates JWTs that can authenticate for user role on Hasura, hosted in a separate docker container.

Would start pushing to GitHub after project is better cleaned up, which would most likely happen tomorrow or the day after.

2022.6.2

Another update for infrastructure decisions.

So after carefully reading Hasura docs, I understood that Hasura simply acts as a proxy in most cases, and all I need is an auth server which could provide the right headers by request.

Authentication using JWT | Hasura GraphQL Docs
Use authenticaton with JWT in Hasura

Also, the next-auth email provider doesn't seem to use email + password login, but uses email + magic link (click link in email to login).

And finally, I think it's kinda not that hard to simply write a Node.js server that can generate and renew JWTs, so I guess I'll just do that.

My ultimate concern is that if using the same Hasura + Postgres instance for saving auth information is secure or not. Since I need to validate (Authenticate) user email/password credentials, I would have to do a Node.js -> Hasura connection if so.

2022.6.1

So after some thought, I decided to still use Next.js with next-auth as backend.

The reasons are that even if I do in-house authentication with Hasura actions, I still need a HTTP endpoint that acts like a resolver, so either way a backend server is needed. Also next-auth seems to provide a REST API to access commonly used stuff. Lastly, I could use the Next.js as a Home/Privacy Policy page host.

So the next step, I should start building a docker-compose.yml with Hasura and next.js, and then start building the

2022.5.23

Thinking about not doing web frontend. One reason is that I'm not that "fluent" in web development, but the main reason is that next-auth does not suit well with mobile app development.

Still contemplating about how I would do authentication. Here are my options:

  1. Use an SaaS and call it a day.
  2. Use another self-hostable auth provider.
  3. Still use next-auth or passport.js.
  4. In-house authentication, not so safe tho.

Actually leaning towards doing it in-house. Option 1 is ruled out if I want the whole thing to be fully self-hostable, option 2 seems overkill for self-hosting, and option 3 just seems dumb if I decide not to web version.

We'll see what I do later on.

Tags