A humble recreation of the famous Logsday website. The original website was abandoned by its creator and is no longer developed. That's why this project aims to not be abandoned and be in development.
You can upload a log once a day. You can see other people's logs. You can invite your friends to post their logs. You can even like other people's logs. Furthermore, you can look at the TODO list down below and contribute some of your very own bad code!
- To run the server,
cargo runorcargo run --release- It should be available on
http://localhost:3000/
- It should be available on
Askamatemplates (#[template(path = "index.html")]) live in./templatesdirectory- Note that
Askamatemplates are not actually html files. They're.. templates. With{{ ... }}being replaced with stuff before being sent to the client.
- Note that
- The database is
./sqlite.db. Needs to be created manually. You will also have to create all tables manually (listed inSQLite Tablessection). - You have to have
niceandffmpegcmd utilities instealled.
- Server Side:
SQLiteFFmpeg
- Web:
HTMXmarked.jslive markdown previewhighlight.jshighlighting code blocks
- Rust Crates:
axumfor web server basicsaskamafor template renderingargon2for password hashingpulldown-cmarkfor markdown to html renderingsqlxfor interacting with sqlite dbinferfor scanning magic bytes of filesimagefor converting image formatswebp-animationfor specifically converting gif to webp (wrapper aroundlibwebp)scraperfor looking through html files for linked/embedded filestokio_cron_schedulerfor cron jobs from Rust, for nowtower_sessionsfor easy sessionsaxum_typed_multipartfor convenience, for nowtower_governorfor traffic control; currently unused
- Unix epoch starts on
Thu, Jan 1, 1970. For an 8-day week, Unix epoch starts onMon, Jan 1, 1970. In code, all weekdays are 0-indexed (Mon = 0, Tue = 1, etc). - You will not be able to private a project/log. You will be able to unlist it, but not private.
- A bunch of research for this project was done with Gemini.
- CommonMark spec
- Server side uses
pulldown_cmarkwith the following options enabled
- Server side uses
- Additional options
strikethrough
- Additional features
represents a multimedia embed, depending on.ext. For supported extensions, refer tofilestuff::media_type
CREATE TABLE users (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT NOT NULL UNIQUE,
displayname TEXT NOT NULL,
password TEXT NOT NULL,
week_len INTEGER NOT NULL DEFAULT 8,
logsday_weekday INTEGER NOT NULL DEFAULT 3, -- Logsday is between Wednesday and Thursday; Monday is 0; Sunday is 6/7
schedule_last_changed INTEGER NOT NULL, -- when the user changed their Logsday selection last time; unix timestamp
admin BOOLEAN NOT NULL DEFAULT FALSE,
created_on INTEGER NOT NULL -- unix timestamp
);
CREATE TABLE projects (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
user_uid INTEGER NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL,
description TEXT,
created_on INTEGER NOT NULL, -- unix timestamp
UNIQUE(user_uid, slug),
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE
);
CREATE TABLE logs (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
project_uid INTEGER NOT NULL,
title TEXT NOT NULL,
number INTEGER NOT NULL, -- this log's sequential number in the project
created_on INTEGER NOT NULL, -- unix timestamp
UNIQUE(project_uid, number),
FOREIGN KEY (project_uid) REFERENCES projects(uid) ON DELETE CASCADE
);
CREATE TABLE log_comments (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
log_uid INTEGER NOT NULL,
user_uid INTEGER NOT NULL,
text TEXT NOT NULL,
created_on INTEGER NOT NULL, -- unix timestamp
FOREIGN KEY (log_uid) REFERENCES logs(uid) ON DELETE CASCADE,
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE
);
CREATE TABLE log_likes (
user_uid INTEGER NOT NULL,
log_uid INTEGER NOT NULL,
is_like BOOLEAN NOT NULL, -- like or dislike
PRIMARY KEY (user_uid, log_uid),
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE,
FOREIGN KEY (log_uid) REFERENCES logs(uid) ON DELETE CASCADE
);
CREATE TABLE project_likes (
user_uid INTEGER NOT NULL,
project_uid INTEGER NOT NULL,
is_like BOOLEAN NOT NULL, -- like or dislike
PRIMARY KEY (user_uid, project_uid),
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE,
FOREIGN KEY (project_uid) REFERENCES projects(uid) ON DELETE CASCADE
);
CREATE TABLE user_likes (
user_uid INTEGER NOT NULL,
user_profile_uid INTEGER NOT NULL,
is_like BOOLEAN NOT NULL, -- like or dislike
PRIMARY KEY (user_uid, user_profile_uid),
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE,
FOREIGN KEY (user_profile_uid) REFERENCES users(uid) ON DELETE CASCADE
);
CREATE TABLE user_follows (
user_uid INTEGER NOT NULL,
user_profile_uid INTEGER NOT NULL,
PRIMARY KEY (user_uid, user_profile_uid),
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE,
FOREIGN KEY (user_profile_uid) REFERENCES users(uid) ON DELETE CASCADE
);
CREATE TABLE project_follows (
user_uid INTEGER NOT NULL,
project_uid INTEGER NOT NULL,
PRIMARY KEY (user_uid, project_uid),
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE,
FOREIGN KEY (project_uid) REFERENCES projects(uid) ON DELETE CASCADE
);- Let edit project thumbnail
- Improve comments
- (maybe) Let delete comments
- (maybe) Let edit comments
- Let reply to comments
- Add comments to user/project pages
- Add updates (
{last_log#}.{update#}) - Highlight code blocks in Rust
- Add tags to logs/projects/users
- Search logs/projects/users by name, tags
- Follow users/projects
- Make/follow groups
- Make discover page
- Add "report" button
- Add support for mov video files (apple format, not native to browsers, probably convert to mp4)
- Inbox
- Auto create sqlite tables if they don't yet exist
- Make phone layout compatible
- Allow to unlist projects
- Fix Bugs:
- When modifying text in markdown editor, if text is long and md side scrolled down, it will jump up.