This is backend for the application XharkTank, provides endpoints to pitch ideas to investors and to make counter-offers to entrepreneurs.
- Pitch your one in a million idea to the panel of sharks 💸
- Invest in the next big thing 📈
Live Deployed here.
- Node.js - evented I/O for the backend
- Express - fast node.js network app framework
- MongoDB - cross-platform document-oriented database program
XharkTank requires Node.js v14+ and MongoDB v4+ to run.
Install the dependencies and devDependencies.
cd harsh-vardhan320-ME_BUILDOUT_XHARKTANK/
npm install
Setup environments variables. (fill in .env template)
mv src/config/.env.template src/config/.env
Start the server
npm run start
GET /pitches
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>
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
request body
{
"entrepreneur":string,
"pitchTitle":string,
"pitchIdea":string,
"askAmount":float,
"equity":float
}
returns id of the saved document
{
"id" : string
}
Status Code | Description |
---|---|
201 | CREATED |
400 | BAD REQUEST |
500 | INTERNAL SERVER ERROR |
POST /pitches/<pitch_id>/makeOffer
request body
{
"investor":string,
"amount":float,
"equity":float,
"comment":string
}
returns id of the saved document
{
"id" : string
}
Status Code | Description |
---|---|
201 | CREATED |
400 | BAD REQUEST |
404 | NOT FOUND |
500 | INTERNAL SERVER ERROR |
heroku login -i
heroku git:remote -a <your-app-name>
git push heroku master
Set up environment variables
heroku config:set ENV_VAR=<value>
- Harsh Vardhan - Initial work - desert3agle