Skip to content

Devanshukoli/resource-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Resource Stack - A Modern Web Application for Managing Resources

A full-stack web application for organizing and managing various types of resources (images, videos, text, links, etc.) with a beautiful stack-based UI.

Live Demo: Coming Soon

🎯 Features

  • βœ… Stack-based UI: Organize resources in a visual stack
  • βœ… Checkbox Layer: Mark resources as completed
  • βœ… Editable Resources: Edit resource title and content anytime
  • βœ… Feedback System: Add notes/feedback before removing resources
  • βœ… Multi-media Support: Store text, links, images, videos, and more
  • βœ… Persistent Storage: MongoDB database integration
  • βœ… RESTful API: Complete backend API with Express.js
  • βœ… Modern UI: React + Vite with beautiful styling
  • βœ… Responsive Design: Works on desktop, tablet, and mobile

πŸ› οΈ Tech Stack

Frontend

  • React 18 - UI framework
  • Vite - Build tool and dev server
  • Axios - HTTP client for API calls
  • CSS3 - Styling with modern features

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB ODM
  • CORS - Cross-origin resource sharing

πŸ“‚ Project Structure

resource-stack/
β”œβ”€β”€ frontend/           # React + Vite application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/ # React components
β”‚   β”‚   β”œβ”€β”€ App.jsx     # Main App component
β”‚   β”‚   β”œβ”€β”€ main.jsx    # Entry point
β”‚   β”‚   └── index.css   # Global styles
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”œβ”€β”€ backend/            # Node.js + Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/     # Database config
β”‚   β”‚   β”œβ”€β”€ models/     # Mongoose models
β”‚   β”‚   β”œβ”€β”€ routes/     # API routes
β”‚   β”‚   └── controllers/# Route handlers
β”‚   β”œβ”€β”€ server.js       # Express server
β”‚   └── package.json
└── README.md          # This file

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or later)
  • MongoDB (local installation or MongoDB Atlas)
  • npm or yarn

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Create a .env file based on .env.example:

    cp .env.example .env
  4. Update .env with your MongoDB connection string:

    MONGODB_URI=mongodb://localhost:27017/resource-stack
    PORT=5000
    NODE_ENV=development
    CORS_ORIGIN=http://localhost:5173
  5. Start the backend server:

    npm run dev

    The server will run on http://localhost:5000

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

    The application will be available at http://localhost:5173

πŸ“– API Documentation

Resources Endpoints

Get All Resources

GET /resources
Response: Array of Resource objects

Get Single Resource

GET /resources/:id
Response: Resource object

Create Resource

POST /resources
Body: { title, content, isChecked?, feedback? }
Response: Created Resource object

Update Resource

PUT /resources/:id
Body: { title?, content?, feedback?, isChecked? }
Response: Updated Resource object

Toggle Check Status

PATCH /resources/:id/check
Body: { isChecked: boolean }
Response: Updated Resource object

Delete Resource

DELETE /resources/:id
Response: { message: "Resource deleted successfully" }

πŸ“Š Resource Model

{
  _id: ObjectId,
  title: String,              // Resource title (max 200 chars)
  content: String,            // Resource content (text, links, etc)
  feedback: String,           // Notes/feedback before deletion
  isChecked: Boolean,         // Completion status
  createdAt: Date,           // Creation timestamp
  updatedAt: Date            // Last update timestamp
}

🎨 Component Structure

Frontend Components

  • App: Main application component, handles state and API communication
  • ResourceStack: Container for all resources
  • ResourceCard: Individual resource display with edit/delete actions
  • AddResourceForm: Form to add new resources
  • FeedbackModal: Modal for adding feedback before deletion

πŸ”§ Configuration

Environment Variables

Backend (.env)

MONGODB_URI=mongodb://localhost:27017/resource-stack
PORT=5000
NODE_ENV=development
CORS_ORIGIN=http://localhost:5173

Frontend (vite.config.js)

  • API proxy is configured to forward requests to http://localhost:5000

πŸ“ Usage

  1. Add Resource: Click "Add New Resource", fill in title and content, and click "Add Resource"
  2. Edit Resource: Click "Edit" on any resource card to modify its content
  3. Check Resource: Click the checkbox to mark a resource as completed
  4. Remove Resource: Click "Remove" to delete a resource. A modal will open for feedback
  5. Add Feedback: (Optional) Type feedback or notes before confirming deletion

πŸš€ Production Build

Frontend

cd frontend
npm run build

This creates an optimized build in dist/ directory.

Backend

Set NODE_ENV=production and ensure MongoDB is properly configured for production use.

πŸ› Troubleshooting

MongoDB Connection Error

  • Ensure MongoDB is running locally or check your connection string
  • For MongoDB Atlas, use the full connection string with credentials

CORS Errors

  • Check that frontend URL matches CORS_ORIGIN in backend .env
  • Ensure both servers are running on the correct ports

API not responding

  • Verify backend server is running on port 5000
  • Check network tab in browser DevTools for error details

πŸ“„ License

This project is licensed under the MIT License. See LICENSE file for details.

🀝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“§ Support

For issues or questions, please open an issue on GitHub or contact the development team.


Happy resource organizing! πŸŽ‰

About

just fun project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors