Skip to content

salonyranjan/Rewind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Rewind β€” Memory-Sharing Platform



Typing SVG







"A feature-rich social memory platform built on the MERN stack β€” where every scroll is a trip down memory lane."


Β  Β  Β 


πŸ“‹ Table of Contents

  1. πŸ“Έ What is Rewind?
  2. πŸ–ΌοΈ UI Showcase
  3. πŸ“Š Project at a Glance
  4. ✨ Key Features
  5. πŸ—οΈ System Architecture
  6. πŸ—„οΈ Data Model
  7. πŸ› οΈ Tech Stack
  8. πŸ“‚ Project Structure
  9. πŸ“¦ Getting Started
  10. ☁️ Cloud Deployment
  11. ⚑ Performance & Optimisation
  12. πŸ—ΊοΈ Roadmap
  13. 🀝 Contributing
  14. ❓ FAQ
  15. πŸ“„ Changelog
  16. πŸ‘€ Author
  17. ⭐ Show Your Support

1. πŸ“Έ What is Rewind?

Rewind is a full-stack social memory platform built on the MERN stack. Users can create richly-tagged memory cards β€” complete with images, stories, and likes β€” and share them with the world. It demonstrates a modern decoupled architecture: the React+Redux frontend lives on Vercel's global edge network while the Express+MongoDB backend scales independently on Render.

🎯 Built to showcase: Full-stack MERN mastery, Redux state management, RESTful API design, cloud deployment strategy, and optimistic UI patterns.

πŸ”– Version πŸ“¦ Highlight
πŸ†• v2.0 Decoupled multi-cloud deploy Β· Optimistic Redux likes Β· Base64 image processing
πŸ”„ v1.5 Material-UI design system Β· Tag-based filtering Β· Mongoose schema validation
πŸŽ‰ v1.0 Initial MERN CRUD β€” create, read, update, delete memories

2. πŸ–ΌοΈ UI Showcase

UI tagline

🏠 Memory Feed β€” The Main Stage

Rewind β€” Memory Feed

πŸ“± Responsive grid layout β€” Material-UI cards auto-reflow from 4-column desktop to single-column mobile Β· Like counter updates instantly via optimistic Redux state


✍️ Create / Edit Memory β€” The Editor

Rewind β€” Create Memory

πŸ–ΌοΈ Real-time Base64 image preview before submission Β· Tag chip input for categorisation Β· Form validates all required fields inline


πŸƒ Memory Card Close-Up

Rewind β€” Memory Card

❀️ Optimistic Like β€” state updates instantly before server confirmation Β· πŸ•’ Relative timestamps (e.g. "2 hours ago") Β· Edit / Delete controls visible to the creator


πŸ–₯️ Feature πŸ“± Mobile πŸ’» Tablet πŸ–₯️ Desktop
πŸ“Έ Memory Feed Grid βœ… 1-col βœ… 2-col βœ… 4-col
✍️ Create / Edit Form βœ… βœ… βœ…
❀️ Optimistic Like βœ… βœ… βœ…
πŸ” Tag Filter βœ… βœ… βœ…
πŸŒ™ Dark Mode (roadmap) πŸ”„ πŸ”„ πŸ”„

3. πŸ“Š Project at a Glance

πŸ”Œ Layer πŸ“‘ Status ⏱️ Latency πŸ” Security
🌐 Frontend Vercel ~40ms SSL · Edge CDN
πŸ”Œ Backend API Render ~120ms CORS Β· HTTPS
πŸ—„οΈ Database Atlas 99.9% uptime AES-256 at rest

πŸ”— Live Website: https://rewind-pied.vercel.app πŸ”— API Base URL: https://rewind-api-alwp.onrender.com


4. ✨ Key Features

πŸ“±Fully Responsive UIMaterial-UI grid adapts flawlessly across mobile, tablet, and ultra-wide desktop
πŸ”„Optimistic UI UpdatesRedux state updates instantly on Like β€” UI reflects changes before the server confirms, eliminating perceived lag
πŸ–ΌοΈReal-Time Image PreviewBase64 encoding renders image previews inline as soon as a file is selected β€” no upload round-trip needed
🏷️Tag-Based DiscoveryMulti-tag support on every memory β€” filter and surface related posts instantly
☁️Decoupled Multi-CloudFrontend on Vercel's global edge, backend on Render β€” each scales and deploys independently
πŸ”CORS ProtectionServer-side CORS middleware restricts access to verified frontend origins only
πŸ—„οΈMongoose ODMType-safe, schema-validated document storage with auto-timestamps and default values
πŸ“¦30 MB Payload SupportCustom body-parser limits handle high-resolution Base64 image uploads without request failure
🎨Material Design SystemConsistent, accessible UI built entirely on Material-UI components with CSS-in-JS theming
⚑Single-Trip Data FetchingOne GET request retrieves all metadata and images, minimising TCP handshake overhead

