Skip to content

Commit

Permalink
Merge pull request #4 from kalwabed/telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwabed authored Aug 7, 2022
2 parents f0d3d3d + 4d5c23b commit 7faa3f0
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,67 @@
# Pena
Website coordinates Kalwabed's abstract writings

## Demo

[https://pena.kalwabed.xyz](https://pena.kalwabed.xyz)
## Tech Stack
- Svelte Kit
- TypeScript
- Uno CSS + Tailwind CSS
- Prisma + Planetscale

## Getting Started

To get started running the project locally, please follow the steps below.

First, clone the repository.

```bash
git clone https://github.com/kalwabed/pena.kalwabed.xyz.git
```

Then, install dependencies and fetch data to your local machine. **Note that we use PNPM.**

```bash
cd pena.kalwabed.xyz
pnpm install
```

Generate Prisma Client.
```bash
pnpx prisma generate
```

Finally, run the development server.

```bash
pnpm dev
```

Open [http://127.0.0.1:5173](http://127.0.0.1:5173) with your browser to see the result.
## Environment Variables

To run this project, you will need to add the following environment variables to your `.env` file.

`DATABASE_URL`: Planetscale database URL.

`BOT_TOKEN`: (optional) Telegram bot token.

`BOT_GROUP_ID`: (optional) Telegram bot group id.

## Deployment
You can easily deploy to Vercel, or you can learn more from https://kit.svelte.dev/docs/adapters.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Svelte Kit Documentation](https://kit.svelte.dev/docs/introduction) - learn about Svelte Kit features and API.
- [Learn Svelte](https://learn.svelte.dev/tutorial/welcome-to-svelte) - an interactive Svelte tutorial.

## Authors

- [@kalwabed](https://www.github.com/kalwabed)

## License
[MIT](https://choosealicense.com/licenses/mit/)
4 changes: 1 addition & 3 deletions src/routes/api/add-guest.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ Email: ||${escapedText(email)}||
Message: ||${escapedText(body)}||
`;

if (!process.env.BOT_TOKEN || !process.env.BOT_GROUP_ID) {
console.error('Missing BOT_TOKEN or BOT_GROUP_ID');
} else {
if (process.env.BOT_TOKEN && process.env.BOT_GROUP_ID) {
await fetch(
`https://api.telegram.org/bot${process.env.BOT_TOKEN}/sendMessage?chat_id=${
process.env.BOT_GROUP_ID
Expand Down

1 comment on commit 7faa3f0

@vercel
Copy link

@vercel vercel bot commented on 7faa3f0 Aug 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.