Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugocruzlfc/lireddit-clone
Full Stack application! Server and Client. Multiple libraries and strategies. Nextjs, TypeORM, Express, Redis, Typescript, GraphQL, URQL and more!!!!
https://github.com/hugocruzlfc/lireddit-clone
chakra-ui fullstack graphql nextjs14 typescript urql
Last synced: about 12 hours ago
JSON representation
Full Stack application! Server and Client. Multiple libraries and strategies. Nextjs, TypeORM, Express, Redis, Typescript, GraphQL, URQL and more!!!!
- Host: GitHub
- URL: https://github.com/hugocruzlfc/lireddit-clone
- Owner: hugocruzlfc
- Created: 2023-07-09T18:25:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-09T18:19:29.000Z (about 1 year ago)
- Last Synced: 2024-01-10T18:10:07.137Z (almost 1 year ago)
- Topics: chakra-ui, fullstack, graphql, nextjs14, typescript, urql
- Language: TypeScript
- Homepage:
- Size: 542 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Lireddit Clone application
## Steps
```bash
# Clone the repo
# In server folder
yarn install
docker-compose up -d
yarn run dev# In web folder
yarn install
yarn run dev
```# Technologies
### In the server
```bash
# Libraries
yarn add express apollo-server-express graphql type-graphql pg
yarn add -D @types/express
yarn add argon2
yarn add connect-redis express-session
yarn add -D @types/express-session
yarn add cors
yarn add -D @types/cors
yarn add nodemailer
yarn add -D @types/nodemailer
yarn add uuid ioredis
yarn add -D @types/uuid @types/ioredis
yarn add typeorm reflect-metadata
yarn add -D @types/node#Running de migration:
# Docs
req.session.userId = user.id; // store user id session{userId: 1} => send this to redis
1
sess: ihioehierhioerhoier => {userId: 1}2
express-session => will set a cookie on browser3
when user makes a request to server, cookie will be sent to server4
decrypt cookie and get session id
ihioehierhioerhoier => sess: ihioehierhioerhoier => {userId: 1}5
make a request to redis
sess: ihioehierhioerhoier => {userId: 1}req.session.userId = {user.id} // store user id session
```## In the web
```bash
# Libraries
yarn add formik
yarn add urql graphql @urql/exchange-persisted @urql/next @urql/exchange-graphcache
yarn add --dev typescript @graphql-codegen/cli
npx graphql-code-generator init
yarn add --dev @graphql-codegen/typescript-urql
yarn add react-is
yarn add @chakra-ui/react @chakra-ui/next-js @emotion/react @emotion/styled framer-motion# Docs
URQL:
https://formidable.com/open-source/urql/CODEGEN:
https://graphql-code-generator.com/docs/getting-started/installationestoy en el min : 7:41
# About next.js
me => browse http://localhost:3000
=> nextsjs server
=> request to graphql server localhost:4000/graphql
=> build the HTML
=> sending back to your browser```
## Typeorm
```bash
# Create migration
npx typeorm migration:create ./src/migrations/FackePosts
```