Skip to content

Latest commit

 

History

History
100 lines (64 loc) · 4.06 KB

BackendSetup.md

File metadata and controls

100 lines (64 loc) · 4.06 KB

Backend Setup

Follow the below setup to setup the backend locally. We are using npm as the package manager. So make sure you have node and npm installed in your system.

If not installed, please read installation guide.

Installing dependencies ⏳

  • Open your terminal and navigate to the Milan-Backend directory.
  • Type npm install to install all the dependencies.
  • Once the installation is done, you can start the frontend server by typing npm start.
  • This should start the frontend server on http://localhost:5000/.

Techstack overview 🌀

  • We are currently using ExpressJS v4 along with MongoDB v6 as the backend framework.
  • We are using Nodemon for the hot reloading.
  • List of all the other dependencies can be found in the package.json file.

Setting up .env

We use a .env file using the dotenv package inside the root of the server directory.

You must create a .env file similar to .env.example file, remember that if you are using your own database the data might vary.

Setting up Google Client ID and Client Secret for .env

To set up the Google Client ID and Client Secret for your application, follow these steps:

  1. Project Creation:

    image

  2. Enable API Services:

    • Click on "Enabled API services" and select your project.

image

  1. Create Credentials:
    • Navigate to the "Credentials" section.
    • Click on "Create credentials" and choose "OAuth client ID."

image

  1. Configure OAuth Client:

    • Fill out the form:
      • Choose "Web application" as the application type.
      • Provide your support email.
      • You don't need to provide a logo for the OAuth consent screen.
  2. Obtain Client ID and Client Secret:

    • After completing the configuration, you'll receive your Client ID and Client Secret.

    image

  3. Final Steps:

    • Update your application's .env file with the obtained Client ID and Client Secret.
    CLIENT_ID="your-client-id"
    CLIENT_SECRET="your-client-secret"
    
    
    

Setting up razorpay api key for .env

  • Head on to Razorpay API reference and Sign Up to razor pay remember you don't need to KYC.
  • Login after Signing Up then you will see this interface, you can use the test mode.
image
  • Then move to Account & Settings there you will get API keys option where you can generate the keys.
image
  • Generate and copy the key and its secret and paste it to RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET respectively and you are done setting up backend.
image

Coding standards 🔐

  • Make sure to follow proper latest coding practices.
  • Maintain a good readable folder structure
  • Incase adding an API, do document it.


Next steps 🚀

So now you have the the frontend up and running locally. Now you can start working on the issues. You can follow the below steps to get started with the frontend.