Skip to content

vishwa-vigneshwar/codealpha_tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cloud-Based Photo Gallery

A cloud-based photo gallery application where users can upload, view, and organize their photos. The application uses AWS S3 for storing images and provides user authentication for secure access.

Features

  • User registration and authentication
  • Photo upload and storage using AWS S3
  • Viewing and organizing photos
  • User-specific photo collections

Tech Stack

  • Backend: Node.js, Express, MongoDB
  • Frontend: React, Axios, React Router
  • Cloud Services: AWS S3

Project Structure

photo-gallery/
├── src/
│   ├── models/
│   │   └── User.js
│   │   └── Photo.js
│   ├── routes/
│   │   └── auth.js
│   │   └── photos.js
│   ├── controllers/
│   │   └── authController.js
│   │   └── photoController.js
│   ├── config/
│   │   └── db.js
│   │   └── aws.js
│   ├── middleware/
│   │   └── auth.js
│   └── app.js
├── .env
└── package.json

Getting Started

Prerequisites

  • Node.js
  • npm
  • MongoDB
  • AWS S3 account

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/photo-gallery.git
    cd photo-gallery
  2. Install backend dependencies:

    npm install
  3. Create a .env file in the root directory and add your environment variables:

    PORT=5000
    MONGO_URI=your_mongodb_uri
    AWS_ACCESS_KEY_ID=your_aws_access_key
    AWS_SECRET_ACCESS_KEY=your_aws_secret_key
    S3_BUCKET_NAME=your_s3_bucket_name
    
  4. Set up the frontend:

    npx create-react-app photo-gallery-client
    cd photo-gallery-client
    npm install axios react-router-dom

Running the Application

  1. Start the backend server:

    npm run dev
  2. Start the frontend development server:

    cd photo-gallery-client
    npm start

API Endpoints

Authentication

  • Register: POST /api/auth/register
  • Login: POST /api/auth/login

Photos

  • Upload Photo: POST /api/photos/upload
  • Get Photos: GET /api/photos

Contributing

Contributions are welcome! Please create an issue or submit a pull request for any improvements or new features.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published