Coder Social home page Coder Social logo

jay-karia / bun-hono-rest-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from promehedi/bun-hono-rest-api

0.0 0.0 0.0 24 KB

A REST API using Bun + Hono + MongoDB + TypeScript providing a powerful and efficient platform with a simple CRUD interface for a user model.

License: MIT License

TypeScript 100.00%

bun-hono-rest-api's Introduction

REST API using Bun + Hono + MongoDB + TypeScript

Welcome to your new Bun project! This project is a REST API using Bun + Hono + MongoDB + TypeScript providing a powerful and efficient platform with a simple CRUD interface for a user model.

Table of Contents

Getting Started

Before you begin, make sure you have the following installed:

Installations:

  1. Clone this repository to your local machine
git clone https://github.com/ProMehedi/bun-hono-rest-api.git
  1. Navigate to the project directory
cd bun-hono-rest-api
  1. Install dependencies
bun install

To run:

bun run dev

Configuration

Create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example:

PORT=9000
MONGO_URI=mongodb://localhost:27017/bun-hono-rest-api
JWT_SECRET=secret

Routes

POST /api/v1/users (Create User)
POST /api/v1/users/login (Login User)
GET /api/v1/users/profile (Get User Profile)
GET /api/v1/useres (Get All Users)
GET /api/v1/users/:id (Get User By Id)

Usage

POST /api/v1/users (Create User)
{
  "name": "Mehedi Hasan",
  "email": "[email protected]",
  "password": "123456"
}
POST /api/v1/users/login (Login User)
{
  "email": "[email protected]",
  "password": "123456"
}
GET /api/v1/users/profile (Get User Profile)
Authorisation Header (Bearer Token)
GET /api/v1/useres (Get All Users)
Authorisation Header (Bearer Token)
GET /api/v1/users/:id (Get User By Id)
Authorisation Header (Bearer Token)

Project Structure


├── .vscode
│ ├── settings.json
├── config
│ ├── db.ts
├── controllers
│ ├── user.ts
├── middlewares
│ ├── authMiddlewares.ts
│ ├── errorMiddlewares.ts
├── models
│ ├── userModels.ts
├── routes
│ ├── userRoutes.ts
├── utils
│ ├── getToken.ts
├── server.ts
├── .env
├── .gitignore
├── bun.lockb
├── README.md
├── package.json
├── tsconfig.ts

Contributing

We welcome contributions to improve the API! If you find a bug, have a feature request, or want to suggest improvements, please create an issue in the GitHub repository. If you'd like to contribute code, feel free to fork the repository, create a new branch, commit your changes, and open a pull request.

Please ensure that your code follows the existing coding style and conventions.

License

This project is licensed under the [MIT] License

Contact

If you have any questions or need further assistance, you can reach us at Mehedi Hasan.

bun-hono-rest-api's People

Contributors

promehedi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.