Skip to content

Rahuletto/evenzo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evenzo

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

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

Prerequisites

Setup

  1. Clone the repository:
git clone https://github.com/rahuletto/evenzo.git
cd evenzo
  1. Install Wrangler CLI:
bun add -g wrangler
  1. Log in to Cloudflare:
wrangler login
  1. Create a Cloudflare D1 database
wrangler d1 create events_db

Have it's id, it is necessary.

  1. Configure the database in wrangler.toml:

Change example.wrangler.toml to wrangler.toml You 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"

Running the app

  1. Install all dependencies
bun install
  1. Run the dev server
bun run dev

This starts a server at localhost:8787 (most probably)

  1. Deploy the api To deploy it in your cloudflare workers
bun run deploy

API Endpoints

GET /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

License

This project is licensed under the MPL 2.0 License.

About

An event management API made with Hono 🔥 with Cloudflare workers, using Cloudflare D1.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages