Giter VIP home page Giter VIP logo

bluedit's Introduction

๐Ÿ“˜ Bluedit

alt text alt text

I use reddit pretty often, and I was looking for a project to work on during winter break. I decided to go through Ben Awad's full stack tutorial. I made changes to the UI so that it would reflect the actual reddit website. Overall, this project really helped me understand how to frontend and backend components work together. Below are some notes I took, feel free to read my thoughts or comment if I'm wrong about anything!

๐Ÿ‹๏ธ Tech Stack

๐Ÿ‘จโ€๐Ÿ’ป Backend

Apollo GraphQL

According to the Apollo docs a schema defines a hierarchy of types with fields that are populated from your back-end data stores. I use GraphQL in order to run CRUD operations on my database. I use Code-first development - defining the resolver first then defining the Schema because it works well with typescript. I used the Type-GraphQL library for Code-first development.

TypeORM

Using TypeORM with TypeGraphQL is very helpful for keeping everything in sync. By definition, I must define a schema for 1. GraphQL and 2. my database. Having an ORM (Object-relational Mapper) allows me to map objects into my postgresQL database.

Redis

Redis uses key value pairings similar to a hashmap. req.session.userId: I use Reddis to store user sessions The keys refer to sess:[x] and the value sent back is {userId: x}. When used in combination with Express, express-session sets an encrypted cookie on my browser that represent the key we send to Redis. When a user makes a requet, the cookie is decrypted back into the Redis sess form which will be used in the Redis hashmap.

Express

Express is a middleware technology. I use it in conjunction with Apollo-Server. I can use req.session to store any values I want. For Example, I use req.session to store userId's when a user logins or registers. I could store the whole User object in req.session, however, I changed the User object several times during this project.

๐Ÿ‘จโ€๐ŸŽจ Frontend

NextJS

NextJS is really fun to use. They make routing really simple.

Chakra React

Chakra helps build faster React Components :)

Urql

Urql helps me makes GraphQL requests from the frontend. I can also toggle on Server-side rendering or Client-side rendering. I use GraphCache in order to update cache. I use cache in order to update the query on the frontend whenever I make a Mutation (login, register, posts).

GraphQL Code Generator

GraphQL Code Generator integrates React and GraphQL seamlessly. I am able to create React Hooks and allow me to access GraphQL resolvers.

bluedit's People

Contributors

andreidimaano avatar

Stargazers

 avatar

Watchers

 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.