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 installed.
- 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 dbsqlparserfor checking whether two table schemas are identicalinferfor 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
- The current system is set up to use a gmail account to send out emails to users when it's their logsday.
export GMAIL_APP_PASSWORD={your_app_password}- The app password can be gotten by going to
https://myaccount.google.com/apppasswords, as long as 2 factor authentication for the account is enabled. - And if you're running it yourself, change the email address in
email.rs-pub const GMAIL_ADDRESS: &str = "youraddress@gmail.com";
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,
email TEXT,
admin BOOLEAN NOT NULL DEFAULT FALSE,
created_on INTEGER NOT NULL
);
CREATE TABLE projects (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
user_uid INTEGER NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL,
description TEXT,
listed BOOLEAN NOT NULL DEFAULT TRUE,
created_on INTEGER NOT NULL,
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,
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,
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
);
CREATE TABLE reports (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
user_uid INTEGER NOT NULL,
message TEXT NOT NULL,
url TEXT NOT NULL,
created_on INTEGER NOT NULL,
FOREIGN KEY (user_uid) REFERENCES users(uid) ON DELETE CASCADE
);- Add updates (
{last_log#}.{update#}) - Highlight code blocks in Rust
- Add tags to logs/projects/users
- Search logs/projects/users by name, tags
- Make/follow groups
- Add support for mov video files (apple format, not native to browsers, probably convert to mp4)
- Inbox