Skip to content

Because the internet needs more pictures of cats.

License

Notifications You must be signed in to change notification settings

CeesJol/lireddit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 

Repository files navigation


LiReddit
LiReddit

A Reddit clone project, extended from Ben Awad's tutorial

Vercel License: MIT

SourceNew featuresInstalling

screenshot

Source

Extended from Ben Awad's Fullstack Tutorial.

New Features

These are features implemented beyond the tutorial.

  • Subreddits
  • Comments
  • Sorting on top or new
  • User image upload

Installing

This project is hosted as a monorepo, storing both the frontend and the backend in one repository. Some setup is needed for both parts of the project.

Backend

To install packages:

yarn
PostgreSQL

Install PostgreSQL

Create a database

createdb lireddit_cees
Redis

Install Redis

Environment variables

Copy and paste .env.example to .env and insert the following values:

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/lireddit_cees
REDIS_URL=127.0.0.1:6379
PORT=4000
SESSION_SECRET=[insert a long random string here]
CORS_ORIGIN=http://localhost:3000
Running the backend

Run tsc

yarn watch

In another window, run the server (view on localhost:4000/graphql)

yarn dev
Troubleshooting the backend
  1. A simple but effective trick is: stop yarn watch, remove the dist folder, then run yarn watch again.
  2. Check if the migrations ran properly.
  3. After running migrations, you may need to remove the migration files in server/migrations.

Frontend

To install packages:

yarn
Environment variables

Copy and paste .env.local.example to .env.local and insert the following values:

NEXT_PUBLIC_API_URL=http://localhost:4000/graphql
Running the frontend

To run the server (view on localhost:3000)

yarn dev

About

Because the internet needs more pictures of cats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published