๐Ÿ’โ€โ™‚๏ธ MERN ์Šคํƒ ๋“ฑ์œผ๋กœ Dev.to ๋ณต์ œ๋ณธ ๊ตฌ์ถ•

10810 ๋‹จ์–ด showdevjavascriptnodereact




Dev.to-clone



A Dev.to clone created with MERN stack and more (Essentially FB without stories feature)๐Ÿฅณ


๋ชฉ์ฐจ


  • Inspire
  • The Experience
  • Tech used
  • Features
  • Screenshots
  • Links
  • Setup locally
  • Do me a favor
  • Credits

  • ๊ณ ๋ฌดํ•˜๋‹ค

    First of all, I did not think of clonning another websites in my whole journey, Only to know what I'm capable of after learning the MERN stack 4 months ago.

    I was looking for a frontendmentor ํ‰์†Œ์™€ ๊ฐ™์ด ๋‚ด ๊ธฐ์ˆ ์„ ํ™•์ธํ•˜๊ณ  ์ฆ๋ช…ํ•  ํ”„๋กœ์ ํŠธ์ด์ง€๋งŒ ์›น ์‚ฌ์ดํŠธ์—์„œ ์–ธ๊ธ‰ํ•œ ๊ฒƒ์ฒ˜๋Ÿผ ํ”„๋ŸฐํŠธ์—”๋“œ์™€ ๊ด€๋ จ๋œ ๋ฐฑ์—”๋“œ๋ฅผ ์ฐพ์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.

    ๋งŽ์€ ๊ฒ€์ƒ‰์„ ํ•œ ํ›„ ๋‚˜๋Š” dev.to ์›น์‚ฌ์ดํŠธ๋ฅผ ๋ณต์ œํ•œ ๋ช‡๋ช‡ ์‚ฌ๋žŒ๋“ค๋กœ๋ถ€ํ„ฐ ์˜๊ฐ์„ ์–ป์—ˆ์Šต๋‹ˆ๋‹ค. ์ผ๋ถ€๋Š” ํ”„๋ŸฐํŠธ์—”๋“œ๋งŒ ๋ณต์ œํ•˜๊ณ  ์ผ๋ถ€๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ๊ธฐ์ˆ  ์Šคํƒ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ณต์ œํ–ˆ์Šต๋‹ˆ๋‹ค.

    ๊ทธ๋ฆฌ๊ณ  ์ด๋ฏธ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์— ์˜ํ•ด ๋ณต์ œ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์†Œ์ˆ˜์ž„์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ ๐Ÿ˜Œ ๋‹ค๋ฅธ ํด๋ก ์—๋Š” ์—†๋Š” ๋งŽ์€ ๊ธฐ๋Šฅ์„ ๊ฐ€์ง„ ์ •ํ™•ํ•œ ํด๋ก  ๋ณต์ œ๋ณธ์„ ๋งŒ๋“ค์–ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ณ ์˜ ๋ธ”๋กœ๊น…, ๋‹ค์ค‘ ํŽ˜์ด์ง€ ๋ฐ ๋„์ „์ ์ธ ์›น ์‚ฌ์ดํŠธ ์ค‘ ํ•˜๋‚˜๋ฅผ ๋ณต์ œํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐํšŒ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

    ์ด 4๊ฐœ์›” ์ •๋„ ๊ฑธ๋ ธ์œผ๋‹ˆ ์ ˆ๋งํ•˜์ง€ ๋ง๊ณ  ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•˜์„ธ์š”.

    Doesn't matter how slowly you go as long as you do not stop.


    ๊ฒฝํ—˜

    It was really challenging in these different layouts especially on mobile, Also browser support wasn't that good so I couldn't use some stuff as in css the :has() pseudo class.

    I Deep dived in Redux toolkit and RTK query, Learned lots of stuff like lazy quering and cache invalidation.
    I practiced Json web tokens (aka JWT) in advance for issuing access & refresh tokens on login either from Google/Github OAuth or manual authentication and logging them out automatically after expiration.

    Got familiar with Vercel/Render deployments, Faced so many problems in this journey, It was full of error handling, stress and panicking๐Ÿ˜‚, There was alot going on in this phase.

    Eventually, I was satisfied and pleased with the results!

    Don't forget to share this as much as possible and let's get started folks๐Ÿ˜‡.

    ์‚ฌ์šฉํ•œ ๊ธฐ์ˆ 

    Frontend

    • React
    • Redux toolkit (Advanced RTK)
    • Tailwind
    • Styled components
    • Framer motion
    • React router
    • Cloudinary (Image hosting)

    Backend

    • MongoDB
    • Express
    • Node.js
    • OAuth (Google/Github)
    • JWT
    • Socket.io (Real-time)
    • Cloudinary
    • Mongoose
    • Axios

    ํŠน์ง•

    • Login / Signup
    • View / Edit Profile
    • Google / Github OAuth
    • Ultimate mobile responsiveness
    • Real-time Notifications Toasted
    • CRUD Posts / Comments / Replies / Tags
    • Follow / Unfollow Users
    • Follow / Unfollow Tags
    • Like / Unicorn / Bookmark Posts
    • Like comments
    • Advanced Search engine for posts, people and tags
    • Filter for posts
    • Reading List
    • Dashboard

    ์Šคํฌ๋ฆฐ์ƒท

    ๋กœ๊ทธ์ธ / ํšŒ์›๊ฐ€์ž… / ์ˆ˜์ • / ์‚ญ์ œ




    ๊ตฌ๊ธ€/๊นƒํ—ˆ๋ธŒ OAuth




    ๊ฒŒ์‹œ๋ฌผ ์ƒ์„ฑ/์—…๋ฐ์ดํŠธ/์ˆ˜์ •/์‚ญ์ œ




    ๋ฐ˜์‘ / ๋Œ“๊ธ€ / ํŒ”๋กœ์šฐ ์‹ค์‹œ๊ฐ„ ์•Œ๋ฆผ (ํ† ์ŠคํŠธ)




    ํƒœ๊ทธ / ์ฝ๊ธฐ๋ชฉ๋ก




    ๊ณ„๊ธฐ๋ฐ˜




    ๊ฒ€์ƒ‰ ์—”์ง„




    ์—ฐ๊ฒฐ

    Client: https://marodevv-devto-clone.vercel.app

    Server: https://marodevv-devto-clone-server.onrender.com

    Source: https://github.com/marodevv/Devto-clone


    ๋กœ์ปฌ์—์„œ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

    ํด๋ก  ๋ ˆํฌ


  • ๋ฅผ ํ†ตํ•ด the repo์„ ๋กœ์ปฌ ์ปดํ“จํ„ฐ์— ๋ณต์ œํ•ฉ๋‹ˆ๋‹ค.

    ์„ค์ •


  • client์— ์˜ํ•ด server ๋ฐ npm i ํ•˜์œ„ ๋””๋ ‰ํ† ๋ฆฌ์— ๋ชจ๋“  ์ข…์†์„ฑ์„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

  • $ cd server && npm i
    $ cd client && npm i
    

    ๋งŒ๋“ค๋‹ค


  • MongoDB Atlas์„ ํ†ตํ•œ ๋กœ์ปฌ ๋˜๋Š” ์˜จ๋ผ์ธ MongoDB ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค
  • A Cloudinary account
  • Google Cloud Platform์˜ ์ƒˆ ํ”„๋กœ์ ํŠธ
  • .env ๋ฐ client ํ•˜์œ„ ๋””๋ ‰ํ† ๋ฆฌ
  • ๋ชจ๋‘์— ์žˆ๋Š” server ํŒŒ์ผ
  • ENV ๋ณ€์ˆ˜
  • client/.env :

    BASE_URL=
    GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
    GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
    GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
    

    server/.env :

    ACCESS_TOKEN_SECRET=
    REFRESH_TOKEN_SECRET=
    
    CLIENT_URL=
    
    GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
    GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
    GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
    
    DB_NAME=
    DB_USER=
    DB_PASSWORD=
    
    CLOUDINARY_CLOUD_NAME=
    CLOUDINARY_API_KEY=
    CLOUDINARY_API_SECRET=
    CLOUDINARY_DEFAULT_URL= // default image url
    CLOUDINARY_DEFAULT_PUBLIC_ID= // default image public_id
    


  • ๋งˆ์ง€๋ง‰์œผ๋กœ ๋‘ ํ•˜์œ„ ๋””๋ ‰ํ† ๋ฆฌ
  • ์˜ ๋ฃจํŠธ์—์„œ npm run stack๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

    ๋‚˜์—๊ฒŒ ๋ถ€ํƒ์„ ๋“ค์–ด

    ์‚ฌํšŒ์˜


  • Github


  • Hashnode


  • ๊ณต์œ ํ•˜๋‹ค



    ๋‚˜๋Š” ๋ธ”๋กœ๊น…์„ ์ฒ˜์Œ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋‚ด๊ฐ€ ๋งˆ๋•…ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ๋งŒํผ ์ด๊ฒƒ์„ ๊ณต์œ ํ•˜๋„๋ก ์š”์ฒญํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค!

    ์ง€์›ํ•˜๋‹ค


  • ์ปคํ”ผ ์‚ฌ์ฃผ์„ธ์š” - https://www.buymeacoffee.com/marodevv

  • ์‹ ์šฉ ๊ฑฐ๋ž˜

    Dev.to clone by me

    ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