Git Product home page Git Product logo

sample-challenge-apprenticeship's Introduction

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 60 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.

Files to modify:

  • src/routes/authentication.js
  • src/actions/signUp.js
  • src/views/authentication/sign-up.ejs

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.

Files to modify:

  • src/routes/authentication.js
  • src/views/authentication/sign-in.ejs
  • src/actions/signIn.js

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

Files to modify:

  • test/actions/signUp.test.js

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.

Files to modify:

  • src/routes/users.js
  • src/views/users/profile.ejs
  • public/script.js

sample-challenge-apprenticeship's People

Contributors

punitrathore avatar

Watchers

Shereef Bishay avatar James Cloos avatar Michael Masterson avatar

Forkers

silentsoundz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.