Back-end repository of the donations portal.
git clone https://helpDAO/donation-backend.git
cd donation-backend
npm start
Make sure that mongodb is running
git clone https://helpDAO/donation-backend.git
cd donation-backend
docker-compose up -d
- routes Dir to store the express' router modules of the app.
- controllers Dir to store the controllers of the app,
- models Dir to store the Mongoose models of the app.
- middlewares Dir to store some middle-wares scripts.
{
name:{type:String, unique:true, required:true},
verified:{type:Boolean, required:false, default:false},
signUpDate: { type: Date, default: Date.now() }
description:{type:String, unique:false, maxlength:10000, required:true},
inviteLink:{type:String, unique:false, required:true},
daoAddress:{type:String,unique:false, required:true},
donationAddress:{type:String,unique:false, required:true},
}
If you want to try the requests in postman you can use this collection
Just click the import button (Top-Left corner), paste the link in the "Import from link" section and click import.
All the Squad's routes starts with these URL: localhost:3001/squad
-
-
Method: POST
-
Endpoint:
/new
-
Header:
{Content-Type: application/json}
-
Body:
{ "name":"SquadTest", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest", "daoAddress":"0x0472ec0185ebb8202f3d4ddb0226998889663cf2 " }
-
Response:
{ "verified": false, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77dedb7d032151fbfb3eb9", "name": "SquadTest", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest", "daoAddress":"0x0472ec0185ebb8202f3d4ddb0226998889663cf2 ", "__v": 0 }
-
-
-
Method: GET
-
Endpoint:
/:squadId
-
Example:
/5e77dedb7d032151fbfb3eb9
-
Response:
{ "verified": false, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77dedb7d032151fbfb3eb9", "name": "SquadTest", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest", "daoAddress":"0x0472ec0185ebb8202f3d4ddb0226998889663cf2 ", "__v": 0 }
-
-
-
Method: POST
-
Endpoint:
/find
-
Header:
{Content-Type: application/json}
-
Body:
{ "squadField":"fieldValue" }
-
Example:
{ "name":"SquadTest" }
-
Response:
"squads": [ { "verified": false, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77dedb7d032151fbfb3eb9", "name": "SquadTest", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest", "daoAddress":"0x0472ec0185ebb8202f3d4ddb0226998889663cf2 ", "__v": 0 } ]
-
-
-
Method: GET
-
Endpoint:
/all
-
Response:
{ "squads": [ { "verified": false, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77de9d7d032151fbfb3eb8", "name": "SquadTest", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest", "daoAddress":"0x0472ec0185ebb8202f3d4ddb0226998889663cf2 ", "__v": 0 }, { "verified": true, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77dedb7d032151fbfb3eb9", "name": "SquadTest2", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest2", "daoAddress":"0x4e709797a971e49018402446f753d467275f75ad ", "__v": 0 } ] }
-
-
-
Method: GET
-
Endpoint:
/all/unverified
-
Response:
{ "squads": [ { "verified": false, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77de9d7d032151fbfb3eb8", "name": "SquadTest", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest", "daoAddress":"0x0472ec0185ebb8202f3d4ddb0226998889663cf2 ", "__v": 0 } ] }
-
-
-
Method: GET
-
Endpoint:
/all/verified
-
Response:
{ "squads": [ { "verified": true, "signUpDate": "2020-03-22T21:54:33.740Z", "_id": "5e77dedb7d032151fbfb3eb9", "name": "SquadTest2", "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "inviteLink":"t.me/squadTest2", "daoAddress":"0x4e709797a971e49018402446f753d467275f75ad ", "__v": 0 } ] }
-
Lets make an standard for the scripts' naming, every file should follow the next pattern:
filename.dirname.extension
Where dirname is the directory where is contained the file.
If the file is included in the main directory this is the schema:
filename.extension
Also lets avoid to use names that begins with uppercase.
- Fork the repo and switch to a new branch using
git checkout -b [branch_name]
- Code your stuff.
- Commit and push to your own forked repo using
git add [files]
,git commit -m [your message]
andgit push origin [branch_name]
- Make a pull request from your forked repo.