An event management API made with Hono 🔥 with Cloudflare workers, using Cloudflare D1. Hono is fast, scalable and works on the edge networks making it zippy.
Made for SRMKZILLA club submission
- Backend: Built with Cloudflare Workers.
- Database: Utilizes D1 for data management.
- API Documentation: Self-documented with OpenAPI and Swagger.
/docs
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
- Clone the repository:
git clone https://github.com/rahuletto/evenzo.git
cd evenzo- Install Wrangler CLI:
bun add -g wrangler- Log in to Cloudflare:
wrangler login- Create a Cloudflare D1 database
wrangler d1 create events_dbHave it's id, it is necessary.
- Configure the database in wrangler.toml:
Change
example.wrangler.tomltowrangler.tomlYou should use the ID generated by wrangler
name = "evenzo"
compatibility_date = "2024-09-28"
[[ d1_databases ]]
binding = "DB"
database_name = "events_db"
database_id = "ID"- Install all dependencies
bun install- Run the dev server
bun run devThis starts a server at localhost:8787 (most probably)
- Deploy the api To deploy it in your cloudflare workers
bun run deployGET /events
Retrieve all events.
POST /events
Create a new event. Requires a JSON body:
{
"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.
The API is documented using OpenAPI. Access the Swagger UI for exploration:
- Swagger UI:
/docs - OpenAPI Spec:
/swagger.json
This project is licensed under the MPL 2.0 License.