https://github.com/hellomouse/hellomouse-quote-db
IRC Quote Website for hellomouse organization
https://github.com/hellomouse/hellomouse-quote-db
db irc quote quotedb react
Last synced: 3 months ago
JSON representation
IRC Quote Website for hellomouse organization
- Host: GitHub
- URL: https://github.com/hellomouse/hellomouse-quote-db
- Owner: hellomouse
- License: mit
- Created: 2018-05-13T15:45:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T03:03:29.000Z (over 4 years ago)
- Last Synced: 2025-01-10T20:15:55.265Z (5 months ago)
- Topics: db, irc, quote, quotedb, react
- Language: JavaScript
- Size: 861 KB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hellomouse-quote-db
[](https://www.codacy.com/app/Bowserinator/hellomouse-quote-db?utm_source=github.com&utm_medium=referral&utm_content=hellomouse/hellomouse-quote-db&utm_campaign=Badge_Grade)

A website for IRC quotes for hellomouse.
## Features
* Nice material design layout
* Fancy pagination
* You can add quotesThis app isn't meant to be fancy. There are currently no user accounts or auth required, so if you plan on using this beyond a private group, you should (at least) add a CAPTCHA or auth of some sort.
## Setup Postgres
This app expects a postgres server to be running. DB Config can be set in config.js
```javascript
db: {
user: 'quote-db',
host: 'localhost',
database: 'quote-db',
password: 'password',
port: 3211
}
```
**Note:** You shouldn't store your password in plaintext if there is risk of it being leaked!Here is the table format we used
```sql
CREATE TABLE quotes (
id SERIAL,
channel TEXT(25) NOT NULL,
poster TEXT(16) NOT NULL,
content TEXT(10000) NOT NULL,
created_on TIMESTAMP NOT NULL
);
```Before adding a new quote to the table, the server does the following checks:
* Channel text must be ASCII and start with a '#'
* Channel length must be 25 chars of less
* Username must be ASCII
* Username must be 16 chars or less
* Quote cannot exceed 10000 chars in lengthThese checks are defined in `routes/quote.js`
## Pages
```
:/page_n Access nth page
:/quote_n Access a specific quote by id
:/add_quote Add a quote:/get_quote/n Get info for nth quote
:/get_quote_page/n Get quotes in nth page
:/num_pages/ Get number of pages:/add_quote Send a POST with a json payload:
{
poster: ,
channel: ,
content:
}
```## Install
```git clone https://github.com/Bowserinator/https://github.com/hellomouse/hellomouse-quote-db
cd hellomouse-quote-db
npm install
```
You will need to run both
```
node index.js
npm start
```
Also Postgres needs to be setup. Edit `config.js` for db connection options.## Additional Config
In addition to the config you can change in `config.js`, you must also edit the following lines in package.json:
```json
"start": "PORT=8201 react-scripts start",
"proxy": "http://localhost:8200"
```
The port in the first line should be the port of the react app (Webpage), the port on the 2nd line should be the port of the express app (Same as the port defined in config.js)## Contributing
Got something cool? Bug fixes? Open a PR!
## License
See LICENSE