Quick little one week project. I wanted to see if I was capable of making a simple blog in a week; And it might not be the best but that's alright. At least I got it done.
The backend is written in rust.
The frontend is written in React.
https://www.youtube.com/watch?v=llBhXfAwOSM
{host}/auth/login
{host}/auth/register
{host}/post/entries
{host}/post/entries/{id}
/api/user/create <- Create an account
/api/user/login <- Login to an account
/api/post/create <- Create a post
/api/post/entries <- List all posts
/api/post/entries/{id} <- Retrieve a specific post
Table creation queries
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
uid VARCHAR(255) NOT NULL,
title VARCHAR(255) NOT NULL,
content VARCHAR(100000) NOT NULL,
created_on BIGINT NOT NULL
)
CREATE TABLE sessions (
uid VARCHAR(255) PRIMARY KEY NOT NULL,
sid VARCHAR(255) UNIQUE NOT NULL,
expires_on BIGINT NOT NULL
)
CREATE TABLE users (
uid VARCHAR(255) PRIMARY KEY,
username citext UNIQUE NOT NULL,
email citext UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
password_salt VARCHAR(255) NOT NULL
);