5. πŸ—οΈ System Architecture

The application follows a Decoupled Monorepo Architecture β€” client and server live in the same repo but deploy to separate cloud providers and scale independently.

5.1 πŸ“ Architecture Diagram

graph TD
    U[πŸ‘€ User Browser] -->|React + Redux| VF[🌐 Vercel Frontend]
    VF -->|Axios REST β€” HTTPS| RB[πŸ”Œ Render Backend]
    RB -->|Mongoose ODM| DB[(πŸ—„οΈ MongoDB Atlas)]
    DB -->|Data Response| RB
    RB -->|JSON Response| VF
    VF -->|Redux State Update| U

    subgraph Frontend ["🌐 VERCEL β€” Edge CDN"]
        VF
        RC[βš›οΈ React Components]
        RX[πŸ”„ Redux Store]
        AX[πŸ“‘ Axios Service]
        VF --> RC --> RX --> AX
    end

    subgraph Backend ["πŸ”Œ RENDER β€” Web Service"]
        RB
        RT[πŸ›£οΈ Express Routes]
        CT[πŸŽ›οΈ Controllers]
        MD[πŸ“‹ Mongoose Models]
        RB --> RT --> CT --> MD
    end

    classDef fe fill:#0a1a2e,stroke:#61DAFB,stroke-width:2px,color:#fff;
    classDef be fill:#0a2e0a,stroke:#339933,stroke-width:2px,color:#fff;
    classDef db fill:#0a0a2e,stroke:#47A048,stroke-width:2px,color:#fff;
    classDef user fill:#000,stroke:#61DAFB,stroke-width:2px,color:#fff;

    class U user;
    class VF,RC,RX,AX fe;
    class RB,RT,CT,MD be;
    class DB db;
Loading

5.2 πŸ”„ Data Flow Diagram

graph LR
    subgraph Client_Side ["βš›οΈ CLIENT β€” React / Redux"]
        U((πŸ‘€ User)) -- "1. Form Input" --> UI[πŸ–ΌοΈ UI Components]
        UI -- "2. Action Dispatch" --> RD[πŸ”„ Redux Store]
        RD -- "3. API Request" --> AX[πŸ“‘ Axios Service]
    end

    subgraph Server_Side ["πŸ”Œ SERVER β€” Node / Express"]
        AX -- "4. REST HTTPS (JSON + Base64)" --> RT[πŸ›£οΈ Express Routes]
        RT -- "5. Controller Logic" --> CT[πŸŽ›οΈ Mongoose Controllers]
    end

    subgraph Storage ["πŸ—„οΈ CLOUD STORAGE"]
        CT -- "6. Persist document" --> DB[(MongoDB Atlas)]
        DB -- "7. Return document" --> CT
    end

    CT -- "8. Success JSON" --> RD
    RD -- "9. Re-render Feed" --> UI
Loading

DFD Level Guide:

Level Actor Action
0 πŸ‘€ User Inputs Title, Message, Tags, Image via form
1 βš›οΈ Redux Dispatches async action to Axios service layer
2 πŸ“‘ Axios Transmits JSON + Base64 payload over HTTPS to Render
3 πŸŽ›οΈ Express Validates payload, writes to MongoDB via Mongoose
4 πŸ”„ Redux Receives success response, updates global state, triggers re-render

5.3 ⚑ Request Lifecycle Sequence

sequenceDiagram
    autonumber
    participant U  as πŸ‘€ User
    participant RX as πŸ”„ Redux
    participant AX as πŸ“‘ Axios
    participant EX as πŸ”Œ Express
    participant DB as πŸ—„οΈ MongoDB

    Note over U,RX: ❀️ Like a Memory Post
    U->>RX: dispatch(likePost(id))
    RX->>RX: Optimistic update β€” increment likeCount in local state
    RX-->>U: UI reflects +1 instantly (zero lag)

    RX->>AX: PATCH /posts/:id/likePost
    AX->>EX: HTTPS PATCH request
    EX->>DB: findByIdAndUpdate β€” $inc likeCount
    DB-->>EX: Updated document
    EX-->>AX: 200 OK + updated post
    AX-->>RX: Confirmed server state
    RX-->>U: State synced βœ…

    Note over U,EX: ✍️ Create a Memory
    U->>RX: dispatch(createPost(formData))
    RX->>AX: POST /posts (JSON + Base64 image)
    AX->>EX: HTTPS POST
    EX->>DB: new PostMessage(data).save()
    DB-->>EX: Saved document
    EX-->>AX: 201 Created
    AX-->>RX: Dispatch getPosts()
    RX-->>U: Feed refreshed with new memory βœ…
