Skip to content

LearnersGuild/sample-challenge-apprenticeship

Repository files navigation

Vinyl

A community for record enthusiasts to review their favorite albums.

Part of the application has already been built for you. Your job is to take it to completion.

Getting Started

The app uses a simple file structure for an Express web app server that renders views using EJS templates.

public/               # static assets
src/
  actions/            # async server actions (e.g. data CRUD)
  data/               # db schema & seed data
  db/                 # database client & utils
  routes/             # express routes
  views/              # html templates
test/                 # test files for the source files

Setting Up Your Database

Use the following commands to set up and seed your database:

  1. Create PostgreSQL database vinyl: $ npm run db:create
  2. Set up database tables from schema.sql: $ npm run db:schema
  3. Load seed data from albums.sql: $ npm run db:seed

Setting up your config

Run the command in the terminal so that the config loads correctly $ cp .env.template .env

Installing your dependencies

Run the following command in the terminal: $ npm install

Starting your development server

Run the following command in the terminal: $ npm start

Coding Challenge

During the interview you will have 75 minutes to complete all the specs of the challenge.

You'll be allowed to ask your interviewer clarifying questions and can use the internet to search for information as needed.

Each requirement is assigned a point value. A fully complete requirement will earn you full points; partially complete requirements get partial points; incomplete requirements get no points. Overall completeness is determined by dividing the total points earned by the total points available. There is a requirement of completion of 80% of the specs to secure a passing result.

Specs

Sign Up

Routing:

  • 20: Navigating to /sign-up loads the sign up page.

Users can:

  • 40: Sign up for an account with a name, email and password.
  • 10: Be redirected to the home page (/) after signing up.

Users CANNOT:

  • 10: Sign up without a name value
  • 10: Sign up without an email address value
  • 30: Sign up without an email that is already in use.

Sign in

Routing:

  • 20: Navigating to /sign-in loads the sign in page.

Users can:

  • 20: Sign in to an existing account with an email address and password.
  • 10: Be redirected to the home page (/) after signing in.

Users CANNOT:

  • 30: Sign in with an invalid email address and password combination.

Testing

Testing:

  • 30: Write a test for the signUp action using Mocha. This test should check that calling the signUp function adds a row in the database

Profile

Routing:

  • 20: Navigating to /users/<USER ID> loads the profile page. The profile page has a button Edit which when clicked, navigates to the edit profile page.
  • 20: Navigating to /users/<USER ID>/edit loads the edit profile page.
  • 20: Sending a PUT request to /users/<USER ID> updates the profile of the user

Users can:

  • 10: See their username and email
  • 30: Edit their username and email using AJAX. Updating their profile should NOT require a page refresh. Submitting the form on /users/<USER ID>/edit page asynchronously updates the profile information. The user remains on the edit page /users/<USER ID>/edit.

About

Sample Challenges for Phase Interviews

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published