Skip to content

masakmudah/masakmudah-backend

Repository files navigation

MasakMudah Backend

MasakMudah REST API is a web service that provides access to a large collection of recipe. It allows users to search for recipe, retrieve recipe details, and publish own recipe also saving another user recipe.

Tech Stack

API Specification

The OpenAPI Specification for the MasakMudah API offers a detailed description of the API's services. It can be accessed at the path /api-spec.

For a more interactive experience, you can use SwaggerUI. It provides a user-friendly interface for exploring and testing the API. You can access SwaggerUI at /ui.

You can also access the following:

Database Design

To view the latest database design in more detail, you can navigate to the following link: ERD

ERD

Getting Started

Set up .env by copying from .env.example for reference

cp .env.example .env

Install dependencies

bun install

Run DB migration

bun run migrate:dev

Then you can run

bun run dev

Afterwards, open your browser and navigate to http://localhost:3000 to start exploring the API.

Auth:

Endpoint HTTP Permission
/users GET Public
/users/:username GET Public
/auth/register POST Public
/auth/login POST Public
/auth/me GET Authenticated
/auth/logout POST Authenticated

Categories CRUD

Endpoint HTTP Permission
/categories GET Public
/categories/allCategories GET Public
/categories/create POST Authenticated
/categories/:id PUT Authenticated
/categories/:id DELETE Authenticated

Recipes CRUD

Endpoint HTTP Permission
/recipes GET Public
/recipes/:slug GET Public
/recipes/create POST Authenticated
/categories/:id PUT Authenticated in progres
/categories/:id DELETE Authenticated in progres