GithubHelp home page GithubHelp logo

minhquan0902 / reddit-clone-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 133 KB

A Backend Code Repo for Reddit-Clone Project using NodeJS with Typescript

Shell 0.25% Dockerfile 1.60% TypeScript 98.15%

reddit-clone-server's Introduction

Reddit-clone-server

Back end code for Reddit-clone

Link to FrontEnd Code: https://github.com/minhquan0902/Reddit-clone-client.git

Official Website: https://quanredditcloneee.xyz/

Hosting provided by Digital Ocean and Dokku

Github3

The project was inspired by Ben Awad: https://www.youtube.com/watch?v=I6ypD7qv3Z8&t=44740s but I decided to stick with MikroOrm and calling new fork() for orm.em for handling request context

Technology used

Github1

  1. Postgres
  2. type-graphql
  3. MikroOrm as the main ORM tech
  4. ApolloServer
  5. Redis for storing cookies and user cache
  6. argon2 for password hash
  7. Express server and express session
  8. Docker for devops and deploying processes

Install the project locally

  1. Install PostgreSQL

    • Use "postgres" as the password for user "postgres"
    • Setup the PATH variable in your operating system if the shell couldn't find "psql" or "createdb"
  2. Install Redis

    • Setup the PATH variable if neccessary

      NOTE for Windows user: Follow the guide from this link to run Redis after installation. Watch this youtube link to know how to set PATH to Redis

  3. Open Terminal or Git Bash to create local db

     createdb -U postgres reddit2
  4. Clone this repo at

     git clone https://github.com/minhquan0902/Reddit-clone-server.git
  5. Build the Project

    a. Install Node.js. It is recommended that you use node v14.3.0 or newer.

    b. Install Yarn.

    c. Install all dependencies and package by typing this to the terminal at root folder

       $ yarn install
    
  6. To start the server up and running

    a) Open the first terminal for redis

        $ redis-server
    

    b) Open the second terminal to watch for changes watch

        $ yarn watch
    

    c) Start the server up and running

        $ yarn dev
    

When server up and running, can access Graphql Playground at Localhost:4000/graphql

Any issues, reach out to me at [email protected]

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.