A web application for discovering, organizing, and tagging photos using the Unsplash API.
- Search for photos using Unsplash API
- Create and manage user accounts
- Save photos to collections
- Add custom tags to photos
- Search photos by tags
- Track and display search history
- Sort photos by date saved
- Backend: Node.js, Express
- Database: Sequelize (SQLite)
- API: Unsplash
- Testing: Testing framework
-
Clone the repository:
git clone https://github.com/Mayank17j/Photo-organizer.git cd Photo-organizer -
Install dependencies:
npm install
-
Create a
.envfile with your Unsplash API key:UNSPLASH_ACCESS_KEY=your_unsplash_access_key_here -
Set up the database:
npx sequelize-cli db:migrate
-
Start the server:
npm start
POST /user- Create a new userGET /user/:id- Get user by ID
GET /search/photos?query={term}- Search photos on UnsplashPOST /photos- Save photo to collectionPOST /photos/:photoId/tags- Add tags to a photoGET /photos/tag/search?tags={tag}&sort={ASC|DESC}&userId={id}- Search photos by tag
GET /search-history?userId={id}- Get user's search history
- Stores user information (username, email)
- Has many Photos
- Stores photo details (imageUrl, description, altDescription)
- Belongs to User
- Has many Tags
- Stores tag names associated with photos
- Belongs to Photo
- Tracks user search queries
- Belongs to User
npm startnpm testUNSPLASH_ACCESS_KEY: Your Unsplash API access keyPORT: Server port (default: 4001)
picstoria/
├── controllers/ # Route controllers
│ ├── dataController.js # Database operations
│ └── userController.js # Unsplash API operations
├── models/ # Sequelize models
├── service/ # Business logic
│ └── fileService.js # Validation services
├── lib/ # Library files
│ └── axios.lib.js # Axios configuration
├── index.js # Main application file
└── .env # Environment variables
curl -X POST http://localhost:4001/user \
-H "Content-Type: application/json" \
-d '{"username":"testuser","email":"test@example.com"}'curl "http://localhost:4001/search/photos?query=nature"curl -X POST http://localhost:4001/photos \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://images.unsplash.com/photo-...",
"description": "Beautiful landscape",
"altDescription": "Mountain view",
"tags": ["nature", "mountain"],
"userId": 1
}'- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a pull request
Distributed under the MIT License. See LICENSE for more information.
- Unsplash for their free photo API
- Sequelize for ORM support
- Express for the web framework