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.
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
Use the following commands to set up and seed your database:
- Create PostgreSQL database
vinyl
:$ npm run db:create
- Set up database tables from
schema.sql
:$ npm run db:schema
- Load seed data from
albums.sql
:$ npm run db:seed
Run the command in the terminal so that the config loads correctly
$ cp .env.template .env
Run the following command in the terminal:
$ npm install
Run the following command in the terminal:
$ npm start
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.
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.
-
Create sign-up.ejs
- form and submit button
-
create user table in schema
-
create sign-up routes
- GET request for page
- POST request for form data, redirects to '/'
-
create queries
- a find user query
- a create user query
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:
- 30: Write a test for the
signUp
action using Mocha. This test should check that calling thesignUp
function adds a row in the database
Routing:
- 20: Navigating to
/users/<USER ID>
loads the profile page. The profile page has a buttonEdit
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
.