/cloneddit3

A reddit clone

Primary LanguageTypeScript

lireddit

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

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.

https://codesandbox.io/s/react-drag-and-drop-react-beautiful-dnd-forked-qxgggy?file=/src/index.js:1085-1568