backendproject-birdsofprey-api

Backend for an api for the management of raptor data. It enables the storage and management of information on birds of prey.

Stars
0
Committers
1

Building an API for CRUD Operations with birds of prey data

This repository contains the backend for an API managing information about birds of prey. It will allow retrieving bird of prey and falconries data, as well as adding, updating, and deleting entries. Additionally, users can log bird watching observations, and administrators have the ability to manage regional falconries.

Used Technologies & Libraries:

  • Node.js: JavaScript runtime environment for server-side development.
  • Express.js: Fast, minimalist web framework for Node.js.
  • MongoDB: NoSQL database for storing bird of prey data, falconries and users.
  • Mongoose: MongoDB object modeling.
  • crypto: provides cryptographic functions for Node.js applications, offering capabilities like secure random number generation.
  • Zod: Schema Declaration and validation library, used it for validation.
  • Jest: JavaScript testing framework.
  • supertest: SuperAgent-driven library for testing HTTP servers.
  • cors: Express middleware for handling Cross-Origin Resource Sharing.
  • helmet: to set secure HTTP headers.
  • bcrypt: a library to hash passwords.
  • cookie-parser: to parse Cookie header and to use them in the req.cookies object.
  • jwt: to create, sign, verify and decode JSON Web Tokens, enabling authentication and secure data exchange in web-Apps
  • dotenv: loads environment variables from a .env file into process.env, making them accessible
  • nodemailer: for sending emails
  • axios: Promise based HTTP client for the browser and node.js
  • Etheral: a free, fake SMTP service, good for testing E-Mail Services with nodemailer

Simplified Flowchart

How to install and run this project locally

If you´d like to take a deeper look into this project, follow these steps:

  1. Clone or Fork the Repository and navigate to the project

Please note that at the moment the project will not work completely on your computer without an own database connection to MongoDB. If you want to try it out yourself with your own data, you need an account with MongoDB. However, you are welcome to clone the project to get a deeper insight into the code.

  1. Install the Dependencies with the node package manager by running the following commands:
npm install
´´´

You also need a fake account with Etheral to test the email verification. To test the API Requests, I recommend using Postman. Postman is a popular collaboration platform for API development that simplifies the process of building, testing, and documenting APIs. I used it during Production and it was very helpful. As an alternative, you can also try Thunderclient in VSCode.

  1. Start the server and the client in a respective terminal
node server.js

node client.js
´´´

This project also contains a notes.md file in which I have recorded many notes, learnings and helpful information about this project or individual steps.

Related Projects