Skip to content

subhashis2204/project-annapurna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

project-annapurna

License Downloads Followers Forks Stars Issues Open Issues Closed PR Open PR Closed

This is a food donation application that connects NGOs and restaurants.

The purpose of this platform is to enable restaurants to donate surplus food to people in need through partnering NGOs.

The application includes features such as
Google geocoding 🌍 β€’ Email OTP notifications βœ‰οΈ β€’ Contact Us page πŸ“ž

Features β€’ How To Contribute β€’ Getting Started β€’ Setup Guidelines β€’ Tech Stacks β€’ Contributors

Features

Features Details
Restaurant Donation Restaurants can donate surplus food to NGOs through the platform.
NGO Partnership NGOs can receive food donations from restaurants and distribute them to people in need
Google Geocoding Integration with Google Geocoding API for accurate location services.
Email OTP Notifications Users receive One-Time Password (OTP) notifications via email for secure authentication.
Contact Us Page Users can contact the support team or administration through the contact us page.
Authentication Implement authentication functionality to ensure secure access to the application's features and user data. This can include user registration, login, and session management, using techniques such as username/password or social media authentication. Authentication adds an extra layer of security and allows personalized user experiences within the platform.

How to contribute

This can be done in 8 simple steps -

  • Step 1: Fork the repo and go to your git terminal and clone it on your machine

    git clone https://github.com/<your_github_username>/project-annapurna.git
    cd project-annapurna
  • Step 2: Add an upstream link to the main branch in your cloned repo

    git remote add upstream https://github.com/<your_github_username>/project-annapurna.git
  • Step 3: Keep your cloned repo up to date by pulling from upstream This will also avoid any merge conflicts while committing new changes.

    git pull upstream main
  • Step 4: Create your feature branch This is a necessary step, so don't skip it

    git checkout -b <branch-name>
  • Step 5: Track and stage your changes

    # Track the changes
    git status
    # After adding required changes
    git add .
  • Step 6: Commit all the changes Write commit message as "Small Message"

    git commit -m "<your-commit-message>"
  • Step 7: Push the changes for review

    git push origin <branch-name>
  • Step 8: Create a PR on Github

    Don't just hit the create a pull request button, you must write a PR message to clarify why and what are you contributing

Getting started

The following environment variable are necessary for configuring the project in your local -

1. Azure

  • Step 1: Create an Azure account

You must have an azure storage account for the project.
Images are stored as a blob in azure. So we need to have a blob container which we would access through our access keys
If you are a student then you can sign up for a $100 free credit on azure here

azure_sa_img

  • Step 2: Creating a new resource

After selecting the storage account. We need to create a new resource.

azure_sa_create

  • Step 3: Fill the form

A form is displayed. You only need to fill in the type of subscription and the name of storage account.
Leave rest to default. Then go to the resource and search for access keys.

azure_sa_aks

  • Step 4: Choose connnection string

After clicking the access keys, we can see our storage account name and connection string (there are two of them, choose anyone)

  • Step 5: Setting up container

As a last step in the resource page, you have to set up the container where we would store the images.
In your newly created storage acc dashboard, click on the blob storag
You must see a page where you can create a new container. Remember this name as we need it
Environment variables to configure azure storage:

CONTAINER_NAME = <BLOB STORAGE CONTAINER NAME>
CONNECTION_STRING = <CONNECTION STRING FOR STORAGE ACCOUNT>

2. Sendgrid email notification

Sendgrid is a bulk emailing service. This project uses Sendgrid along with nodemailer to send transactional emails.

Follow these steps to enable sendgrid email notification -

  • Step 1: To get started you must have a sendgrid account. You can create one here. You can opt for the free tier. It does not require any credit card.
  • Step 2: After signup you need to create an API key. copy the api key and save it somewhere since you won't be able to see it again.
  • Step 3: Since, we have reached this far. One final step is that we have to setup an email which would be authorized to send emails using sendgrid.
What's next ?
  Go to the dashboard and on the left pane go to _settings_ β†’ _sender authentication_ β†’ _single sender verification_ β†’ click on _create new sender_ 
Fill in the necessary details and then you can start sending email using sendgrid.

Environment variables to configure azure storage:

CONTACTS_EMAIL_NAME = <CONTACT RECEIPIENT NAME>
CONTACTS_EMAIL = <CONTACT US PAGE EMAIL>
SENDER_MAIL = <SENDGRID VERIFIED EMAIL>
SENDGRID_API_KEY = <YOUR API KEY>

3. MongoDB

For running our application we need a DB. This project uses mongodb as the database. You can create a free account on the mongodb website and create a db in the cloud.

  • Step 1: First you have to create a project, then after creating a project you can create a DB.

  • Step 2: Go to the dashboard and on the left pane search deployments, then click Build a database

db_deploy

  • Step 3: You would be redirected to a page where you have to choose the config of database. Choose free tier and choose a cloud provider and any region of your choice and choose a cluster name>

  • Step 4: You would be provided a username and password. Note them down somewhere.

  • Step 5: Scroll down to the IP access list. Add 0.0.0.0 as the ip. This would enable global access to your db. Click on close

ip_access A typical mongodb url string looks like this :

_mongodb+srv://\<username\>:\<password\>@cluster345.hy4gkmn.mongodb.net/_

The username is already given. You need to replace the password in the connection string. This gives the full connection string.

MONGODB_URL = <DB CONNECTION STRING>

4. Google Maps API (OPTIONAL)

To show the google maps in the profile pages of restaurants and NGO we need to sign up for a google map API. This project specifically uses GOOGLE maps Javascript API.

GOOGLEMAP_TOKEN = <YOUR API KEY GOES HERE>

Setup Guidelines

To set up and deploy the application, follow these steps:

  • Clone the repository: git clone <repository-url>
  • Install dependencies: npm install
  • Configure environment variables for APIs and services.
  • Start the application: nodemon index.js
  • Access the application in a web browser at http://localhost:3000.

If you have any questions or need further clarification, please feel free to reach out. We appreciate your contribution to making the Food Donation Application a success!

Tech stacks


Contributors

Contributors

Thanks for the contribution