Giter Club home page Giter Club logo

lireddit's Introduction


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

lireddit's People

Contributors

ceesjol avatar

Stargazers

Han || Alex avatar  avatar

Watchers

James Cloos avatar  avatar

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.