GithubHelp home page GithubHelp logo

fac-11 / thelibrary Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 412 KB

THE centralised resource of useful weblinks for FAC

Home Page: https://thefaclibrary.herokuapp.com/

License: GNU General Public License v3.0

HTML 9.74% JavaScript 60.19% PLpgSQL 20.56% CSS 9.52%

thelibrary's People

Contributors

ameliejyc avatar astroash avatar bartbucknill avatar maxgerber avatar

Watchers

 avatar  avatar  avatar

thelibrary's Issues

Create router.js

Create a router which is server handlers according to endpoints.

Create index.html

Create html doc.

Mobile first!

Doc should have grabable id's for js

refactor out DOM function

Currently the DOM function is very large! Some of the code can be refactored into separate functions eg setClassAttributes, and called inside for ease of reading.

allow upvoting

Add a like button to articles which updates the database and sends back the current state of database for the page you are on

Set up node dependencies / dev dependencies

Project dependencies
env2
pg

Dev dependencies
tape
tap-spec
nodemon
istanbul
shot
eslint
travis

Add in scripts
tests: 'tape tests/*.test.js | tap-spec'
start: 'node ./src/server.js'
devstart: 'nodemon ./src/server.js'

Integrate with GitHub

This will allow us to make sure each individual only upvotes the one time amongst other things - possible integration with Gitter being one of them.

Another SG for you!

Another stretch goal would be to add all the existing books in there in a table with possibility to request renting them, plus seeing which ones exist but are currently rented and stuff :-)

Set up file structure

Folder database

  • db_connection.js
  • db_build.js
  • db_build.sql

Folder public

  • style.css
  • index.html
  • dom.js
  • request.js
  • Folder assets > favicon.ico

Folder tests

  • Folder tests_ database (duplicate of database folder)
  • database.test.js
  • src.test.js
  • public.test.js

Folder src

  • server.js
  • router.js
  • handlers.js
  • get_topic.js
  • get_trending.js

In ROOT

  • .gitignore (config.env, node_modules, ds_store)
  • travis.yml
  • config.env
  • Procfile

no description of how to run the database locally in your readme

This may not have been explicitly stated to you guys, but it's really important that you have instructions in your readme that explain how to run your project locally.

In the case where you have a database in your project, you want to instruct people on:

  • creating their database locally
  • what environment variables they need to set
  • what scripts they should run

etc.

Create handle_topic.js

Create file with getTopic function which takes a string and a callback.

Function will have to create a sql query with the string, then call dbConnection with the query string and pass the response to the callback

Create event listener

When user clicks on a topic on the site, an event listener will call the xhr function and pass in the dropdown value string.

in tests: dbConnection.query is async

(me and Aisha discussed this)

Because .query is async, maybe each test should be inside the callback e.g.

dbConnection.query(sql, (err, res) => {
  if (err) return console.log(err);
  tape('SQL query case check', (t) => {
    getTopic('css', (err, res) => {
      const actual = res[0].topic;
      const expected = 'CSS';
      t.equals(actual, expected, 'getTopic object output topic should be "CSS" as the SQL query string is case insensitive');
      t.end();
    });
});
});

https://github.com/FAC-11/theLibrary/blob/master/tests/database.test.js#L8

RUN ISTANBUL

Do test coverage and add the badge to the readme <3

Create XHR request function

in request.js create an xhr request function that take a string value and a callback as arguments.

The function will feed the string into the url and pass the response text to the callback.

Trending title no longer displayed

With the removal of topic titles, we no longer have a way of signifying the front page is the trending section.

I've no suggestions at the moment as the title removal looks great, but worth thinking about how to incorporate it into the design :)

Create dom.js

Dom function will take in an object and append each resource as a button.
It will clear the current content.
It will replace the title eg Trending will become css

Add travis badge

They're cool :)
if you click on the badge that shows up on the travis site it will give you an image url you can add to your readme

move into `foundersandcoders` organisation

Given that you're building on this during biz dev time & intending for FAC to actually use this, could you move it into the foundersandcoders github organisation? ๐Ÿ™

Just go to Settings -> ("Danger Zone" at the bottom) -> Transfer ownership -> Type in theLibrary & foundersandcoders

Create handlers.js

Handlers will have 4 routes

  • handle home
  • handle public
  • handle topic
  • handle trending

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.