fcscripters / Devs-In-The-Detail

Q&A website for developers
5 stars 0 forks source link

Devs-In-The-Detail

Visit the Heroku build here

Build Status Test Coverage Code Climate bitHound Score bitHound Dependencies Codecrystal

Welcome to the first in the series of DIY tutorials by FCscripters

This Tutorial will take you through the process of creating a StackOverflow clone, albeit a very simple one. But in the process you will learn the following:

Note this tutorial is not for complete begginers, it will require you to research each topic on your own, don't expect to be fed all the code as you follow along, you could cheat by looking into the files above, but that won't be fun for any of us. But, if you find the tutorial lacking in any way, then please create an issue so that it improves over time.

Step 1 - Setup Basics
Step 2 - Create Basic Server
Step 3 - Setup Database
Step 4 - Join Server and Database so that user entries are saved into the database
Step 5 - Frontend Javascript Extras
Step 6 - Authentication

image

image

image

image

An example of a your handler implementing requests for authentication.

image

Step ? - Clean Up code ????

READ ME Tutorial Detail in the dev.

Create a Repo , clone the repo onto your computer.

Create a Git Ignore file add node_modules, environment variables, ( have pic of git ignore)

Got to working Directory NPM INIT to get your node modules in your command line, and JSON package. (you can keepp pressing enter).

Now we're going to install the dependencies for project.

In command line: npm install redis --save

Next save dev dependencies , in command line : npm install tape --save-dev do the same for 'shot', 'istnanbul' ( screen shot of Package JSON)

Next Setup your Continous intergration testing with Travis (follow steps in tutorial)- open an account with Git Hub and find your repo - sync with Traivs.

Go back to your package JSON and make sure your TEST: correlates to what is in the tutorial.

Get your badge in markdown and add it to the top of your repo

Do the same for Code climate - follow tutorial here.

Create a databae.js file, You must require redis and defne a client variable.

Create an empty object to attach your database function to.

Add an module eexport function at the bottom of your file so other files can use your database object.

First create an addQuestion function , with the Key name as Qid and the keys as; username, question, date.

Second create an addAnswer function, with the key name as Aid and the keys as username, answer, date, vote.

we will be creating a simplified version of Stack Overflow, where developers can ask questions, other users can then answer these questions in real time. The answers can be voted on, the answers are then ordered by the number of up votes they have.

In this process we will create a tutorial detailing how to;