GithubHelp home page GithubHelp logo

breakingbug-backend's Introduction

Breaking Bug - Backend Repository

Breaking Bug Poster

Table of Content

Introduction

This repository contains the backend code for the Breaking Bug event. The event is organized by IEEE Computer Society, Manipal University Jaipur.\

Breaking Bug is an electrifying virtual showdown for tech enthusiasts and coding maestros! An exciting and challenging event where participants step into the shoes of skilled developers and problem-solvers! In this unique competition, their mission is to identify and fix bugs in a GitHub repository across three diverse domains: Frontend, Backend, and Machine Learning (ML).

Pre-requisites

How to get started?

  • Fork the repository.
  • Clone the repository in your local system.
  • Follow the steps mentioned in the Setting up the project section.
  • Once you have set up the project, you can start working on the issues.
  • After you have made the changes, push the code to your forked repository.
  • Put the link to your forked repository in the Google Forms which will be shared with you.

Setting up the project

Fork the repository by clicking on the Fork button on the top right corner of the page.

Clone the repository in your local system.

git clone https://github.com/<your-github-username>/BreakingBug-Backend.git

Navigate to the project directory.

cd BreakingBug-Backend

Install the dependencies.

npm install

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

PORT=3000
MONGO_URL=<Your MongoDB URI>
SECRET_KEY=<Your JWT Secret>

Start the server.

npm start

The server will start running on http://localhost:5000.

Once this is done, set up the database. For that, run the following command:

node database.js

This should make the required schemas in the database. You can now start working on the issues.

Project Information

The maximum attainable points for this project are 1000. The points are distributed as follows:

Difficulty Level Points Count Total
Very easy 10 3 30
Easy 20 13 260
Medium 30 15 450
Hard 40 4 160
Easter egg 50 2 100
Total 1000

Pie Chart

Postman Collection

Postman is a collaboration platform for API development. You can use the following Postman collection to test the API endpoints.
For a tutorial on how to use Postman, you can refer to the following link.
Click on the button below to import the Postman collection.

Run in Postman

Database Schema

The database schema for the project is as follows:
You can also view the schema in the models directory in the project.

Here is the schema listed in a tabular format:

1. Customer Schema

Field Type Required Unique Default Subfields
name String Yes No - -
email String Yes Yes - -
password String Yes No - -
role String No No Customer -
cartDetails Array No No - productName, price (mrp, cost, discountPercent), subcategory, productImage, category, description, tagline, quantity, seller (ref: seller)
shippingData Object No No - address, city, state, country, pinCode, phoneNo

2. Order Schema

Field Type Required Unique Default Subfields
buyer ObjectId (ref: customer) Yes No - -
shippingData Object Yes No - address, city, state, country, pinCode, phoneNo
orderedProducts Array No No - productName, price (mrp, cost, discountPercent), subcategory, productImage, category, description, tagline, quantity, seller (ref: seller)
paymentInfo Object Yes No - id, status
paidAt Date Yes No - -
productsQuantity Number Yes No 0 -
taxPrice Number Yes No 0 -
shippingPrice Number Yes No 0 -
totalPrice Number Yes No 0 -
orderStatus String Yes No Processing -
deliveredAt Date No No - -
createdAt Date No No Date.now() -

3. Product Schema

Field Type Required Unique Default Subfields
productName String No No - -
price Object No No - mrp, cost, discountPercent
subcategory String No No - -
productImage String No No - -
category String No No - -
description String No No - -
tagline String No No - -
quantity Number No No 1 -
reviews Array No No - rating, comment, reviewer (ref: customer), date
seller ObjectId (ref: seller) No No - -

4. Seller Schema

Field Type Required Unique Default
name String Yes No -
email String Yes Yes -
password String Yes No -
role String No No Seller
shopName String Yes Yes -

Here are the sub-schemas used in the above schemas:

Cart Details

Field Type Required Unique Default
productName String No No -
price Object No No -
mrp Number No No -
cost Number No No -
discountPercent Number No No -
subcategory String No No -
productImage String No No -
category String No No -
description String No No -
tagline String No No -
quantity Number No No -
seller ObjectId (ref: seller) No No -

Shipping Schema

Field Type Required Unique Default
address String No No -
city String No No -
state String No No -
country String No No -
pinCode Number No No -
phoneNo Number No No -

Payment Info Schema

Field Type Required Unique Default
id String Yes No -
status String Yes No -

Price Schema

Field Type Required Unique Default
mrp Number No No -
cost Number No No -
discountPercent Number No No -

Reviews Schema

Field Type Required Unique Default
rating Number No No -
comment String No No -
reviewer ObjectId (ref: customer) No No -
date Date No No Date.now()

Setting up the database schema

To set up the database schema, follow these steps:

  1. Create a new database in MongoDB.
  2. Create the collections in the database as per the schema mentioned above.
  3. Use the mongoose library to create the collections programmatically.
  4. Once you have created the collections, you can start using the API endpoints to interact with the database.

Resources

Made by IEEE Computer Society- Manipal University Jaipur


IEEE CS MUJ Logo


breakingbug-backend's People

Contributors

awesomesam9523 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.