https://github.com/rahuletto/evenzo-api
An event management API made with Hono 🔥 with Cloudflare workers, using Cloudflare D1.
https://github.com/rahuletto/evenzo-api
Last synced: 5 months ago
JSON representation
An event management API made with Hono 🔥 with Cloudflare workers, using Cloudflare D1.
- Host: GitHub
- URL: https://github.com/rahuletto/evenzo-api
- Owner: Rahuletto
- License: mpl-2.0
- Created: 2024-09-28T17:23:48.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T10:33:35.000Z (over 1 year ago)
- Last Synced: 2025-12-28T09:58:50.592Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 52.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Evenzo
An event management API made with [Hono](https://hono.dev/) 🔥 with [Cloudflare workers](https://www.cloudflare.com/developer-platform/workers/), using [Cloudflare D1](https://www.cloudflare.com/developer-platform/d1/). Hono is fast, scalable and works on the edge networks making it zippy.
> Made for SRMKZILLA club submission
## Tech Stack
- **Backend**: Built with Cloudflare Workers.
- **Database**: Utilizes D1 for data management.
- **API Documentation**: Self-documented with OpenAPI and Swagger. `/docs`
## Installation and Setup
> [!TIP]
> If you are not interested in running with the source, you can test it out with the [deployed url](https://evenzo.rameshrahul1974.workers.dev) > `https://evenzo.rameshrahul1974.workers.dev`
### Prerequisites
- [Cloudflare Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/)
### Setup
1. Clone the repository:
```bash
git clone https://github.com/rahuletto/evenzo.git
cd evenzo
```
2. Install Wrangler CLI:
```bash
bun add -g wrangler
```
3. Log in to Cloudflare:
```bash
wrangler login
```
4. Create a Cloudflare D1 database
```bash
wrangler d1 create events_db
```
Have it's id, it is necessary.
5. Configure the database in wrangler.toml:
> Change `example.wrangler.toml` to `wrangler.toml`
> You should use the ID generated by wrangler
```yaml
name = "evenzo"
compatibility_date = "2024-09-28"
[[ d1_databases ]]
binding = "DB"
database_name = "events_db"
database_id = "ID"
```
### Running the app
1. Install all dependencies
```bash
bun install
```
2. Run the dev server
```bash
bun run dev
```
This starts a server at `localhost:8787` (most probably)
3. Deploy the api
To deploy it in your cloudflare workers
```bash
bun run deploy
```
## API Endpoints
`GET /events`
Retrieve all events.
`POST /events`
Create a new event. Requires a JSON body:
```json
{
"title": "Event Title",
"description": "Event Description",
"location": "Event Location",
"time": "2024-10-01T10:00:00Z"
}
```
`GET /events/{id}`
Retrieve an event by its ID.
`PUT /events/{id}`
Update an existing event by its ID. Requires a JSON body with updated details.
`DELETE /events/{id}`
Delete an event by its ID.
## [Documentation](https://evenzo.rameshrahul1974.workers.dev/docs)
The API is documented using OpenAPI. Access the Swagger UI for exploration:
- Swagger UI: `/docs`
- OpenAPI Spec: `/swagger.json`
## License
This project is licensed under the MPL 2.0 License.