A Next.js application for creating and sharing beautiful digital postcards with enhanced features.
- User Authentication: Secure login and registration with NextAuth.js
- Beautiful Templates: Choose from a variety of professionally designed templates
- Rich Text Editor: Create personalized messages with formatting options
- Image Upload: Add your own images to postcards
- Sharing Options: Share via email, social media, or direct link
- Public/Private Settings: Control who can see your postcards
- Scheduled Sending: Schedule postcards to be sent on special occasions
- Real-time Collaboration: Create postcards together with friends and family
- Analytics: Track views and interactions with your postcards
- Mobile Responsive: Works great on all devices
- Dark Mode Support: Choose between light and dark themes
- Frontend: Next.js 14 with App Router, React, TypeScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js
- Database: PostgreSQL with Prisma ORM
- State Management: React Hooks and Context API
- UI Components: Custom components with Radix UI primitives
- Deployment: Ready for Vercel deployment
- Node.js 18+ and npm/yarn
- PostgreSQL database
-
Clone the repository:
git clone https://github.com/yourusername/cardwave.git cd cardwave -
Install dependencies:
npm install # or yarn install -
Set up environment variables:
- Copy
.env.exampleto.env - Update the database connection string and other variables
- Copy
-
Set up the database:
npx prisma migrate dev
-
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser.
-
Create a PostgreSQL database using Amazon RDS:
- Go to the AWS Management Console
- Navigate to RDS
- Click "Create database"
- Select PostgreSQL
- Configure settings (choose a DB instance identifier, username, and password)
- Make sure to note down the endpoint, port, username, and password
-
Update your
.envfile with the RDS connection string:DATABASE_URL="postgresql://username:password@your-rds-endpoint:5432/cardwave"
-
Create a NextAuth secret:
- You can generate a secure random string using:
openssl rand -base64 32
- Add it to your
.envfile:NEXTAUTH_SECRET="your-generated-secret" NEXTAUTH_URL="http://localhost:3000" # For development
- You can generate a secure random string using:
-
Set up Google OAuth (optional):
- Go to the Google Cloud Console
- Create a new project
- Navigate to "APIs & Services" > "Credentials"
- Create OAuth client ID credentials
- Add authorized JavaScript origins and redirect URIs
- Add the credentials to your
.envfile:GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret"
-
Create an S3 bucket:
- Go to the AWS Management Console
- Navigate to S3
- Create a new bucket with appropriate permissions
- Enable CORS for your domain
-
Create IAM credentials:
- Go to IAM in the AWS Console
- Create a new user with programmatic access
- Attach the AmazonS3FullAccess policy (or create a custom policy with limited permissions)
- Note down the access key and secret
-
Add S3 credentials to your
.envfile:AWS_S3_BUCKET_NAME="your-bucket-name" AWS_S3_REGION="your-bucket-region" AWS_ACCESS_KEY_ID="your-access-key" AWS_SECRET_ACCESS_KEY="your-secret-key"
When deploying to production:
- Update the
NEXTAUTH_URLto your production URL - Consider using AWS Secrets Manager or Parameter Store to securely store your production secrets
- If deploying to Vercel, add all environment variables in the Vercel project settings
cardwave/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ ├── (auth)/ # Authentication pages
│ ├── dashboard/ # User dashboard
│ ├── create/ # Postcard creation
│ ├── postcards/ # Postcard viewing
│ └── page.tsx # Homepage
├── components/ # React components
├── lib/ # Utility functions
├── prisma/ # Database schema
└── public/ # Static assets
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with ❤️ by CardWave Team