SecrecyNote is a sleek and secure web application for sending private, encrypted notes. Built with Next.js, TypeScript, and Prisma, this open-source project provides a user-friendly interface for creating and sharing self-destructing, encrypted messages.
- Create encrypted notes with customizable expiration settings
- Password protection for added security
- Self-destructing notes that delete after viewing or a set time period
- Dark mode support
- Responsive design for desktop and mobile devices
- Next.js - React framework for server-side rendering and static site generation
- TypeScript - Typed superset of JavaScript
- Prisma - Next-generation ORM for Node.js and TypeScript
- PostgreSQL - Open-source relational database
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Re-usable components built with Radix UI and Tailwind CSS
- Node.js (v14 or later)
- npm or yarn
- PostgreSQL database
- Docker and Docker Compose (optional, for containerized deployment)
Before running the application, you need to set up your environment variables:
-
Copy the example environment file:
cp .env.example .env
-
Update the
.env
file with your configuration:# Database connection string DATABASE_URL="postgresql://postgres:postgres@localhost:5432/securenotes?schema=public" # 32-character encryption key for securing notes ENCRYPTION_KEY="your_32_character_secret_key_here"
Note: Make sure to generate a secure 32-character encryption key for production use.
-
Clone the repository:
git clone https://github.com/youssefbrr/SecrecyNote.git cd SecrecyNote
-
Install dependencies:
npm install # or yarn install
-
Run database migrations:
npx prisma migrate dev
-
Start the development server:
npm run dev # or yarn dev
-
Open http://localhost:3000 in your browser to see the application.
-
Clone the repository:
git clone https://github.com/youssefbrr/SecrecyNote.git cd SecrecyNote
-
Copy the example environment file and configure it:
cp .env.example .env
-
Choose your deployment mode:
Production Mode:
# Build and run for production npm run docker:prod
Development Mode with Hot Reload:
# Build and run for development with hot reload npm run docker:dev
Both modes will:
- Start a PostgreSQL database container
- Build and start the SecrecyNote application
- Make the application available on port 3001
The key difference is that development mode:
- Enables hot reload (changes to your code are reflected immediately)
- Mounts your local code into the container
- Uses a separate database volume for development
-
Access the application at http://localhost:3001
To stop the containers:
# For production
npm run docker:prod:down
# For development
npm run docker:dev:down
To view logs:
# For production
docker-compose logs -f
# For development
docker-compose -f docker-compose.dev.yml logs -f
To rebuild the containers after making changes to Dockerfile or dependencies:
# For production
docker-compose up -d --build
# For development
docker-compose -f docker-compose.dev.yml up -d --build
The application provides two Docker Compose configurations:
-
Production Mode (
docker-compose.yml
):- Optimized for production use
- Multi-stage build for smaller image size
- No source code mounting
- Standalone Next.js server
-
Development Mode (
docker-compose.dev.yml
):- Hot reload enabled
- Source code mounted from host
- Faster rebuild times
- Ideal for development and testing
Each configuration includes:
-
app: The Next.js application
- Runs on port 3001 (host) -> 3000 (container)
- Depends on the database service
-
db: PostgreSQL database
- Uses PostgreSQL 15
- Runs on port 5432
- Includes health checks
- Persists data using Docker volumes
SecrecyNote is designed to be easily deployed to Vercel. Follow these steps to deploy your own instance:
- Fork this repository
- Create a new project on Vercel and link it to your forked repository
- Add the required environment variables (
DATABASE_URL
andENCRYPTION_KEY
) in the Vercel project settings - Deploy the project
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is open source and available under the MIT License.
Created with ❤️ by youssefbrr