Underdog Devs is a group of software developers supporting the formerly incarcerated & disadvantaged in their transition into the software industry.
The base technologies are JavaScript, HTML and CSS. The frontend leverages React, the backend uses Express and PostgreSQL, the server runs on Heroku, and the authentication workflow runs on Okta.
- From the backend directory, in your terminal:
- Create an environment file (.env) and populate the environment variables (Migrate/Seed your local database)
- Make sure the
.env
is in your.gitignore
- Follow the Lambda instructions to set up the local PostgreSQL database
- In addition, create a 'test' database (for use in integration testing), and set the
TESTING_DATABASE_URL
environment variable, following the format of theDATABASE_URL
variable, inside of your.env
file to configure your connection to it. For reference this format is:postgresql://USERNAME:PASSWORD@localhost:8080/DATABASE_NAME
- In addition, create a 'test' database (for use in integration testing), and set the
- Download the server dependencies by running
npm install
- Migrate your tables by running
npm run knex migrate:latest
- Seed your tables by running
npm run knex seed:run
- Start up the server by running
npm run watch:dev
- From the frontend directory in your terminal:
- Download the frontend dependencies by running
npm install
- Start up the app by running
npm start
- Download the frontend dependencies by running
Whimsical Relational Database Design
Status Codes Please see this file for more info.
Method | Endpoint | Request Body | Returns |
---|---|---|---|
GET | / |
- | { api: "up", timestamp } |
User | Authorization |
---|---|
SuperAdmin | only SuperAdmin can access |
Admin | only admin and up can access |
Mentor | only mentor and up can access |
Anyone has access |
{
"profile_id": "00ulzfj6nX72gu3Nh4d6",
"email": "[email protected]",
"first_name":"John",
"last_name":"Doe",
"location": "Sedona, Arizona",
"company": "Unemployed",
"tech_stack": ["react", "msPaint"],
"role_id": 3,
"created_at": "2022-03-30T23:36:21.053Z",
"updated_at": "2022-03-30T23:36:21.053Z",
"is_active": true,
"progress_status": null,
"attendance_rate": 0.4689,
"progress_id": null
}
Method | Endpoint | Required Request Body | Returns | User Auth | DS API? |
---|---|---|---|---|---|
GET | /profile |
- | get all profiles |
Admin |
false |
GET | /profile/:id |
- | get profile by id |
Admin |
false |
GET | /profile/current_user |
- | get current profile |
false | |
POST | /profile |
first/last, email |
create new profile |
false | |
PUT | /profile/ |
update current profile |
false | ||
PUT | /profile/:id |
update a profile by profile id |
Admin |
false | |
PUT | /profile/roles |
role |
update a profiles role |
Admin |
false |
PUT | /profile/is_active/:id |
- | activates/deactivates a profile |
SuperAdmin |
false |
POST | /profile/mentor/information |
- | mentor name, city, state, and availability |
true | |
POST | /profile/mentee/information |
- | mentee name, city, state |
true | |
POST | /profile/availability/:profile_id |
accepting_new_mentees |
update availability status |
User |
{
"application_id": 1,
"position": "4",
"profile_id": "10",
"approved": false,
"created_at": "2021-11-01T17:59:02.023Z",
"application_notes":"Notes about applicant",
}
{
"profile_id": "string",
"first_name": "string",
"last_name": "string",
"email": "[email protected]",
"country": "string",
"state": "string",
"city": "string",
"current_company": "string",
"current_position": "string",
"tech_stack": [
"string"
],
"job_help": true,
"industry_knowledge": true,
"pair_programming": true,
"commitment": true,
"referred_by": "string",
"other_info": "string",
"validate_status": "pending",
"is_active": false,
"accepting_new_mentees": false
}
{
"profile_id": "string",
"first_name": "string",
"last_name": "string",
"email": "[email protected]",
"country": "string",
"state": "string",
"city": "string",
"formerly_incarcerated": true,
"underrepresented_group": true,
"low_income": true,
"convictions": "string",
"tech_stack": "string",
"job_help": true,
"pair_programming": true,
"referred_by": "string",
"other_info": "string",
"validate_status": "approved",
"is_active": true,
"in_project_underdog": true
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /application/ |
- | gets all pending applications |
Admin |
GET | /application/:role |
-mentor or mentee (req.param) |
gets all pending applications filtered by role |
Admin |
GET | /application/profileId/:id |
-profile id (req.param) |
gets pending application by profile id |
Admin |
POST | /application/new/:role |
-mentor or mentee (req.param) , sign-up form data(mentor/mentee intake) |
stores intake data & creates new pending application |
|
PUT | /update-validate_status/:profile_id |
-position (role) , validate_status , |
create profile and update application to approved: true |
Admin |
PUT | /application/register/:id |
-profile_id (req.param) |
registers user to okta & updates application to approved: true |
Admin |
PUT | /application/update-notes/:id |
-application_id (req.param) , application_notes (req.body.application_notes) |
updates note field on application ticket |
Admin |
PUT | /application/intake/:role/:id |
-role (req.param) , profile_id (req.param) |
get mentor or mentee intake data from DS database |
Admin |
{
"application_id": 2,
"created_at": "2022-01-13T20:44:31.827Z",
"first_name": "User",
"last_name": "8",
"profile_id": "00u13oned0U8XP8Mb4x7",
"role_name": "mentee"
}
{
"assignment_id": 1,
"mentor_id": "7",
"mentee_id": "10"
}
{
"assignment_id": 1,
"mentee_id": "10",
"email": "[email protected]",
"first_name": "User",
"last_name": "10",
"role_id": 4,
"created_at": "2021-11-01T17:59:02.023Z",
"pending": true
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /assignments |
- | get all assignments |
Admin |
GET | /assignments/:assignment_id |
- | get assignment by assignment id |
Admin |
GET | /assignments/mentor/:id |
- | get all the mentees a mentor has by the mentor's id |
Admin |
GET | /assignments/mentee/:id |
- | get all the mentors a mentee has by the mentee's id |
Admin |
GET | /assignments/mymentors |
- | get all the mentors the current user has |
|
GET | /assignments/mymentees |
- | get all the mentees the current user has |
|
POST | /assignments |
mentor_id ,mentee_id |
create a new assignment between a mentor and mentee |
Admin |
PUT | /assignments/:id |
mentor_id or mentee_id |
update a assignment by assignment id, |
Admin |
DELETE | /assignments/:id |
- | delete assignment by assignment_id |
Admin |
{
meeting_id: 2,
created_at: 2022-03-12T00:42:20.382Z,
updated_at: 2022-03-12T00:42:20.382Z,
meeting_topic: 'lorem dipz um',
meeting_start_date: 1640353440,
meeting_end_date: 1640354210,
host_id: '7',
attendee_id: '00ultx74kMUmEW8054x6',
meeting_notes: 'Remember to bring a smile',
meeting_missed: 'Pending'
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /meetings |
- | get all meetings |
Admin |
GET | /meetings/:meeting_id |
- | get meeting by meeting id |
Admin |
GET | /meetings/profile/:profile_id |
- | get all the meetings a profile_id has scheduled |
Admin |
GET | /meetings/my-meetings |
- | get all the meetings the current user has |
|
POST | /meetings |
meeting_topic ,meeting_date , meeting_time ,host_id ,attendee_id , |
create a new meeting |
Mentor |
PUT | /meetings/:meeting_id |
meeting_topic or meeting_date or meeting_time or host_id or attendee_id |
update a meeting by meeting_id, |
Mentor |
DELETE | /meetings/:meeting_id |
- | delete meeting by meeting_id |
Mentor |
{
"resource_id": 1,
"created_at": "2021-11-12T19:50:44.914Z",
"updated_at": "2021-11-12T19:50:44.914Z",
"resource_name": "MacBook Pro 2020",
"category": "Computers",
"condition": "Excellent",
"assigned": true,
"current_assignee": "9",
"previous_assignee": "7",
"monetary_value": "1000$",
"deductible_donation": true
}
Method | Endpoint | URL Parameters | Required Request Body | Returns | User Auth |
---|---|---|---|---|---|
GET | /resources |
Allows Querying (i.e. /resources?condition=Excellent ) |
- | get all resources |
|
GET | /resources/:resource_id |
resource_id (required) must be an integer value |
- | get a resource by resource_id |
|
POST | /resources |
resource_name ,category ,condition |
add a new resource to the db |
Admin |
|
PUT | /resources/:resource_id |
resource_id (required) must be an integer value |
resource_name ,category ,condition |
update a resource by resource_id, |
Admin |
DELETE | /resources/:resource_id |
resource_id (required) must be an integer value |
- | delete a resource by resource_id from db |
Admin |
Resource tickets is the management system for Mentors/Admin to communicate about a specific resource. (Requests, Recommendations, etc.)
{
"resource_ticket_id": 1,
"created_at": "2021-11-12T19:50:44.916Z",
"updated_at": "2021-11-12T19:50:44.916Z",
"submitted_by": "7",
"pertains_to": "Elon Musk",
"message": "Elon deserves to have the 2020 MacBook Pro. Of all the mentees I have, I think he has the most potential."
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /resource-tickets |
- | get all resource tickets |
Admin |
GET | /resource-tickets/:resource_ticket_id |
- | get a ticket by it id |
Admin |
GET | /resource-tickets/mytickets |
- | get all the current user's tickets |
|
POST | /resource-tickets |
message |
create a new ticket |
Mentor |
PUT | /resource-tickets/:resource_id |
message |
update a ticket by resource_ticket_id, |
Mentor |
DELETE | /resource-tickets/:resource_id |
- | delete a ticket by resource_id from db |
Mentor |
{
"action_ticket_id": 2,
"submitted_by": "11",
"subject_id": "00u13oned0U8XP8Mb4x7",
"issue": "My mentor isn't really helping me learn, could I seek reassignment?",
"comments": null,
"pending": true,
"resolved": true,
"strike": false,
"created_at": "2021-12-07T17:08:00.987Z",
"updated_at": "2021-12-07T17:08:00.987Z"
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /actions |
- | get all actions tickets |
- |
GET | /actions/:actions_id |
- | get an actions ticket by id |
- |
POST | /actions |
submitted_by , subject_id , issue |
create a new actions ticket |
- |
PUT | /actions/:actions_id |
- | update an actions ticket |
- |
{
"profile_id": 2,
"role_id": 4 (from 2 to 5)
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /roles |
- | get all available roles |
admin |
GET | /roles/:profile_id |
- | get a specific profile's role_id |
- |
PUT | /roles/:profile_id |
role_id |
update a profile's role |
admin |
{
"role_ticket_id": 1,
"submitted_by": "00ulthapbErVUwVJy4x6",
"subject_id": "00ulthapbErVUwVJy4x6",
"requested_role": 1,
"approved_by": "00ulthapbErVUwVJy4x6",
"comments": "This is my 1st dummy data comment",
"pending": true,
"resolved": false,
"created_at": "2022-01-25T20:33:26.119Z",
"updated_at": "2022-01-25T20:33:26.119Z"
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /role-tickets |
- | get all role tickets |
admin |
GET | /role-tickets/:role_ticket_id |
- | get a specific role ticket |
admin |
POST | /role-tickets |
submitted_by , subject_id , requested_role |
create a new role ticket |
|
PUT | /role-tickets/:role_ticket_id |
- | updates a role ticket by id |
|
DELETE | /role-tickets/:role_ticket_id |
- | delete a role ticket by id |
{
"profile_id": 2,
"progress_id": 4 (from 1 to 5)
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /progress |
- | get all available progress tags |
mentor |
GET | /progress/:profile_id |
- | get a specific profile's current progress |
- |
PUT | /progress/:profile_id |
progress_id |
update a profile's progress |
admin |
{
"note_id": 1 (PK, integer, automatically generated),
"created_by": profile_id of note creator(FK),
"content_type": type here,
"status": ["in progress", "resolved", "no action needed", "escalated"]
"content": note text,
"level": low medium or high,
"visible_to_admin": true,
"visible_to_mentor": true,
"visible_to_mentee": false,
"mentor_id": profile_id of mentor(FK),
"mentee_id": profile_id of mentee(FK),
"created_at": timestamp with time zone (automatically generated),
"updated_at": timestamp with time zone (automatically generated)
}
Method | Endpoint | Required Request Body | Returns | User Auth |
---|---|---|---|---|
GET | /notes |
- | get all notes |
- |
GET | /notes/:note_id |
note_id (params) |
get note by note_id |
- |
GET | /notes/mentee/:mentee_id |
mentee_id (params) |
get notes by mentee_id |
- |
POST | /notes |
created_by , |
newly created note |
- |
`content_type`,
`status`,
`content`,
`level`,
`visible_to_admin`,
`visible_to_mentor`,
`visible_to_mentee`,
`mentor_id`,
`mentee_id` | `added note` | - |
| PUT | /notes/:note_id
| note_id
(params), status, content, and/or level
| updated note
| - |
| DELETE | /notes/:note_id
| note_id
(params) | remove note by note_id
| - |