Home

Awesome

API Documentation

Maintainability Score: https://codeclimate.com/github/Lambda-School-Labs/allay-be/maintainability

Backend delpoyed at Heroku <br>

Getting Started

To get the server running locally:

Backend Framework

ESLint && Prettier

Endpoints

Auth Routes

MethodEndpointAccess ControlDescription
POST/auth/registerall usersRegister a new user account.
POST/auth/loginall usersLogin with a registered account.

Users Routes

MethodEndpointAccess ControlDescription
GET/users/alladminsReturns list of all users.
GET/users/:userIdall usersReturns info for a single user by id.
PUT/users/:userIdall usersUpdate user's account info by id.
DELETE/users/:userIdall usersDelete user's account by id.
PUT/users/:userId/bindadminsUpdates the user's bind status.
GET/users/:userId/reviewsall usersReturns a list of review by user.
GET/users/:userId/reviews/:revIdall usersReturns a single review by user.
POST/users/:userId/add-reviewall usersPost helpful review.
PUT/users/:userId/reviews/:revIdall usersUpdate a review by id.
DELETE/users/:userId/reviews/:revIdall usersDelete a review by id.

Company Routes

MethodEndpointAccess ControlDescription
GET/companiesall usersReturns list of all companies.
GET/companies/:comIdall usersReturns the information for a single company.
POST/companiesall usersCreates a new company.

Reviews Routes

MethodEndpointAccess ControlDescription
GET/reviewsall usersReturns list of all reviews.
GET/reviews/:revIdall usersReturns a single review.

Data Model

USERS


EXPECTS
{
    "email": "nasra555@nasra.com",
    "password": "nasra555",
    "track_id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "cohort": "Full Time 1"
}
RETURNS
{
    "id": 1,
    "email": "nasra555",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJuYXNyYSIsImlhdCI6MTU4NTA2ODAzMSwiZXhwIjoxNTg1MDk2ODMxfQ.szdbRq9uZzvoIw84ka4qelk6ozbIgO8RyQLqtrJ2bqc"
}

SEEDED TABLES


TRACKS TABLE
idtrack_name
1AND
2DS
3WEB
4iOS
5UX
WORK STATUS TABLE
idwork_status
1Current Employee
2Former Employee
3Full Time
4Part Time
5Intern
6no work status

--- no work status is going to be the default for interview reviews that don't need it

OFFER STATUS TABLE
idwork_status
1No Offer
2Offer Accepted
3Offer Declined
4no offer status

--- no offer status is going to be the default for company reviews that don't need it

REVIEW TYPES TABLE
idwork_status
1Company
2Interview
STATES TABLE
idstate_name
1AL
2AK
3AZ
4AR
5CA
6CO
7CT
......
50WY
51Remote
52Unknown

ALL REVIEWS


COMPANY REVIEWS
EXPECTS
{
    work_status_id: 1
    job_title: "Software Geniius"
    city: "Nashville"
    state_id: 42
    start_date: 2010
    end_date: 2012
    company_name: "Facet Biotech"
    comment: "What is Lorem ipsum? A quick and simplified answer is that Lorem Ipsum refers to text that the DTP (Desktop Publishing) industry use as replacement text when the real text is not available.For example, when designing a brochure or book, a designer will insert Lorem ipsum text if the real text is not available. The Lorem ipsum text looks real enough that the brochure or book looks complete. The book or brochure can be shown to the client for approval. "
    typical_hours: 50
    salary: 6000
    review_type_id: 1
    overall_rating: 3
}
RETURNS
{
    review_id: 1
    user_id: 1
    username: "thisisarealuser"
    track_name: "WEB"
    review_type_id: 1
    company_name: "Nintendo"
    logo: "nintendo.com"
    work_status: "Intern"
    job_title: "Software Geniius"
    city: "Nashville"
    state_id: 42
    start_date: 2010
    end_date: 2012
    interview_rounds: 3
    phone_interview: false
    resume_review: false
    take_home_assignments: false
    online_coding_assignments: false
    portfolio_review: false
    screen_share: false
    open_source_contribution: false
    side_projects: false
    comment: "What is Lorem ipsum? A quick and simplified answer is that Lorem Ipsum refers to text that the DTP (Desktop Publishing) industry use as replacement text when the real text is not available.For example, when designing a brochure or book, a designer will insert Lorem ipsum text if the real text is not available. The Lorem ipsum text looks real enough that the brochure or book looks complete. The book or brochure can be shown to the client for approval. "
    typical_hours: 50
    salary: 6000
    difficulty_rating: 4
    offer_status: "No Offer"
    overall_rating: 3
    created_at: "2020-03-20T23:52:55.681Z"
    updated_at: "2020-03-20T23:52:55.681Z"

}
INTERVIEW REVIEWS
EXPECTS
{
    "job_title": "Full Stack Developer",
    "city": "Los Angeles",
    "state_id": 5,
    "company_name": "Twitch",
    "phone_interview": false,
    "resume_review": false,
    "take_home_assignments": false,
    "online_coding_assignments": false,
    "portfolio_review": false,
    "screen_share": true,
    "open_source_contribution": false,
    "side_projects": false,
    "comment": "What is Lorem ipsum? A quick and simplified answer is that Lorem Ipsum refers to text that the DTP (Desktop Publishing) industry use as replacement text when the real text is not available.For example, when designing a brochure or book, a designer will insert Lorem ipsum text if the real text is not available. The Lorem ipsum text looks real enough that the brochure or book looks complete. The book or brochure can be shown to the client for approval. ",
    "difficulty_rating": 4,
    "salary": "1234567",
    "review_type_id": 2,
    "overall_rating": 3,
    "offer_status_id": "2"
}
RETURNS
{
    "review_id": 2,
    "user_id": 1,
    "username": "aaron123",
    "review_type_id": 2,
    "company_name": "Twitch",
    "logo": "twitch.com",
    "work_status": "Former Employee",
    "job_title": "Full Stack Developer",
    "city": "Los Angeles",
    "state_id": 5,
    "start_date": 2123,
    "end_date": 2000,
    "interview_rounds": 3,
    "phone_interview": false,
    "resume_review": false,
    "take_home_assignments": false,
    "online_coding_assignments": false,
    "portfolio_review": false,
    "screen_share": true,
    "open_source_contribution": false,
    "side_projects": false,
    "comment": "What is Lorem ipsum? A quick and simplified answer is that Lorem Ipsum refers to text that the DTP (Desktop Publishing) industry use as replacement text when the real text is not available.For example, when designing a brochure or book, a designer will insert Lorem ipsum text if the real text is not available. The Lorem ipsum text looks real enough that the brochure or book looks complete. The book or brochure can be shown to the client for approval. ",
    "typical_hours": 40,
    "salary": 6000,
    "difficulty_rating": 4,
    "offer_status_id": 2
    "overall_rating": 3,
    "created_at": "2020-03-19T20:32:17.896Z",
    "updated_at": "2020-03-19T20:32:17.896Z"
}