Loading

6. πŸ—„οΈ Data Model

6.1 πŸ“‹ Schema Specification

πŸ“Œ Field πŸ”· Type βš™οΈ Required 🏷️ Default πŸ“ Description
_id ObjectId Auto β€” Unique document identifier (MongoDB)
title String βœ… Yes β€” Headline or subject of the memory
message String βœ… Yes β€” Detailed story or description
creator String βœ… Yes β€” Name or ID of the authoring user
tags [String] ❌ No [] Array for categorisation and tag-based search
selectedFile String ❌ No "" Image stored as Base64-encoded string
likeCount Number ❌ No 0 Like counter β€” incremented via PATCH /likePost
createdAt Date System Date.now Auto-timestamp for chronological feed sorting

πŸ’‘ Base64 Note: The selectedFile field stores images as Base64 strings directly in MongoDB. This is ideal for demo-scale projects. For production at scale, migrate to a CDN (Cloudinary, AWS S3) β€” see Roadmap.

6.2 🧩 Entity Diagram

classDiagram
    class PostMessage {
        +ObjectId _id
        +String title
        +String message
        +String creator
        +String[] tags
        +String selectedFile
        +Number likeCount
        +Date createdAt
        +save() Promise
        +findById() PostMessage
        +findByIdAndUpdate() PostMessage
        +findByIdAndRemove() void
    }
    note for PostMessage "selectedFile: Base64 encoded image string\nlikeCount default: 0\ncreatedAt default: Date.now"
Loading

6.3 πŸ› οΈ Implementation Snippet

// server/models/postMessage.js
import mongoose from 'mongoose';

const postSchema = mongoose.Schema({
    title:        String,
    message:      String,
    creator:      String,
    tags:         [String],
    selectedFile: String,
    likeCount: {
        type:    Number,
        default: 0,
    },
    createdAt: {
        type:    Date,
        default: new Date(),
    },
});

const PostMessage = mongoose.model('PostMessage', postSchema);
export default PostMessage;

7. πŸ› οΈ Tech Stack

βš›οΈ Frontend

πŸ”Œ Backend

πŸ—„οΈ Database & Cloud

βš™οΈ Capability πŸ”¬ Implementation πŸ† Result
πŸ”„ State Management Redux + async thunks Optimistic UI, zero lag likes
πŸ–ΌοΈ Image Handling Base64 encode/decode Instant preview, no upload roundtrip
πŸ” API Security CORS middleware + HTTPS Cross-origin requests locked to allowed origins
πŸ“¦ Payload Size bodyParser 30 MB limit High-res images handled without 413 errors
☁️ Scalability Decoupled Vercel + Render Frontend & backend scale and deploy independently

8. πŸ“‚ Project Structure

πŸ“Έ Rewind/
β”‚
β”œβ”€β”€ πŸ’» client/                        # React Frontend
β”‚   β”œβ”€β”€ πŸ“ public/                    # Static assets & index.html
β”‚   └── 🧩 src/
β”‚       β”œβ”€β”€ πŸ“‘ api/
β”‚       β”‚   └── index.js              # Axios service β€” base URL + all API calls
β”‚       β”œβ”€β”€ ⚑ actions/
β”‚       β”‚   └── posts.js              # Redux async action creators (thunks)
β”‚       β”œβ”€β”€ πŸ”„ reducers/
β”‚       β”‚   └── posts.js              # Redux state reducer β€” handles all post actions
β”‚       β”œβ”€β”€ 🎨 components/
β”‚       β”‚   β”œβ”€β”€ 🏠 Home/              # Memory feed + layout
β”‚       β”‚   β”œβ”€β”€ πŸƒ Posts/             # Post grid container
β”‚       β”‚   β”‚   └── Post/             # Individual memory card
β”‚       β”‚   └── ✍️ Form/              # Create & Edit memory form
β”‚       β”œβ”€β”€ 🎨 styles/                # CSS-in-JS (MUI makeStyles)
β”‚       └── 🏠 App.js                 # Root component + routes
β”‚   └── πŸ“¦ package.json
β”‚
β”œβ”€β”€ πŸ”Œ server/                        # Node.js / Express Backend
β”‚   β”œβ”€β”€ πŸŽ›οΈ controllers/
β”‚   β”‚   └── posts.js                  # CRUD logic β€” getPosts, createPost, updatePost, deletePost, likePost
β”‚   β”œβ”€β”€ πŸ“‹ models/
β”‚   β”‚   └── postMessage.js            # Mongoose schema & model
β”‚   β”œβ”€β”€ πŸ›£οΈ routes/
β”‚   β”‚   └── posts.js                  # Express route definitions β†’ controller bindings
β”‚   β”œβ”€β”€ πŸ”’ .env                       # Environment secrets (git-ignored)
β”‚   └── 🏠 index.js                   # Express app entry β€” middleware, CORS, DB connect
β”‚
β”œβ”€β”€ πŸ“Έ screenshots/                   # UI screenshots for README
β”‚   β”œβ”€β”€ 🏠 home.png
β”‚   β”œβ”€β”€ ✍️ create.png
β”‚   └── πŸƒ card.png
β”‚
└── πŸ“„ README.md

