Git Product home page Git Product logo

lireddit's Introduction

lireddit

A recreation of Ben Awad's 14 hour Tutorial, but with my own subtle improvements in code quality and developer experience.

Demo here

Improvements include:

  • Test coverage of both the backend and frontend
  • Much better UI
  • Dark mode
  • Image support
  • Comments on posts

Original Repository here.


How to deploy

Server

Setup postgresql: here's guides for Ubuntu and Manjaro/Arch.

Create a database called lireddit:

createdb -U postgres lireddit

Then, in the root project directory, run the following:

cd server
cp .env.EXAMPLE .env

Edit CORS_ORIGIN and DOMAIN as needed, and then run

yarn
yarn build
yarn start

Web

cd web
cp .env.production.local.EXAMPLE .env.production.local

Edit the variables as needed, and then run

yarn
yarn build
yarn start

Development setup

Backend

Setup postgresql: here's guides for Ubuntu and Manjaro/Arch.

Create a database called lireddit, and another called lireddit-test:

createdb -U postgres lireddit
createdb -U postgres lireddit-test

Run yarn watch in one terminal window, and yarn dev in the other.

You get hot reload and database auto-synchronization enabled by default.

Testing: run yarn test

Frontend

Run yarn dev to start the next server in development mode.

Testing: run yarn test:frontend in the server folder and yarn test in the web folder.

lireddit's People

Contributors

tusharsadhwani avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alex-wengg

lireddit's Issues

Store theme setting locally

  • Using localstorage probably
  • The server should be informed via the client if the theme has been toggled to light, to prevent flickers

Cloudinary is insecure

Cloduinary credentials are currently being shipped to the browser, which is a no no.

Few possible solutions:

  • See if cloudinary can restrict access to only uploads of images, and rate limit. (still, not very good)
  • Create an endpoint in the express backend and upload the images on server.
  • Use signed URLs if cloudinary supports it, or via amazon s3.

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.