Skip to content

This repository contains the backend code for the Lost & Found website, a community-driven platform designed to help individuals report and reclaim lost items.

Notifications You must be signed in to change notification settings

mdrianislam0or1/lost-and-found-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend README.md

# Lost & Found Backend

## Overview

This repository contains the backend code for the Lost & Found website, a community-driven platform designed to help individuals report and reclaim lost items.

## Technologies Used

- Node.js
- Express.js
- TypeScript
- Prisma (ORM for database management)
- JWT (for authentication)
- API Integration with Frontend

## Live Demo

[Backend Live Link](https://lost-and-found-backend-tau.vercel.app/)

## Getting Started

### Prerequisites

- Node.js (v14 or higher)
- npm (v6 or higher) or yarn (v1.22 or higher)
- PostgreSQL (or any other supported database)

### Installation

1. Clone the repository:

   ```sh
   git clone https://github.com/mdrianislam0or1/lost-and-found-backend.git

    Navigate to the project directory:

    sh
   ```

cd lost-and-found-backend

Install dependencies:

sh

npm install

# or

yarn install

Set up environment variables:

Create a .env file in the root directory and add the following environment variables:

# .env

DATABASE_URL=\***\*\*\*\***
NODE_ENV=\***\*\*\*\***
PORT=\***\*\*\*\***
JWT_SECRET=\***\*\*\*\***
EXPIRES_IN=\***\*\*\*\***
REFRESH_TOKEN_SECRET=\***\*\*\*\***
REFRESH_TOKEN_EXPIRES_IN=\***\*\*\*\***
RESET_PASS_TOKEN=\***\*\*\*\***
RESET_PASS_TOKEN_EXPIRES_IN=\***\*\*\*\***
RESET_PASS_LINK="\***\*\*\*\***
EMAIL = \***\*\*\*\***
APP_PASS =\***\*\*\*\***

Set up the database:

sh

    npx prisma migrate dev

Running the Development Server

sh

npm run dev

# or

yarn dev

Building for Production

sh

npm run build

# or

yarn build

Running the Production Server

After building the project, you can start the production server with:

sh

npm start

# or

yarn start

Project Structure

    src/ - Contains the source code.
        controllers/ - Contains the request handlers.
        middlewares/ - Contains middleware functions.
        models/ - Contains Prisma schema and database models.
        routes/ - Contains Express routes.
        services/ - Contains business logic and helper functions.
        utils/ - Contains utility functions.
        index.ts - Entry point of the application.

Features

    User Authentication:
        Secure login and registration with JWT-based authentication.

    Lost & Found Item Management:
        APIs to submit lost and found items with details like category, description, date, and location.
        Update and delete functionality for lost and found items.

    Profile Management:
        APIs to manage user profile, claim requests, and reported items.

    Admin Dashboard:
        User management and website activity monitoring features for administrators.

    Error Handling and Validation:
        Comprehensive error handling and input validation for all endpoints.

Contribution

Feel free to contribute to this project by opening issues and submitting pull requests.
License

This project is licensed under the MIT License.
Contact

For any inquiries, please contact us at rianislamrian@gmail.com.

About

This repository contains the backend code for the Lost & Found website, a community-driven platform designed to help individuals report and reclaim lost items.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published