rajcrk / crayond-thunder

Submission for Crayon`d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Submission by, Raj Kumar C

rajkumar.cind@gmail.com

URL for Deployed version on heroku

https://thunder-crayond.herokuapp.com/

Crayon`d Task

How to setup and test this appilcation

What I have done ?

I have created a way where users can post images or post just text, much like a social platform.The functionalities that the user can do are.

  • Register for an account
  • Create a Post ( with or without image )
  • Like a post
  • View his own post
  • Search for posts

    Tech Stack

    Front End

  • HTML
  • CSS
  • EJS Templating Engine
  • JQuery
  • Some pretty Images from Unsplash. :-)
  • Boostrap Library 3.3.7

    Back End ( The Important Stuff )

  • Node Js
  • Mongo DB

    Node Modules I`ve Used

  • Passport Js - For Authentication
  • mongoose
  • Express Js
  • passport-local
  • multer

    What you need to run this application

    Since this is a Node application, make sure that you have Node Js installed on your system.
    You should also be having mongoDB installed and active in your system, make sure that mongoDB is running on the default MongoDB port ( 27017 ).

    Running this application

    I have included a compressed file. Extract the compressed file and change directory into the extracted folder.
    Just to be sure run this command, so that we dont miss out any module files.

    npm install

    After starting up mongodb service, run this application by typing in the command.

    node app

    This application will run locally on port 1234, go to this URL to access the application.

    http://localhost:1234/

    How this application works ?.

    To create or view a post you must have an account. So when you are running this application for the first time do create an account.
    Ive set certain constraints where you can only access certain API only if you have logged in. The login session is stored on the client side as a hash and the other hash for the session is maintained at the server side along with a key, both are compared to authenticate the user.
    To manage authenication I`ve used Passport Js.( Just trying not to reinvent the wheel )

    DB Schema

    alt text

    Implementation Details

    You need to have an account to post as well as like post.
    I have included a middleware to check if the user is authenticated to access a particular API.

    Login Page

    alt text

    Registration Page

    You can register by providing a unique username, ( It has to be unique, I have checked for this on the Node Js part ) If the username that you picked already exists then you will be retured back to the registration page
    I mainly focused on the back-end part.
    alt text

    Home Page

    After you have logged in, you are redirected to the new feed page. Here you can view all post as well as like a post.
    alt text

    Search Post

    You can search for a post by typing in the content you want to search in the search input field provided in the navigation bar.
    The content that you provide will be matched with the content of the posts in the mongoDB. alt text

    User Profile

    This is where you can see the user information ( Not much in this application ) such as the username and the content that you have posted,

    alt text

    If there is any questions regarding my application, Do feel free to reach out to me.

    rajkumar.cind@gmail.com (+91) 7708464536

    The End

    Thanks Guys, Had fun working on this !

    drawing
  • About

    Submission for Crayon`d


    Languages

    Language:HTML 57.2%Language:JavaScript 32.0%Language:CSS 10.8%