Back End GitHub Repository
- Ensure
.envfile is filled in according to.env.sample - Create
/databasedirectory and add filedev.sqlite3to it - Install dependencies:
npm install- Run migrations:
npm run migrate- Seed data:
npm run seed- Start development server:
npm run devGET /api/users/:user-id
- Fetch use details for a given user
- Example Response:
{
"id": 1,
"username": "nuclear.instruments",
"email": "user@example.com"
}GET /api/users/:user-id/boards
- Fetch board details for a specific user
- Example response:
[
{
"id": 1,
"board_name": "My First Board",
"is_public": false
},
{
"id": 2,
"board_name": "Example Board",
"is_public": false
},
{
"id": 3,
"board_name": "music video inspo",
"is_public": true
}
]GET /api/boards/:board-id/pins
- Fetch pins for a specific board
- Example response:
[
{
"id": "xFLA-XMirt",
"type": "YoutubeVidNode",
"data": { "youtube_id": "sDENI1Zx7Wc" },
"position": { "x": 300, "y": 200 }
},
{
"id": "mB_6kTKt3Y",
"type": "TextNode",
"data": { "text": "this is a text box" },
"position": { "x": 250, "y": 100 }
},
{
"id": "WVQoDv6ewX",
"type": "ColorSelectorNode",
"data": { "color": "#4c4cff" },
"position": { "x": 0, "y": 0 }
}
]PUT /api/boards/:board-id/pins
- Update pins on a specific board when a user saves
post /api/users
- Initialize a new user upon registration
post /api/users/:user-id/boards
- Initialize a new board for a given user upon creation
get /api/boards/public
- get all boards that are set to "public"
