PicWall is a modern image sharing platform built with Next.js where users can share photos, explore content, like posts, and interact with other users.
-
User Authentication
- Login with email/password
- Social logins (GitHub, Google)
- User profiles
-
Image Sharing
- Upload and share images
- Add captions to posts
- Like and comment on posts
-
Explore Feed
- Infinite scrolling feed of images
- Discover content from other users
-
Responsive Design
- Works on mobile, tablet, and desktop devices
- Optimized UI for different screen sizes
- Progressive Web App (PWA) - install as a mobile application
PicWall can be installed as a mobile application on your device:
-
Direct Download:
- Download the APK from Google Drive
- Open the APK file on your Android device to install
-
Install from Browser (PWA):
- Visit the PicWall website on your mobile device
- For iOS: Tap the Share button, then "Add to Home Screen"
- For Android: Tap the menu button, then "Install App" or "Add to Home Screen"
Using the PWA version provides an app-like experience with offline capabilities and faster loading times.
- Node.js 20.x or later
- npm or yarn
- MongoDB database (or MongoDB Atlas account)
- AWS S3 bucket for image storage
- OAuth credentials (GitHub, Google) for social login
Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_API_URL=http://localhost:3000
# MongoDB connection
MONGODB_URI=your_mongodb_connection_string
# Authentication
BETTER_AUTH_SECRET=your_auth_secret
BETTER_AUTH_BASE_URL=http://localhost:3000
# GitHub OAuth
GITHUB_ID=your_github_client_id
GITHUB_SECRET=your_github_client_secret
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# AWS S3 configuration
AWS_REGION=your_aws_region
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_S3_BUCKET_NAME=your_s3_bucket_name
- Clone the repository
- Install dependencies:
npm install
# or
yarn install- Run the development server:
npm run dev
# or
yarn dev- Open http://localhost:3000 in your browser to see the application.
- Navigate to the login page
- Choose to sign up with email or use social login
- Complete your profile setup
- Click the "+" button in the feed
- Upload an image from your device
- Add a caption (optional)
- Submit your post
- Like posts by clicking the heart icon
- Add comments to engage with other users
- Explore new content in the discover feed
- Frontend: Next.js, React, TailwindCSS, shadcn/ui
- Backend: Next.js API routes, MongoDB/Mongoose
- Authentication: better-auth
- Storage: AWS S3 for image uploads
- Deployment: Easily deployable on Vercel
- POST /api/auth/[...all]
- Handles all authentication operations via better-auth
- Supports login, registration, OAuth callbacks, session management
- Returns JWT token for authenticated requests
-
GET /api/user
- Query Parameters:
id: User ID (string)email: User email (string)
- Response: User object with profile information
- Authentication: Not required
- Query Parameters:
-
PUT /api/user
- Body:
id: User ID (string, required)name: Updated name (string, optional)bio: Updated bio (string, optional)image: Updated profile image URL (string, optional)
- Response: Updated user object
- Authentication: Required (can only update own profile)
- Body:
-
GET /api/users
- Query Parameters:
ids: Comma-separated list of user IDs
- Response: Array of user objects
- Authentication: Not required
- Query Parameters:
-
GET /api/posts
- Query Parameters:
limit: Number of posts to return (default: 50)skip: Number of posts to skip for pagination (default: 0)userId: Filter posts by user ID (optional)sort: Sort order, either "latest" or "popular" (default: "latest")
- Response: Array of posts with pagination info
- Authentication: Not required
- Query Parameters:
-
GET /api/post
- Query Parameters:
id: Post ID (optional)userId: User ID to filter posts by (optional)limit: Number of posts to return (default: 10)skip: Number of posts to skip for pagination (default: 0)
- Response: Single post or array of posts
- Authentication: Not required
- Query Parameters:
-
POST /api/post
- Body:
userId: ID of the post creator (string, required)image: Image URL (string, required)caption: Post caption (string, optional)
- Response: Created post object
- Authentication: Required
- Body:
-
PUT /api/post
- Query Parameters:
id: Post ID to update
- Body:
caption: Updated caption (optional)userId: User ID making the request (required)action: Action to perform: "like", "unlike", or "comment" (optional)comment: Comment text (required if action is "comment")
- Response: Updated post object
- Authentication: Required
- Query Parameters:
-
DELETE /api/post
- Query Parameters:
id: Post ID to delete
- Body:
userId: User ID making the request (required)
- Response: Success message
- Authentication: Required (can only delete own posts)
- Query Parameters:
- POST /api/upload
- Body:
image: Base64 encoded image data
- Response: Uploaded image URL
- Authentication: Required
- Limits: 10MB maximum file size
- Body:
npm run build
# or
yarn buildnpm run start
# or
yarn startThis project includes comprehensive end-to-end tests using Playwright. The tests cover all major user flows including:
- Authentication (login, signup, logout)
- Post creation and interaction (creating, viewing, liking, commenting)
- Navigation and UI functionality
- End-to-end user journey
To run the tests, first make sure you have installed the dependencies:
# Install dependencies
npm install
# Install Playwright browsers
npx playwright installThen you can run the tests using one of the following commands:
# Run all tests
npm test
# Run tests with UI mode (for visual debugging)
npm run test:ui
# Run tests in debug mode
npm run test:debug
# Run specific test suites
npm run test:e2e # End-to-end flow
npm run test:auth # Authentication tests
npm run test:posts # Post functionality tests
npm run test:nav # Navigation testsThe tests are located in the tests directory:
tests/utils.ts- Utility functions for common test operationstests/auth.spec.ts- Authentication teststests/posts.spec.ts- Post functionality teststests/navigation.spec.ts- Navigation and UI teststests/e2e.spec.ts- End-to-end user journey test
For more details, see the tests/README.md file.
This project is licensed under the MIT License - see the LICENSE file for details.