Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kutt v3 is under development #754

Open
poeti8 opened this issue Jul 31, 2024 · 24 comments
Open

Kutt v3 is under development #754

poeti8 opened this issue Jul 31, 2024 · 24 comments

Comments

@poeti8
Copy link
Member

poeti8 commented Jul 31, 2024

Yes, the day has come.

I decided to devote my time to this project again. I'm humbled by all the stars, the count of forks, the amount of users, and bittersweetly, by the number of issues, and I want to make sure it's as easy and simple to use as it could be for everyone.

Yesterday, I read about goo.gl and how they are killing all its links. So I understand how important it is for users to own their own links, and I made a reliable and easy self-hosted Kutt as my main goal for the next version.

Here are the key things I've planned for the version 3:

  • Seamless installation.
    • Install with minimal knowledge required.
    • See where people struggled the most and solve them.
  • Assume the barest functionality.
    • Use sqlite by default, and only use Postgres if a user wants to.
    • Only use redis, emails, and other features if a user enables them explicitly.
    • Minimize dependencies as much as possible.
  • Better logs and error messages.
  • Focus on private instances.
  • Remove anything Google.
  • Replace Next.js. There's no way I'll upgrade to Next.js 14 since I dislike it so much. I plan to move away from React too. Nothing's wrong with React, I just think something more lightweight would suit this project. I like to try htmx.
  • Add an admin page to manage links and users.
  • Improve performance. This one is for the Kutt.it instance itself to make sure it can handle millions of links with no sweats.
  • Enable signup on kutt.it again (after I found a way to prevent spam.)
  • Write new guides and improve documentation. Make video walkthroughs.
  • And finally, go through open issues, and fix those that I think have high priority.

There are much more to add. I'll hopefully work on them once I've completed the important ones listed above. If you think I'm missing something, let me know.

This is not short and quick, and it would probably make some time to finish. You can follow the progress on the v3 branch.

@poeti8 poeti8 pinned this issue Jul 31, 2024
@trgwii
Copy link
Member

trgwii commented Aug 8, 2024

Make the bullet points a checklist!

better-sqlite3 is the best pure SQLite npm library for node, BUT node recently added builtin SQLite: https://nodejs.org/api/sqlite.html
Maybe we could use that and eventually work towards runtime agnosticism

@poeti8
Copy link
Member Author

poeti8 commented Aug 9, 2024

Make the bullet points a checklist!

I've made a Kanban board and put everything I could think of.

better-sqlite3 is the best pure SQLite npm library for node, BUT node recently added builtin SQLite: https://nodejs.org/api/sqlite.html Maybe we could use that and eventually work towards runtime agnosticism

Nice! I'll try it out.

@sqkkyzx
Copy link

sqkkyzx commented Aug 14, 2024

I am pleasantly surprised! This is awesome! I have been using Kutt for a long time, and I am very satisfied with everything that exists. I hope that V3 won't break the existing data or that there will be a recommended data migration guide.

If possible, I would love to see the UI incorporate i18n!

@trgwii
Copy link
Member

trgwii commented Aug 14, 2024

Data migration should be fully supported

@muelsyse-az
Copy link

Yeahhhhh we're so back with this one!

@chrislawso
Copy link

IMO the project is already very well polished and you have done great work. Installation with docker is super simple already and getting the .env setup is also already simple.

The only minor pain points I see are:
lack of admin user management which you already identified as: "Add an admin page to manage links and users."
links do not show who was author/creator of url
author/creator cant control whether other users may edit or delete url
urls dont have any associated text field for notes to provide extra info on url purpose/usage
lack of csv output, or import/export function to quickly get all data out of instance.

Thank you

@kenarsuleyman
Copy link

kenarsuleyman commented Sep 6, 2024

We can not thank enough for the effort you put into this. Do you plan to write MySQL wrappers for Postgres-only functions to support them both? For example MySQL also supports UUID fields, you can generate them inside JS instead of using postgres internal UUID function. Wish I know JS, I'd be so happy to contribute into this project.

@poeti8
Copy link
Member Author

poeti8 commented Sep 11, 2024

@kenarsuleyman It should be easy to add support for MySQL as well. I'll make sure to include it in the v3 release.

@poeti8
Copy link
Member Author

poeti8 commented Oct 8, 2024

Support for SQLite and MySQL has been added to version 3 now. You can test them in the version 3 branch and see if everything works fine for you.

cc @kenarsuleyman

@sqkkyzx
Copy link

sqkkyzx commented Oct 8, 2024

I am pleasantly surprised! This is awesome! I have been using Kutt for a long time, and I am very satisfied with everything that exists. I hope that V3 won't break the existing data or that there will be a recommended data migration guide.

If possible, I would love to see the UI incorporate i18n!

