TenzDelek / DearDiary

A Digital Diary in this modern world
https://dear-diary-black.vercel.app
24 stars 35 forks source link
gssoc gssoc24 hacktoberfest hacktoberfest-accepted javascript nextjs tailwindcss

DearDiary

image

Welcome to the 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.

Table of Contents

Getting Started

We are happy to have you contribute to our project! Follow these steps to set up your local environment and start making contributions.

Project Setup

Prerequisites

To get started, you will need:

Cloning the Repository

First, fork this repository by clicking the "Fork" button at the top. Then, clone your forked copy to your local machine:

git clone https://github.com/your-username/DearDiary.git

To navigate into the project directory:

cd DearDiary

Installing Dependencies

To install all required dependencies, run:

npm install

This command will install Next.js, Clerk, and other necessary libraries.

Setting Up Clerk

NEXT_PUBLIC_CLERK_FRONTEND_API=<YOUR_FRONTEND_API_KEY>
CLERK_API_KEY=<YOUR_SECRET_KEY>

Verify Configuration: Double-check that the keys are correctly set up by running:

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:

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:

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:

npm run docker:setup

This command will:

3. Managing Docker Containers

You can manage the Docker containers with the following commands:


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:

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:

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:

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:

npm run prisma:pull

5. Generate Prisma Client

To regenerate the Prisma client after making schema changes, use:

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.

Creating Issues

If you find a bug or have an idea for an enhancement:

Working on Issues

git checkout -b feature/issue-name

Submitting a Pull Request

git push origin feature/issue-name

License

This project is open-source. Feel free to use it!


Feel free to modify any part of the text to better suit your project!

Respond to Feedback

Celebrate Your Contribution!

Once your PR is merged, you’ve officially made your first contribution!

Our Valuable Contributors ❤️✨

Contributors