Giter VIP home page Giter VIP logo

blood-donation-server's Introduction

Blood Donation Server

The Blood Donation Application Server is a robust server-side application designed to facilitate blood donation processes efficiently. It provides user authentication and authorization features using JSON Web Tokens (JWT) to ensure secure access to its functionalities.

The main purpose of the application is to connect blood donors with those in need by enabling users to find blood donors and request blood donations. Users can register an account, update their profiles, and participate in blood donation requests seamlessly.

Table of Contents

Key Features

Every route within the system is safeguarded through JWT token verification and role based authorization, guaranteeing secure access and protection against unauthorized usage.

Database Tables:

  1. user: Responsible for storing user information securely, facilitating a reliable authentication system.

  2. request: Manages blood donation requests, tracking donor and requester information, as well as request status.

  3. profile: Stores user profile information, including bio, age, and last donation date

Technology Used

  • Express.js
  • Prisma
  • JWT (JSON Web Tokens)
  • Bcrypt
  • Zod
  • Dev Tools
    • TypeScript
    • ts-node-dev

API Documentation

This documentation, generated with Postman.

  https://documenter.getpostman.com/view/15069256/2sA35MzzC9

Or,

Click API Documentation

Live Server Test

To test the live API endpoints, I prefer using Postman for testing with better user experience.

Live API

https://blood-donation-server-orpin.vercel.app/

API Endpoints

for user

  • POST /api/register
  • POST /api/login

for profile

  • GET /api/my-profile
  • PUT /api/my-profile

for request

  • POST /api/donation-request
  • GET /api/donation-request
  • GET /api/donor-list
  • PUT /api/donation-request/:requestId

Getting Started

These instructions will help you set up and run the application on your local machine.

Prerequisites

  • Node.js and npm installed on your machine.

Installation locally

  1. Clone the repository:
https://github.com/mdnoyonhossain/blood-donation-server.git
  1. Navigate to the project directory:
cd blood-donation-server
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory and configure environment variables:
DATABASE_URL=...
PORT=...
JWT_ACCESS_SECRET=...
JWT_ACCESS_EXPIRES_IN=...
SALT_ROUNDS=...

Running the Application

  1. Convert the typescript file to javascript file
npm run build
  1. Running typescript in development environment
npm run start
  1. Running javascript in production environment
node ./dist/server.js

blood-donation-server's People

Watchers

Md Shahinur Rahman Nayon 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.