9. πŸ“¦ Getting Started

Get your own Rewind instance running locally in under 5 minutes.

9.1 πŸ”§ Prerequisites

πŸ› οΈ Tool πŸ“Œ Version πŸ”— Link
Node β‰₯ 16.x nodejs.org
npm β‰₯ 8.x Bundled with Node
Git any git-scm.com
πŸ—„οΈ MongoDB Atlas free tier mongodb.com/atlas

9.2 ⬇️ Clone & Install

πŸ“₯ Step 1 β€” Clone the repo

git clone https://github.com/salonyranjan/rewind-memories-app.git
cd rewind-memories-app

πŸ“¦ Step 2 β€” Install backend dependencies

cd server
npm install

πŸ“¦ Step 3 β€” Install frontend dependencies

cd ../client
npm install --legacy-peer-deps
# --legacy-peer-deps resolves peer dependency conflicts from Material-UI v4

9.3 πŸ”‘ Environment Setup

πŸ” Step 4 β€” Configure backend secrets

Create server/.env:

PORT=5000
CONNECTION_URL=mongodb+srv://<username>:<password>@cluster.mongodb.net/rewindDB

⚠️ Security note: .env is in .gitignore β€” never commit it. Use Render's Environment Variables tab for production secrets.

πŸ”— Step 5 β€” Point frontend to local API

In client/src/api/index.js, set:

const API = axios.create({ baseURL: 'http://localhost:5000' });

Remember to revert this to your Render URL before deploying.

9.4 πŸ–₯️ Run Locally

πŸ”Œ Step 6 β€” Start the backend

# Inside /server
npm start
# β†’ API running at http://localhost:5000

βš›οΈ Step 7 β€” Start the frontend (new terminal)

# Inside /client
npm start
# β†’ App running at http://localhost:3000

10. ☁️ Cloud Deployment

This project implements a Hybrid Multi-Cloud Strategy β€” Vercel's edge network for the frontend, Render's persistent Node.js environment for the backend.

10.1 πŸ”΅ Backend β€” Render

1. Create a new Web Service on Render
2. Root Directory: server
3. Build Command: npm install
4. Start Command: node index.js
5. Environment Variables:
   └── CONNECTION_URL = your MongoDB Atlas URI

⚠️ CORS: Ensure your Render URL is whitelisted in server/index.js:

app.use(cors({ origin: 'https://your-app.vercel.app' }));

10.2 ⚫ Frontend β€” Vercel

1. Import repo on vercel.com β†’ Set Root Directory to client
2. Environment Variables:
   └── CI = false   (suppresses build warnings as errors)
3. Ensure client/src/api/index.js points to your live Render URL
4. Click Deploy βœ…

πŸ”„ Vercel auto-redeploys on every git push to main.


11. ⚑ Performance & Optimisation

πŸ“Š Metric 🎯 Value πŸ”¬ Implementation
🌐 Frontend Latency ~40ms Vercel global edge CDN
πŸ”Œ API Response ~120ms Render persistent Node.js
πŸ—„οΈ DB Uptime 99.9% MongoDB Atlas free tier SLA
πŸ“¦ Payload Limit 30 MB Custom bodyParser config
πŸ”„ Like UX 0ms perceived Optimistic Redux state update
⚑ Bundle Size Minimised Lazy-loaded React components
πŸ” Re-render Control Selective Redux prevents unnecessary feed re-renders
🌐 API Calls Single-trip GET All metadata + images in one request

