This is a FullStack Todo Application, the client is based on Todo MVC
- Stack:
- Client: Basic jQuery selectors, event-handlers, DOM manipulation and AJAX
- Web Server: Node and Express with PostgreSQL
- Database: Locally hosted PostgreSQL
- Tests: Supertest, Chai
As in previous interviews, you may consult official docs and reference-style resources during this coding challenge. You are encouraged to work through as much of it on your own as you can.
- Clone this repository to your local machine
- Install the dependencies for the project
- Ensure your PostgreSQL server is running
- Create a User for this exercise
- Create a database for the exercise with your user as the owner
- Rename the
example.env
file to.env
and update the following fields with your database credentials:MIGRATION_DB_NAME= MIGRATION_DB_USER= MIGRATION_DB_PASS= DB_URL="postgresql://USERNAME@localhost/DATABASE_NAME"
- Run the command
npm run migrate -- 1
to create the database tables - run the command
npm t
- You should see output from 10 integration tests, some will be failing.
NOTE: Due to some deployment requirements you will need to use Postgres version 8 if you are using Node 14. Use Postgres version 7 if you are using Node 12. To change your version of Node you can use nvm.
If you decide to use Node 12 and Postgres 7 you will need to set
ssl: process.env.NODE_ENV === "production"
in postgrator-config andpg.defaults.ssl = process.env.NODE_ENV === "production"
inserver.js
- Add the GET (all) endpoint to this application.
- Add the POST endpoint to this application.
You have completed the task when all the unit tests pass and the client application works without any errors.