COMPANIES


EXPECTS

{
    "company_name": "1 Million Cups Organizer",
    "hq_city": "Kansas City",
    "state_id": 25,
    "domain": "1millioncups.com",
    "industry_name": "Philanthropy",
    "size_range": "51 - 200",
    "linkedin_url": "linkedin.com/company/1-million-cups-organizer"
}

RETURNS

{
    "id": 12,
    "company_name": "1 Million Cups Organizer",
    "hq_city": "Kansas City",
    "state_id": 25,
    "domain": "1millioncups.com",
    "industry_name": "Philanthropy",
    "size_range": "51 - 200",
    "linkedin_url": "linkedin.com/company/1-million-cups-organizer"
}

Actions


User Actions

findUsers() -> Returns all users

findUsersBy(filter) -> Returns a single user by specified filter. Must use {}.

findUserById(userId) -> Returns all data for a single user by ID (including all company and interview).

findUserReviews(userId) => Returns reviews related to a user.

findUserReviewById(revId) => Returns a single review related to a user.

addUser(newUser) -> Creates a new user and returns that user.

updateUser(userId) -> Update a single user by ID.

deleteUser(userId) -> Deletes everything dependent on the user. <br />

Company Actions

findCompanies() -> Retruns a list of all companies.

findCompaniesBy(filter) -> Returns a single company by specified filter.

findCompanyBy(comId) -> Returns a single company by ID.

findCompanyReviews(comId) -> Returns all reviews for a specific company.

addCompany(newCompany) --> Creates a new company and returns that company. If the company already exists the company will not be added.

updateCompany(comId, changes) -> Updates a single company by ID.

deleteCompany(comId) -> Deletes the single company. <br>

Review Actions

findReviews() -> Returns a list of all reviews.

findReviewsBy(filter) -> Returns a single company review by specified filter.

findRevieswById(revId) -> Returns a single review by review ID.

addReview(newReview) --> Creates a new review and returns that review.

updateReview(revId, changes) -> Updates a single review by ID.

deleteReview(revId) -> Deletes a single review by ID. <br>

Environment Variables

In order for the app to function correctly, the user must set up their own environment variables.

create a .env file that includes the following:

_ NODE_ENV - Notates the enviroment for the server to run on. Options include 'testing', 'development', and 'production'. Auto defaults to development.

_ DB_DEV - Notates the postgres database URL for local development.

_ DB_TEST - Notates the postgres database URL for local testing.

<!-- - JWT*SECRET - you can generate this by using a python shell and running import random''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#\$%^&amp;*(-_=+)') for i in range(50)]) -->

Seeding Companies.csv File into Heroku Server

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct. Please follow it in all your interactions with the project.

Issue/Bug Request

If you are having an issue with the existing project code, please submit a bug report under the following guidelines:

Feature Requests

We would love to hear from you about new features which would improve this app and further the aims of our project. Please provide as much detail and information as possible to show us why you think your new feature should be implemented.

Pull Requests

If you have developed a patch, bug fix, or new feature that would improve this app, please submit a pull request. It is best to communicate your ideas with the developers first before investing a great deal of time into a pull request to ensure that it will mesh smoothly with the project.

Remember that this project is licensed under the MIT license, and by submitting a pull request, you agree that your work will be, too.

Pull Request Guidelines

Attribution

These contribution guidelines have been adapted from this good-Contributing.md-template.

Documentation

See Frontend Documentation for details on the frontend of our project.