12. πŸ—ΊοΈ Roadmap

Status πŸš€ Feature 🎯 Priority
βœ… CRUD β€” Create, Read, Update, Delete memories πŸ”΄ Core
βœ… Optimistic Redux like system πŸ”΄ Core
βœ… Base64 image handling with preview πŸ”΄ Core
βœ… Decoupled Vercel + Render deployment πŸ”΄ Core
πŸ”„ Google OAuth 2.0 β€” secure user authentication 🟑 High
πŸ”„ Search & Pagination β€” discover large memory collections 🟑 High
πŸ”„ Cloudinary CDN β€” replace Base64 with dedicated image hosting 🟑 High
πŸ“… Dark Mode Toggle β€” accessibility & user preference 🟒 Planned
πŸ“… Comment System β€” threaded replies per memory 🟒 Planned
πŸ“… Memory Detail Page β€” full-screen single memory view 🟒 Planned
πŸ’‘ Stories Mode β€” auto-play slideshow of memories πŸ”΅ Idea
πŸ’‘ Private Collections β€” visibility controls per post πŸ”΅ Idea

πŸ’¬ Open a feature request β†’


13. 🀝 Contributing

All contributions are warmly welcome! πŸ“Έ

# 1. Fork the repository on GitHub
# 2. Create your feature branch
git checkout -b feature/your-feature

# 3. Commit with conventional format
git commit -m "feat: add your feature"
# Prefixes: fix: | docs: | style: | refactor: | test: | chore:

# 4. Push & open a PR
git push origin feature/your-feature

Priority areas:

πŸ”₯ Area πŸ“ What's Needed
πŸ” Auth Google OAuth 2.0 via Passport.js or Firebase
πŸ–ΌοΈ Images Cloudinary SDK replacing Base64 storage
πŸ” Search Server-side tag & text search with pagination
πŸ§ͺ Tests Jest + React Testing Library for components
πŸŒ™ UI Dark mode with MUI ThemeProvider

14. ❓ FAQ

πŸ”Œ Why does the API take a few seconds to respond on first load?

The backend is hosted on Render's free tier, which spins down after 15 minutes of inactivity. The first request "cold-starts" the service β€” this takes 30–60 seconds. Subsequent requests are fast. Upgrade to Render's paid plan to eliminate cold starts in production.

πŸ–ΌοΈ Why are images stored as Base64 and not uploaded to a CDN?

Base64 storage in MongoDB keeps the architecture simple for a portfolio project β€” no third-party image service setup required. The trade-off is document size and query performance at scale. Cloudinary integration is on the Roadmap as the recommended migration path.

⚠️ Why do I need --legacy-peer-deps for the frontend install?

The project uses Material-UI v4 which has peer dependency conflicts with newer versions of React. The --legacy-peer-deps flag tells npm to use the older dependency resolution algorithm that ignores these conflicts. Everything works correctly at runtime.

πŸ” How does CORS work between Vercel and Render?

The Express server uses the cors npm package as middleware. It's configured to whitelist the Vercel frontend origin (*.vercel.app), blocking any other cross-origin requests. This prevents unauthorised clients from hitting the API directly.


15. πŸ“„ Changelog

Version Highlights
πŸ†• v2.0.0 Decoupled multi-cloud Β· Optimistic Redux likes Β· Base64 image preview Β· CORS middleware
v1.5.0 Material-UI design system Β· Tag chips Β· Mongoose schema validation Β· Render deploy
v1.0.0 πŸŽ‰ Initial MERN CRUD β€” create, read, update, delete memories on MongoDB Atlas

16. πŸ‘€ Author

Salony Ranjan

✦ Salony Ranjan

πŸ§‘β€πŸ’» Full-Stack MERN Developer Β Β·Β  πŸ€– AI Engineer Β Β·Β  🎨 UI/UX Specialist

"Building full-stack experiences that feel instant, look beautiful, and scale cleanly."


Β  Β  Β 

17. ⭐ Show Your Support

If Rewind helped you learn MERN, inspired your own project, or just made you smile β€” show it some love! πŸ“Έ

πŸ’‘ Pro Tip: Go to GitHub repo Settings β†’ Social Preview and upload the home screenshot. When you share on LinkedIn, your Memory Feed UI shows instead of a generic GitHub card.

Β  Β  Β 




Made with πŸ“Έ by Salony Ranjan Β Β·Β  Β© 2026 Rewind Β· MIT

About

πŸ“Έ Rewind - A full stack social media application built with React, Redux, and Node.js. Features seamless image sharing and real-time "memory" management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors