Coder Social home page Coder Social logo

gsg-g10 / umar-reddit Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 216 KB

Weak08-Reddit Clone

Home Page: https://umar-reddit.herokuapp.com/

JavaScript 43.56% CSS 37.76% HTML 17.62% PLpgSQL 1.06%
nodejs expressjs html5 css3 postgresql axios hackmd reddit javascript json

umar-reddit's Introduction

Umar-Reddit

๐Ÿท๏ธ Site URL

Umar-Reddit ยฉ๏ธ


๐Ÿ…ฐ๏ธ User Story

  • User can see all posts on the home page.
  • User can sign up and login.
  • User don't need to be logged to view the posts,but need to be logged in to post and comment.
  • User can be able to create a comment on a Post
  • User can delete thier own posts.
  • User can click on a Create Post button and see a popup to create a new Post.
  • User can see his own profile.

๐Ÿ”ค Tech Used

> Git Work Flow
> npm 
> Jest
> HTML5
> CSS3
> Java Script (JS)
> NodeJS
> ExpressJS
> API
> Herouku
> PostgressSQL

๐Ÿ“ Work flow

Step 1: Create Repository

  • Create my Repository
  • Write main issues
  • Finish issue and create another .

๐Ÿš€

Step 2: Create Server

first i install the dependencies and devDependencies i want to use in my project then i Created NodeJs Express server

I used axios in the dependencies insted of node-fetch because the API (reabid API) i deal with .

Step 3: Creat Database

When i study the main site that i want to clone it i found there is 3 tables i want to work with :

Table PK
Users userId
Posts postId
Comments commentId

๐Ÿ“Œ Want to design your schema like this ? โžœ DRAWSQL

  • Creat Database Schema
  • Connect the database with the Express Server
  • Creat the build.js file to build the database

๐Ÿจ Runnig the project locally

- git clone https://github.com/GSG-G10/Umar-Reddit.git
- cd Umar-Reddit
- npm i
- Call Me to have the .env file :p
- npm start

umar-reddit's People

Contributors

umarsalah avatar

Forkers

umarsalah

umar-reddit's Issues

Create Server

Create an express server with nodeJs environment.

Main page posts

When anyone enters the site he will see a lot of posts for users who already have an account on it.

Log In

When the user wants to log in he will enter the email and the password then checkup if it exists in the DB then redirect him to his profile.

Get Posts

On the main page, users should see random posts from random users.
On the profile page, user should see his own post.

Edit delete post

When deleting a post that has a comment we have to delete it comments then delete it.

Log Out

When the user clicks on the sign out button his cookies will be removed and redirected to the sign-in page.

Edit posts query

Edit the posts query where it was showing just the posts that have comments.

Create Posts

The user can create a new post by click on add new post button.

Create Database

Create Database schema and connect it with the express server.

Hash Passwords

When the user signs up to the site we store the hashed password in the DB.

User Profile

When the user signed in or signed up he be redirected to his profile.

Sign Up

When the user inserts his data to create a new account, we will insert his data in that DB and create a new user then redirect him to the home page.

Error Pages

  • 404.html
  • 500.html
  • 404.css
  • 500.css
  • Handle in back end .

Edit post comments

allow the user to see how many comments are on the post before he enters the post page.

Project Setup

โ”œโ”€โ”€ /server                      
 โ”‚   โ”œโ”€โ”€ index.js         
 โ”‚   โ”œโ”€โ”€ app.js  
 |   โ”œโ”€โ”€ /database 
 |      |ู€ู€ู€ connection.js 
 โ”‚      โ””โ”€โ”€ /Queries
 โ”‚            โ””โ”€โ”€  index.js
 โ”‚      โ””โ”€โ”€ /config   
 โ”‚            |ู€ู€ู€ build.js
 โ”‚            โ””โ”€โ”€  data.sql
 |    โ”œโ”€โ”€ /middlewares 
 โ”‚            โ””โ”€โ”€  index.js
 |    โ”œโ”€โ”€ /router 
 โ”‚            โ””โ”€โ”€  index.js
 |   |ู€ู€ู€ู€/utils
 |   โ”œโ”€โ”€ /controllers
          โ””โ”€โ”€ index.js           
โ”œโ”€โ”€ /test
 โ”‚      โ””โ”€โ”€ index.test.js   
โ”œโ”€โ”€ /public
 |  โ”œโ”€โ”€ index.html 
 |  |โ”€โ”€ /style  
 |       |ู€ู€  404.css
 |       |ู€ู€ 500.css
 |       โ””โ”€โ”€ index.css                     
 |  โ”œโ”€โ”€ script  
โ”‚        โ””โ”€โ”€ index.js  
|
โ”œโ”€โ”€ .gitignore 
โ”œโ”€โ”€ .eslintrc.js                  
โ”œโ”€โ”€ README.md                             
โ””โ”€โ”€ package.json  

Handle errors

Handle backend errors in the frontend and promote them to the user.

Test Routes

  • Test "/" route with response 200 and HTML content type
  • Test "/errorPages" route with respmse 404 and HTML content type.

Get Comments

When the user goes to the comments page he will find all the comments for this post.

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.