Skip to content

Nsanjayboruds/RIVETO

Repository files navigation

RIVETO

MIT License Issues Stars OpenSSF Best Practices

πŸ“‘ Table of Contents


πŸš€ Overview

RIVETO is a modern, fullstack web application built for scalability, advanced analytics.
It features a robust admin panel for management, user tracking, advanced UI components, and secure file/image upload via Cloudinary.


πŸ› οΈ Tech Stack

  • Frontend: React, Tailwind CSS
  • Backend: Node.js, Express.js
  • Database: MongoDB (Mongoose ODM)
  • Tracking: Custom analytics & event tracking
  • UI: Advanced, responsive design with Tailwind
  • Image Uploads: Cloudinary for secure and performant media management

πŸ—οΈ Architecture

image

βš™οΈ Features

  • πŸ“Š Admin Panel: Manage users, payments, analytics, and more
  • πŸ“ˆ Advanced Tracking: User behavior, transactions, and event analytics
  • 🎨 Modern UI: Responsive, accessible, and beautiful interface (Tailwind)
  • πŸ–ΌοΈ Cloudinary Image Upload: Fast, secure, and optimized media storage
  • πŸ” Authentication & Authorization: Secure user and admin access
  • πŸ“ RESTful API: Powerful backend for frontend and mobile clients

🚦 Quick Start

1. Clone the repository

git clone https://github.com/Nsanjayboruds/RIVETO.git
cd RIVETO

2. Set up the environment

  • Copy and edit environment files:
    • For backend:
      cp backend/.env.example backend/.env
    • For frontend:
      cp frontend/.env.example frontend/.env
  • Fill in your MongoDB, Razorpay keys, Cloudinary credentials, JWT secrets, etc.

3. Install dependencies

# In root
cd backend
npm install

cd ../frontend
npm install

4. Start development servers

Open two separate terminal windows to run the servers simultaneously:

Terminal 1 (Backend):

cd backend
npm run dev

πŸ–ΌοΈ Image Upload with Cloudinary

Backend Integration

  • Uses the cloudinary npm package.
  • Secure image upload endpoints with authentication/middleware.
  • Stores Cloudinary URLs in MongoDB model fields.

Sample Endpoint (Express.js):

// /backend/routes/upload.js
const { CloudinaryStorage } = require("multer-storage-cloudinary");
const multer = require("multer");
const cloudinary = require("cloudinary").v2;

// Cloudinary config (use your .env)
cloudinary.config({
  cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
  api_key: process.env.CLOUDINARY_API_KEY,
  api_secret: process.env.CLOUDINARY_API_SECRET,
});

const storage = new CloudinaryStorage({
  cloudinary,
  params: {
    folder: "riveto_uploads",
    allowed_formats: ["jpg", "png", "jpeg", "svg", "webp"],
  },
});
const upload = multer({ storage });

router.post("/upload", upload.single("image"), (req, res) => {
  res.json({ url: req.file.path });
});

Frontend Integration

  • Use a file input and upload images using a form or fetch/Axios to the backend /upload endpoint.
  • Store the returned Cloudinary URL for use in UI or database.

Sample Usage:

const handleUpload = async (event) => {
  const formData = new FormData();
  formData.append("image", event.target.files[0]);
  const response = await fetch("/api/upload", {
    method: "POST",
    body: formData,
  });
  const data = await response.json();
  setImageUrl(data.url); // Save/display Cloudinary URL
};

πŸ§ͺ Testing

Run lint checks:

npm run lint

πŸ“‚ Project Structure

RIVETO/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controller/
β”‚   β”œβ”€β”€ model/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ .env.example
β”‚   └── ...
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── App.jsx
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ .env.example
β”‚   └── ...
β”œβ”€β”€ README.md
└── ...

πŸ›‘οΈ Environment Configuration

Backend (backend/.env.example)

MONGODB_URI=
JWT_SECRET=
BASE_URL=http://localhost:5000

CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

Frontend (frontend/.env.example)

REACT_APP_API_URL=http://localhost:5000/api
REACT_APP_RAZORPAY_KEY=

🎨 UI/UX

  • Fully responsive admin panel
  • Advanced dashboard with analytics charts
  • Dark/light mode with Tailwind CSS
  • Custom components for user and payment management

πŸ“ˆ Tracking

  • Custom event logging and analytics
  • Admin dashboard for real-time tracking

🀝 Feedback and Community

We welcome bug reports, feature requests, and community feedback.

πŸ› Report Issues

If you find a bug or security issue, please open an issue on GitHub with:

  • Steps to reproduce
  • Expected behavior
  • Screenshots/logs if applicable

GitHub Issues: https://github.com/Nsanjayboruds/RIVETO/issues

πŸ’‘ Feature Requests

Have an idea for improving RIVETO? Open a feature request issue and describe your suggestion.

πŸ’¬ Discussions

Use GitHub Discussions for:

  • Questions
  • Community help
  • Project ideas
  • Feedback

GitHub Discussions: https://github.com/Nsanjayboruds/RIVETO/discussions

πŸ“ Contribution Guidelines

Before contributing, please star the repository ⭐

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/YourFeature)
  3. Commit your changes (git commit -m 'Add feature')
  4. Push to the branch (git push origin feature/YourFeature)
  5. Open a Pull Request

Please review CONTRIBUTING.md for details.


🌟 Our Amazing Contributors

Thank you to all contributors who have helped make RIVETO better! πŸš€

πŸ† Special Recognition

  • 🎯 First Contributor: Madhav Majumdar (@madhav2348) - For being the first to join and contribute to RIVETO!
  • πŸ’‘ Most Innovative: Md Ashad (@asadanwarr0) - For enhancing the About, Contact, and Home sections.
  • 🎨 UI/UX Champion: Vedant (@vedantbudhabaware) - For fixing critical UI issues and optimizing the mobile experience.

Want to see your name here? Check out our Contributing Guide!


πŸš€ Deployment

  • Docker Compose and cloud deployment instructions coming soon!
  • Easily deploy to Vercel (frontend) and Render or Heroku (backend).

πŸ“ License

MIT License. See LICENSE for details.


πŸ™‹β€β™‚οΈ Contact


Built with React, Tailwind, Node.js, Express, MongoDB, Razorpay, and Cloudinary

πŸ” Authentication Flow

This project implements a secure JWT refresh token flow with rotation:

  • Login
    Issues an access token (15 minutes expiry) and a refresh token (7 days expiry).
    Refresh tokens are hashed and stored in MongoDB.

  • Refresh
    POST /api/auth/refresh rotates the refresh token on each use.
    Old tokens are invalidated, new ones are stored.

  • Logout
    POST /api/auth/logout clears both cookies and deletes the refresh token from DB.
    This ensures sessions cannot be reused after logout.

  • Google & Admin Login
    Both flows now issue access + refresh tokens, aligned with the same rotation/invalidation logic.

Security Notes

  • All cookies are httpOnly, secure, and sameSite aware.
  • Refresh tokens are hashed with bcrypt before storage.
  • Expired or invalid tokens return 403 Forbidden.

Testing

Run the Jest test suite to validate login, refresh, and logout flows:

npm test

About

RIVETO is a full-stack web application built with separate frontend and backend modules. The frontend manages the user interface using modern web technologies (HTML, CSS, JavaScript). The backend handles server-side logic, APIs, and data management. This project serves as a foundation for building scalable web applications with a clear separation

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

29 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages