diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..449b7d2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules/ +.next/ +.env +.env.local \ No newline at end of file diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 0000000..999cc57 --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,17 @@ +name: PR Comment + +on: + pull_request: + types: [opened] + +jobs: + add_comment: + runs-on: ubuntu-latest + + steps: + - name: Add a "Thank you" comment to new PR + uses: actions-ecosystem/action-add-comment@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + issue_number: ${{ github.event.pull_request.number }} + comment: '🎉 Thank you for your contribution! Your pull request has been submitted successfully. A maintainer from DearDiary team will review it as soon as possible. We appreciate your support in making this project better.' diff --git a/.gitignore b/.gitignore index 925ce47..83541c8 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ yarn-error.log* # local env files .env*.local +.env.example # vercel .vercel diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b5684e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use an official Node.js image as the base image +FROM node:18-alpine + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json first +COPY package*.json ./ + +# Set NODE_ENV to development for the build process +ENV NODE_ENV=development + +# Install dependencies +RUN npm install + +# Copy the rest of the application code +COPY . . + +# Expose the Next.js default port +EXPOSE 3000 + +# Start the Next.js app +CMD ["npm", "run", "dev"] diff --git a/README.md b/README.md index bf30548..5640a36 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,28 @@ Welcome to the **[DearDiary](https://github.com/TenzDelek/DearDiary)** repository! This project is built with **Next.js** and uses **Clerk** for authentication. This guide will walk you through setting up the project and contributing effectively. +## Featured In + + + + + + + + + + + + + + + + + +
Event LogoEvent NameEvent Description
GSSoC Ext 24GirlScript Summer of Code Ext 2024GSSOC Ext is a one-month-long open-source program by the GirlScript Foundation that runs from October 1 to November 10, 2024
Hacktoberfest 24Hacktoberfest 2024Hacktober Fest is an annual celebration of open-source software development. It's a month-long event encouraging developers to contribute to open-source projects.
+ ## Table of Contents + - [Getting Started](#getting-started) - [Project Setup](#project-setup) - [Prerequisites](#prerequisites) @@ -47,6 +68,7 @@ cd DearDiary ``` ### Installing Dependencies + To install all required dependencies, run: ```bash @@ -58,11 +80,11 @@ This command will install Next.js, Clerk, and other necessary libraries. Setting Up Clerk -* Sign Up for Clerk: If you haven’t already, sign up at [Clerk.dev](https://clerk.dev/) and create an application. +- Sign Up for Clerk: If you haven’t already, sign up at [Clerk.dev](https://clerk.dev/) and create an application. -* Get API Keys: Once your application is set up, get your Frontend API Key and Secret Key. +- Get API Keys: Once your application is set up, get your Frontend API Key and Secret Key. -* Add Environment Variables: Create a .env.local file in the root directory: +- Add Environment Variables: Create a .env.local file in the root directory: ```env NEXT_PUBLIC_CLERK_FRONTEND_API= @@ -77,7 +99,6 @@ npm run dev You should be able to access the application at http://localhost:3000 and see Clerk authentication enabled. - ### Running the Project To start the development server, use: @@ -85,8 +106,128 @@ To start the development server, use: ```bash npm run dev ``` + Your local server will be running at http://localhost:3000. +Thank you for pointing that out! Here’s the updated **Docker setup instructions** section for your `README.md`, including the relevant information about the `DATABASE_URL`. + +--- + +## Docker Setup Instructions + +To set up the application using Docker, follow these steps: + +### 1. **Configure the Database URL** + +Ensure that your `.env` file contains the below `DATABASE_URL`. It should be the this: + +```plaintext +DATABASE_URL=postgres://user:password@db:5432/mydatabase +``` + +### 2. **Build and Start Docker Containers** + +To build the Docker images and start the containers, run the following command: + +```bash +npm run docker:setup +``` + +This command will: + +- Build the Docker containers using `docker-compose build`. +- Start the containers using `docker-compose up -d`. +- Run the Prisma migrations to ensure your database is up to date. +- Open **Web App** in your browser at `http://localhost:3000`. +- Open **Prisma Studio** for database management in your browser at `http://localhost:5555`. + +### 3. **Managing Docker Containers** + +You can manage the Docker containers with the following commands: + +- **Start the containers** (if they are stopped): + + ```bash + npm run docker:start + ``` + +- **Stop the containers** (without removing them): + + ```bash + npm run docker:stop + ``` + +- **Restart the containers**: + + ```bash + npm run docker:restart + ``` + +- **Take down the containers** (stop and remove): + + ```bash + npm run docker:down + ``` + +- **Rebuild the containers without using cache**: + ```bash + npm run docker:build --no-cache + ``` + +--- + +## Prisma Commands + +Prisma is used for interacting with your PostgreSQL database. Here are the available Prisma commands: + +### 1. **Run Migrations** + +To apply your Prisma schema and migrate your database, use: + +```bash +npm run prisma:migrate +``` + +This command will run the migrations within the Docker container and update the database schema. + +### 2. **Open Prisma Studio** + +Prisma Studio provides a GUI to explore and edit your database. To open Prisma Studio, run: + +```bash +npm run prisma:studio +``` + +After running the command, open your browser and go to `http://localhost:5555` to access Prisma Studio. + +### 3. **Push Prisma Schema to Database** + +If you've updated your Prisma schema and want to push changes to your database without creating migration files, run: + +```bash +npm run prisma:push +``` + +### 4. **Pull Database Schema into Prisma** + +If your database schema has changed and you want to update your Prisma schema, you can pull the changes with: + +```bash +npm run prisma:pull +``` + +### 5. **Generate Prisma Client** + +To regenerate the Prisma client after making schema changes, use: + +```bash +npm run prisma:generate +``` + +This command is automatically run on production during the `postinstall` phase if the environment is not set to `development`. + +--- + # Basic Contribution Guidelines We follow some simple guidelines to ensure a smooth collaboration process. @@ -95,50 +236,50 @@ We follow some simple guidelines to ensure a smooth collaboration process. If you find a bug or have an idea for an enhancement: -* Check Existing Issues: Look at [open issues](https://github.com/your-username/[DearDiary](https://github.com/TenzDelek/DearDiary)/issues) to see if your issue already exists. +- Check Existing Issues: Look at [open issues]() to see if your issue already exists. -* Create a New Issue: If not, open a new issue, providing as much detail as possible. +- Create a New Issue: If not, open a new issue, providing as much detail as possible. ## Working on Issues -* Get Assigned: Comment on an issue you'd like to work on and wait to be assigned. +- Get Assigned: Comment on an issue you'd like to work on and wait to be assigned. -* Create a New Branch: For each feature or bug fix, create a new branch: +- Create a New Branch: For each feature or bug fix, create a new branch: ```bash git checkout -b feature/issue-name ``` ## Submitting a Pull Request -* Push Your Branch: Once you’ve made your changes and tested them: + +- Push Your Branch: Once you’ve made your changes and tested them: ```bash git push origin feature/issue-name ``` -* Create a Pull Request (PR): Go to the GitHub repository and click on "New Pull Request." Make sure to provide a clear description of what you did and why. +- Create a Pull Request (PR): Go to the GitHub repository and click on "New Pull Request." Make sure to provide a clear description of what you did and why. -* Review and Update: Your PR may get reviewed by the maintainers. Be ready to make suggested changes. +- Review and Update: Your PR may get reviewed by the maintainers. Be ready to make suggested changes. ### License This project is open-source. Feel free to use it! + ```vbnet Feel free to modify any part of the text to better suit your project! ``` - ### Respond to Feedback -* Review Comments: Project maintainers may review your code and suggest improvements. -* Make Updates: Update your changes accordingly, and push them to the same branch. The PR will update automatically. +- Review Comments: Project maintainers may review your code and suggest improvements. +- Make Updates: Update your changes accordingly, and push them to the same branch. The PR will update automatically. # Celebrate Your Contribution! Once your PR is merged, you’ve officially made your first contribution! - ## Our Valuable Contributors ❤️✨ [![Contributors](https://contrib.rocks/image?repo=TenzDelek/DearDiary)](https://github.com/TenzDelek/DearDiary/graphs/contributors) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4884013 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: "3.8" +services: + app: + build: + context: . + dockerfile: Dockerfile + args: + DATABASE_URL: ${DATABASE_URL} + ports: + - "3000:3000" + - "5555:5555" # Forward Prisma Studio port to host machine + + env_file: + - .env # Load environment variables from .env + depends_on: + - db + + db: + image: postgres:14-alpine + restart: always + environment: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: mydatabase + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: diff --git a/jsconfig.json b/jsconfig.json index b8d6842..a4ae2ae 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { + "jsx": "react", "paths": { "@/*": ["./src/*"] } } -} +} \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index 4678774..0c60234 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,16 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = {}; +// next.config.mjs -export default nextConfig; +/** @type {import('next').NextConfig} */ +const nextConfig = { + async rewrites() { + return [ + { + source: '/api/quote', + destination: 'https://zenquotes.io/api/random', + }, + ] + }, + } + + export default nextConfig; + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3b1d0c7..23116aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,11 @@ "@clerk/clerk-sdk-node": "^5.0.48", "@clerk/nextjs": "^5.7.1", "@prisma/client": "^5.20.0", + "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", + "axios": "^1.7.7", "class-variance-authority": "^0.7.0", + "cors": "^2.8.5", "framer-motion": "^11.11.1", "lenis": "^1.1.13", "lucide-react": "^0.447.0", @@ -21,6 +24,8 @@ "next-auth": "^4.24.8", "react": "^18", "react-dom": "^18", + "react-icons": "^5.3.0", + "react-rating-stars-component": "^2.2.0", "tailwind-merge": "^2.5.3", "tailwindcss-animate": "^1.0.7" }, @@ -660,6 +665,50 @@ } } }, + "node_modules/@radix-ui/react-label": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.0.tgz", + "integrity": "sha512-peLblDlFw/ngk3UWq0VnYaOLy6agTZZ+MUO/WhVfm14vJGML+xH4FAl2XQGLqdefjNb7ApRg6Yn7U42ZhmYXdw==", + "dependencies": { + "@radix-ui/react-primitive": "2.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.0.tgz", + "integrity": "sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==", + "dependencies": { + "@radix-ui/react-slot": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.0.tgz", @@ -1217,6 +1266,12 @@ "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -1241,6 +1296,17 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/axobject-query": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", @@ -1537,6 +1603,18 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -1559,6 +1637,19 @@ "node": ">= 0.6" } }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1739,6 +1830,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -2562,6 +2662,26 @@ "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -2586,6 +2706,20 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/framer-motion": { "version": "11.11.1", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.1.tgz", @@ -4025,6 +4159,27 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -4857,6 +5012,12 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -4908,12 +5069,27 @@ "react": "^18.3.1" } }, + "node_modules/react-icons": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.3.0.tgz", + "integrity": "sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==", + "license": "MIT", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, + "node_modules/react-rating-stars-component": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/react-rating-stars-component/-/react-rating-stars-component-2.2.0.tgz", + "integrity": "sha512-A3lgLxumfFQQicKQmxacZ91fq/zRaVWlCPnVodJmJV6obvod4/yCotetN9WuyBiUfnKsEFDBo/8B85ocwmL7ng==", + "license": "ISC" + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -5899,10 +6075,11 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, + "license": "Apache-2.0", "peer": true, "bin": { "tsc": "bin/tsc", @@ -5965,6 +6142,15 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 7af7fef..0f09d40 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,30 @@ "build": "next build", "start": "next start", "lint": "next lint", - "postinstall": "prisma generate", + "docker:build": "docker-compose build", + "docker:up": "docker-compose up -d", + "docker:down": "docker-compose down", + "docker:start": "docker-compose start", + "docker:stop": "docker-compose stop", + "docker:restart": "docker-compose restart", + "docker:setup": "npm run docker:build && npm run docker:up && npm run prisma:migrate && npm run prisma:studio", + "prisma:migrate": "docker-compose exec app npx prisma migrate dev", + "prisma:studio": "docker-compose exec app npx prisma studio", + "prisma:push": "docker-compose exec app npx prisma push", + "prisma:pull": "docker-compose exec app npx prisma pull", + "prisma:generate": "docker-compose exec app npx prisma generate", + "postinstall": "if [ \"$NODE_ENV\" != \"development\" ]; then prisma generate; fi", "prepare": "husky install" }, "dependencies": { "@clerk/clerk-sdk-node": "^5.0.48", "@clerk/nextjs": "^5.7.1", "@prisma/client": "^5.20.0", + "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", + "axios": "^1.7.7", "class-variance-authority": "^0.7.0", + "cors": "^2.8.5", "framer-motion": "^11.11.1", "lenis": "^1.1.13", "lucide-react": "^0.447.0", @@ -23,6 +38,8 @@ "next-auth": "^4.24.8", "react": "^18", "react-dom": "^18", + "react-icons": "^5.3.0", + "react-rating-stars-component": "^2.2.0", "tailwind-merge": "^2.5.3", "tailwindcss-animate": "^1.0.7" }, diff --git a/prisma/migrations/20241012022822_added_schema/migration.sql b/prisma/migrations/20241012022822_added_schema/migration.sql new file mode 100644 index 0000000..b5f4e83 --- /dev/null +++ b/prisma/migrations/20241012022822_added_schema/migration.sql @@ -0,0 +1,14 @@ +-- CreateTable +CREATE TABLE "Diary" ( + "id" TEXT NOT NULL, + "title" TEXT NOT NULL, + "content" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Diary_pkey" PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "Diary" ADD CONSTRAINT "Diary_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 60fa69b..b62d214 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -14,17 +14,38 @@ datasource db { } model User { - id String @id @default(uuid()) - clerkId String @unique - name String - email String @unique + id String @id @default(uuid()) + clerkId String @unique + name String + email String @unique createdAt DateTime @default(now()) + Notes Notes[] + Diary Diary[] } model Guestbook { - id Int @id @default(autoincrement()) - email String - created_by String - body String + id Int @id @default(autoincrement()) + email String + created_by String + body String last_modified DateTime @default(now()) } + +model Diary { + id String @id @default(uuid()) + title String + content String + user User @relation(fields: [userId], references: [id]) + userId String + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model Notes { + id String @id @default(uuid()) + content String + user User @relation(fields: [userId], references: [id]) + userId String + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} \ No newline at end of file diff --git a/public/favicon/DearDiary.png b/public/favicon/DearDiary.png deleted file mode 100644 index 74255ff..0000000 Binary files a/public/favicon/DearDiary.png and /dev/null differ diff --git a/public/favicon/DearDiary.webp b/public/favicon/DearDiary.webp new file mode 100644 index 0000000..91d1d05 Binary files /dev/null and b/public/favicon/DearDiary.webp differ diff --git a/public/favicon/android-chrome-192x192.png b/public/favicon/android-chrome-192x192.png deleted file mode 100644 index 3a3f006..0000000 Binary files a/public/favicon/android-chrome-192x192.png and /dev/null differ diff --git a/public/favicon/android-chrome-192x192.webp b/public/favicon/android-chrome-192x192.webp new file mode 100644 index 0000000..0eadd87 Binary files /dev/null and b/public/favicon/android-chrome-192x192.webp differ diff --git a/public/favicon/android-chrome-512x512.png b/public/favicon/android-chrome-512x512.png deleted file mode 100644 index 6fbd050..0000000 Binary files a/public/favicon/android-chrome-512x512.png and /dev/null differ diff --git a/public/favicon/android-chrome-512x512.webp b/public/favicon/android-chrome-512x512.webp new file mode 100644 index 0000000..6acb7f2 Binary files /dev/null and b/public/favicon/android-chrome-512x512.webp differ diff --git a/public/favicon/apple-touch-icon.png b/public/favicon/apple-touch-icon.png deleted file mode 100644 index ca962e0..0000000 Binary files a/public/favicon/apple-touch-icon.png and /dev/null differ diff --git a/public/favicon/apple-touch-icon.webp b/public/favicon/apple-touch-icon.webp new file mode 100644 index 0000000..b701e19 Binary files /dev/null and b/public/favicon/apple-touch-icon.webp differ diff --git a/public/favicon/favicon-16x16.png b/public/favicon/favicon-16x16.png deleted file mode 100644 index 410a03a..0000000 Binary files a/public/favicon/favicon-16x16.png and /dev/null differ diff --git a/public/favicon/favicon-16x16.webp b/public/favicon/favicon-16x16.webp new file mode 100644 index 0000000..8e4e2db Binary files /dev/null and b/public/favicon/favicon-16x16.webp differ diff --git a/public/favicon/favicon-32x32.png b/public/favicon/favicon-32x32.png deleted file mode 100644 index 47d9c4e..0000000 Binary files a/public/favicon/favicon-32x32.png and /dev/null differ diff --git a/public/favicon/favicon-32x32.webp b/public/favicon/favicon-32x32.webp new file mode 100644 index 0000000..f49e8d3 Binary files /dev/null and b/public/favicon/favicon-32x32.webp differ diff --git a/public/favicon/site.webmanifest b/public/favicon/site.webmanifest index fa99de7..b2934cc 100644 --- a/public/favicon/site.webmanifest +++ b/public/favicon/site.webmanifest @@ -3,14 +3,14 @@ "short_name": "", "icons": [ { - "src": "/android-chrome-192x192.png", + "src": "/android-chrome-192x192.webp", "sizes": "192x192", - "type": "image/png" + "type": "image/webp" }, { - "src": "/android-chrome-512x512.png", + "src": "/android-chrome-512x512.webp", "sizes": "512x512", - "type": "image/png" + "type": "image/webp" } ], "theme_color": "#ffffff", diff --git a/src/app/about/page.jsx b/src/app/about/page.jsx index c8399e3..0fb110d 100644 --- a/src/app/about/page.jsx +++ b/src/app/about/page.jsx @@ -1,7 +1,6 @@ 'use client' import { Button } from '@/components/ui/button' import { Card, CardHeader, CardDescription, CardTitle, CardContent } from '@/components/ui/card' -import { AnimatePresence, motion } from 'framer-motion' import { Book, Sparkles, Lock, Users, Heart, Zap, BarChart, Calendar } from 'lucide-react' import { useState } from 'react' import Link from "next/link" @@ -10,49 +9,49 @@ const About = () => { const [activeFeature, setActiveFeature] = useState(null) const features = [ { - icon: , + icon: , title: "Digital Journaling", description: "Capture your thoughts and memories in a beautiful, organized digital format.", details: "Our intuitive editor supports rich text formatting, image uploads, and voice notes, making it easy to express yourself in various ways." }, { - icon: , + icon: , title: "Private & Secure", description: "Your entries are encrypted and only accessible to you. Your privacy is our top priority.", details: "We use industry-standard encryption methods to ensure your data is safe. You can also enable two-factor authentication for an extra layer of security." }, { - icon: , + icon: , title: "Mood Tracking", description: "Visualize your emotional journey with our intuitive mood tracking feature.", details: "Track your mood daily and view beautiful charts that help you understand your emotional patterns over time. Identify triggers and celebrate positive trends." }, { - icon: , + icon: , title: "Community Support", description: "Connect with like-minded individuals in our supportive journaling community.", details: "Join themed journaling challenges, participate in writing prompts, and share insights (anonymously if you prefer) with a community that understands the power of self-reflection." }, { - icon: , + icon: , title: "Self-Care Tools", description: "Access guided meditation, gratitude prompts, and other self-care resources.", details: "Integrate mindfulness into your journaling practice with our curated selection of guided meditations, breathing exercises, and daily affirmations." }, { - icon: , + icon: , title: "AI-Powered Insights", description: "Gain deeper understanding of your entries with our AI analysis tools.", details: "Our advanced AI can identify recurring themes, suggest areas for personal growth, and even offer writing prompts based on your journaling history." }, { - icon: , + icon: , title: "Progress Tracking", description: "Set personal goals and track your progress over time.", details: "Whether it's developing a new habit or working towards a long-term goal, DearDiary helps you stay accountable and celebrate your milestones." }, { - icon: , + icon: , title: "Customizable Reminders", description: "Never miss a journaling session with personalized reminders.", details: "Set up daily, weekly, or custom reminders that fit your schedule. Receive gentle nudges to maintain your journaling habit." @@ -60,66 +59,38 @@ const About = () => { ] return ( -
+
- +

Meet DearDiary, your space for life's moments - - +

+

Embark on a journey of self-discovery and growth through the power of journaling. - +

- +
{features.map((feature, index) => ( - setActiveFeature(activeFeature === index ? null : index)} > setActiveFeature(activeFeature === index ? null : index)} /> - - {activeFeature === index && ( - -

{feature.details}

-
- )} -
-
+ {activeFeature === index && ( +
+

{feature.details}

+
+ )} +
))} -
- - {/* Additional sections (Mission, Why Choose DearDiary, Join Thousands, etc.) */} - {/* ... */} +