I noticed that if you're not planning to use React and switch to htmx, it seems that adding i18n is not as easy? But that's okay, once v3 stabilizes and you release the official version, I'll try to fork and localize it locally.

@nocturn9x
Copy link

The admin page is really important. Managing links gets complicated and I sometimes get abuse reports of my instance being used for phishing. Glad to see progress is being made

@poeti8
Copy link
Member Author

poeti8 commented Oct 9, 2024

I noticed that if you're not planning to use React and switch to htmx, it seems that adding i18n is not as easy? But that's okay, once v3 stabilizes and you release the official version, I'll try to fork and localize it locally.

It should be even easier. It will be handled on the server side.

@ThomasBaruzier
Copy link

The v3 branch looks very good!
I haven't looked deep into it yet, is it ready for personal use in your opinion?

@poeti8
Copy link
Member Author

poeti8 commented Nov 7, 2024

@ThomasBaruzier Thanks! I'm already using it in production for Kutt. Although, it's not always up to date with the latest commit. You can use it for personal use, but beware that some bugs might have crawled up here and there.

@ThomasBaruzier
Copy link

@poeti8 How do we build v3?
There is no build script in package.json

@poeti8
Copy link
Member Author

poeti8 commented Nov 7, 2024

@ThomasBaruzier There is no build step anymore! Just start the app.

@ThomasBaruzier
Copy link

@poeti8 Thanks!
I see that you cannot create an account without having a mail server up and running.
With the previous version, I got it to work by creating verification codes in the DB. Here, I cannot go beyond the original login screen, so I can't execute this trick. Is there any way to create an account directly in the SQLite database or to bypass the requirement for a mail server?

@poeti8
Copy link
Member Author

poeti8 commented Nov 8, 2024

@ThomasBaruzier I have a plan to create an admin account when you start Kutt for the first time so there would be no need to manually set anything. However, it's not implemented yet. So what you can for now is to enable the mail functionality temporarily and perform the old trick.

@ThomasBaruzier
Copy link

@poeti8 Thank you for the answer. Unfortuantely, I cannot perform the old trick, as this new version does not let me input a code:

IMG_20241108_122707

npm run dev

> kutt@2.7.4 dev
> npm run migrate && node --watch-path=./server server/server.js


> kutt@2.7.4 migrate
> knex migrate:latest

Already up to date
> Ready on http://localhost:3002
Error: connect ECONNREFUSED ::1:6293
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
  errno: -111,
  code: 'ESOCKET',
  syscall: 'connect',
  address: '::1',
  port: 6293,
  command: 'CONN'
}

@poeti8
Copy link
Member Author

poeti8 commented Nov 8, 2024

@ThomasBaruzier The error is for the email, so the user should already be created in the database and you can verified it from there.

@chrislawso
Copy link

chrislawso commented Nov 10, 2024

@ThomasBaruzier There is no build step anymore! Just start the app.

To try v3 are the manual setup instructions accurate with only changing to clone or download v3 code, not previous? Are the requirements continuing to be same? "You need to have Node.js, PostgreSQL and Redis installed." https://github.com/thedevs-network/kutt?tab=readme-ov-file#manual

I also see there is a dockerfile at https://github.com/thedevs-network/kutt/blob/v3/Dockerfile so I tried building the docker images and hit an error with the v3 branch. Is there something else that needs to be performed to do a docker build process?

=> => transferring context: 1.19MB                                                    0.1s
 => [2/8] RUN apk add --update bash                                                    6.3s
 => [3/8] WORKDIR /usr/src/app                                                         5.1s 
 => [4/8] COPY package*.json ./                                                        5.1s
 => [5/8] RUN npm install                                                             31.7s
 => [6/8] COPY . .                                                                     0.6s
 => [7/8] RUN chmod +x ./wait-for-it.sh                                                6.7s
 => ERROR [8/8] RUN npm run build                                                      4.9s
------
 > [8/8] RUN npm run build:
0.844 npm error Missing script: "build"
0.844 npm error
0.844 npm error To see a list of scripts, run:
0.844 npm error   npm run
0.847 
0.847 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-11-10T05_18_21_841Z-debug-0.log
------
Dockerfile:19
--------------------
  17 |     
  18 |     # Build files
  19 | >>> RUN npm run build
  20 |     
  21 |     EXPOSE 3000
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

@poeti8
Copy link
Member Author

poeti8 commented Nov 11, 2024

@chrislawso The documentation and the docker image are still reflecting the version two, I'll update them after I'm done with the code for the version 3. No the requirements are not the same, you'd only need Node.js, the other ones are optional.

@Fireant456
Copy link

Are the data structures for the database going to remain backwards compatible with v2 databases? At the very least include migrations to upgrade to v3?

@poeti8
Copy link
Member Author

poeti8 commented Nov 13, 2024

@Fireant456 Yes of course, there are migrations scripts that should make the transition smooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants