Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dev-siri/twitter-clone

Fully functional (made with mental health in mind) Twitter Clone built with Next.js, React, Drizzle ORM, Neon & Firebase Storage
https://github.com/dev-siri/twitter-clone

bun drizzle-kit drizzle-orm firebase-storage neondb nextjs nextjs-app-router react tailwindcss typescript

Last synced: about 22 hours ago
JSON representation

Fully functional (made with mental health in mind) Twitter Clone built with Next.js, React, Drizzle ORM, Neon & Firebase Storage

Awesome Lists containing this project

README

        

# Twitter Clone

Yes. Yet another Twitter clone.

I tried to implement as many features as possible while trying to retaining my sanity. This is by far the biggest App Router app I've ever written in Next.js

## Getting Started

- Clone the repo

```sh
$ git clone https://github.com/Dev-Siri/Twitter-Clone.git
```

- Install the dependencies

```sh
$ pnpm i

# with buntime
$ bun i
```

- Create a database on [Neon](https://neon.tech)
- Create a [Firebase](https://firebase.google.com) Project with the "Storage" service enabled
- Finally, the last secret you'll need is a `JWT_SECRET` key. To generate it, use `openssl`:

```sh
$ openssl rand -base64 32
```

- Then copy the all the creds into a `.env.local` file. Make sure you follow the format in the `.env.example` file

```sh
DATABASE_URL=""
JWT_SECRET=""
PGHOST=""
PGDATABASE=""
PGUSER=""
PGPASSWORD=""
ENDPOINT_ID=""
FIREBASE_API_KEY=""
FIREBASE_AUTH_DOMAIN=""
FIREBASE_PROJECT_ID=""
FIREBASE_STORAGE_BUCKET=""
FIREBASE_MESSAGING_SENDER_ID=""
FIREBASE_APP_ID=""
```

> Note: you need to split your Database URL you get from Neon into individual parts so that drizzle can carry out migrations
>
> If the URL is `postgres://:@/?sslmode=require`
> Then split it into the individual parts as:
>
> ```sh
> DATABASE_URL="postgres://:@/?sslmode=require"
> PGHOST=""
> PGDATABASE=""
> PGUSER=""
> PGPASSWORD=""
> ENDPOINT_ID=""
> ```
>
> Additional note: Make sure you have `?sslmode=require` at the end of the url, it is required by Drizzle.

- Then run the drizzle commands to gen and push to the db.

```sh
$ pnpm drizzle:generate && pnpm drizzle:push

# with buntime
$ bun drizzle:generate && pnpm drizzle:push
```

- Finally start the development server

```sh
$ pnpm dev

# with buntime
$ bun dev
```

Once again, you have achieved bird.

## License

This project is MIT Licensed, see [LICENSE](LICENSE)