/XharkTank-CrioLaunch

Mini Project for Crio Launch 2022

Primary LanguagePython

XharkTank

This is backend for the application XharkTank, where entrepreneurs from all around can pitch their unique ideas and investors can offer them an investment in exchange of some equity of their company.

  • Pitch your one in a million idea to the panel of sharks.
  • Invest in the company which is going to be the next Big thing.

Live Deployed here.

Stack

  • Node.js - evented I/O for the backend
  • Express - fast node.js network app framework
  • MongoDB - cross-platform document-oriented database program

Installation

Install the dependencies.

cd mohitjaiswal819-ME_BUILDOUT_XHARKTANK/
npm install

Setup environments variables.

  • Inside the config folder , set your enviroment variables (PORT and MongoURI)
cd config/

Start the server

npm run start

File Structure

.
├── _CRIO_
			  ├── metadata.json
├── assessment
			  ├── main.py
			  ├── requirements.txt
├── config 
│             ├── config.env
│             ├── db.js
├── models                        
│             ├── investor.js
			  ├── pitch.js
├── routes                        
│             ├── index.js
├── server.js

├── .gitignore
├── package.json
├── package-lock.json
├── README.md
├── server_run.sh
├── setup.sh

Features

Endpoints

GET /pitches

Response

  • Returns JSON of all pitches in reverse chronological order.
[
   {
      "id":string,
      "entrepreneur":string,
      "pitchTitle":string,
      "pitchIdea":string,
      "askAmount":float,
      "equity":float,
      "offers":[
         {
            "id":string,
            "investor":string,
            "amount":float,
            "equity":float,
            "comment":string
         }
      ]
   }
]
Status Code Description
200 OK
500 INTERNAL SERVER ERROR

GET /pitches/<pitch_id>

Response

  • Returns JSON of a pitch.
{
      "id":string,
      "entrepreneur":string,
      "pitchTitle":string,
      "pitchIdea":string,
      "askAmount":float,
      "equity":float,
      "offers":[
         {
            "id":string,
            "investor":string,
            "amount":float,
            "equity":float,
            "comment":string
         }
      ]
   }
Status Code Description
200 OK
404 NOT FOUND
500 INTERNAL SERVER ERROR

POST /pitches

Response

  • Returns id of the saved entry.
{
  "id" : string
}
Status Code Description
201 CREATED
400 BAD REQUEST
500 INTERNAL SERVER ERROR

POST /pitches/<pitch_id>/makeOffer

Response

  • Returns id of the saved entry.
{
  "id" : string
}
Status Code Description
201 CREATED
400 BAD REQUEST
404 NOT FOUND
500 INTERNAL SERVER ERROR

Deployment

Heroku Deployment

heroku login -i
heroku git:remote -a <your-app-name>
git push heroku master

Set up environment variables

heroku config:set ENV_VAR=<value>

Authors