Giter Site home page Giter Site logo

quotebook.page's Introduction

Quotebook of some Random AE Shitters

This website is going to be an automated quotebook of some guys from Aerospace Engineering at the TU Delft (and just one random computer science guy perhaps if he ever says something quote-worthy). Here you can find all the important quotes.

This website was written / is going to be writte in Golang - for the simple sake of spiting all the people using Javascript - also it performs better, and if these people ever decide that 10GB of quote data is to their pleasing well - well in that case that is honestly on the Database but yea...

Functional Requirements List

  • Page-based website, that loads 15 quotes at the same time, chronological order
  • Easy Search interface that allows searching for the following parts of a quote:
    • Author
    • Contained Text
    • Date (day/month/year combo)
      • Year only
      • Year Month Combination
    • Date-Range
  • Add-quote Button, that allows a user to enter a new quote
    • With password authentication
  • Dark-mode detection, changing theme
  • Next and Previous Page Buttons at the Bottom of the Page (Changed to Pagination)
  • Easy input verification, quotes shouldn't be longer than 512 chars, and people no longer than 50.

Feature List

  • A Small light-weight database, now SQLite3
    • Good Indexing for decent performance
  • The ability to POST to / to add quotes
  • The ability to interop with a discord webhook (should be included in above?)
  • Quick-page based loading out of the DB
  • An easy JSON schema to allow easy interaction with the website

Technical Information

Running

Dependencies

  • Go
  • SQLite3

Note that making this cooperate on windows maybe quite difficult / impossible. I did not attempt this yet. If you can make it work, feel free to submit a pull request with the required instructions.

Installation & Running

Download the Git repo in whichever way you please. Enter the first folder and run

go mod init src

This is done to setup the Go environment. Then enter the main src folder, and create a file named DATABASE. This file should contain the database schema specified below (created using SQLite3).

Creating the SQL Schema

For this you require an installation of SQLite3 (sqlite3). Make sure that the DATABASE file is empty.

First enter sqlite3 with the command

sqlite3

at this point you should be in the sqlite3 environment. Run the following commands to create the schema below:

.open DATABASE

CREATE TABLE quotes (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  quote VARCHAR(512) NOT NULL,
  date DATE NOT NULL,
  sayer VARCHAR(50) NOT NULL
);

Then quit out of sqlite3 by pressing <C-c> (Control-C) twice.

Continue Installation

Return to the root folder, and run:

go get github.com/mattn/go-sqlite3

Now you can run the project from the root folder using

go run src/main.go src/dbStmt.go

(Feel free to make a scrip to automate this) Note the first startup may take a second.

After that the site is going to be hosted on localhost:8000 (by default at least)

Database Schema

CREATE TABLE quotes (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  quote VARCHAR(512) NOT NULL,
  date DATE NOT NULL,
  sayer VARCHAR(50) NOT NULL
);

quotebook.page's People

Contributors

2weiemu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.