Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
slavingia authored Sep 27, 2024
1 parent 4dd8176 commit 57f9b6c
Showing 1 changed file with 3 additions and 51 deletions.
54 changes: 3 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,17 @@

**[shortest.com](shortest.com)**

## Tech stack

- **Framework**: [Next.js](https://nextjs.org/)
- **Database**: [Postgres](https://www.postgresql.org/)
- **ORM**: [Drizzle](https://orm.drizzle.team/)
- **Payments**: [Stripe](https://stripe.com/)
- **UI Library**: [shadcn/ui](https://ui.shadcn.com/)

## Getting started

```bash
npm install -g pnpm
pnpm install
pnpm drizzle-kit generate
pnpm db:migrate
pnpm db:seed # creates stripe products
pnpm db:seed # creates stripe products, currently unused
```

Run vercel env pull .env.development.local to make the latest environment variables available to your project locally.
Run `vercel env pull .env.development.local` to make the latest environment variables available to your project locally.

## Running locally

Expand All @@ -30,49 +22,9 @@ Once you have set up the environment variables and installed dependencies, run t
pnpm dev
```

Then, also listen for Stripe webhooks locally through their CLI:

```bash
stripe listen --forward-to localhost:3000/api/stripe/webhook
```

Open [http://localhost:3000](http://localhost:3000) in your browser to see the app in action.

## Migrations

```bash
pnpm db:migrate
```

## Testing payments

To test Stripe payments, use the following test card details:

- Card Number: `4242 4242 4242 4242`
- Expiration: Any future date
- CVC: Any 3-digit number

## Going to production

When you're ready to deploy your SaaS application to production, follow these steps:

### Set up a production Stripe webhook

1. Go to the Stripe Dashboard and create a new webhook for your production environment.
2. Set the endpoint URL to your production API route (e.g., `https://yourdomain.com/api/stripe/webhook`).
3. Select the events you want to listen for (e.g., `checkout.session.completed`, `customer.subscription.updated`).

### Deploy to Vercel

1. Push your code to a GitHub repository.
2. Connect your repository to Vercel and deploy it.
3. Follow the Vercel deployment process, which will guide you through setting up your project.

### Add environment variables

In your Vercel project settings (or during deployment), add all the necessary environment variables. Make sure to update the values for the production environment.

## Running Tests
## Running tests

To run specs:

Expand Down

0 comments on commit 57f9b6c

Please sign in to comment.