backend JSON API with Node.js and PostgreSQL
/topActiveUsers?page={pageNumber}
Returns user info, count of applications in the last week and the names of the 3 latest applied listings. All the users should be listed and ordered by total activity.
/users?id={user.id}
Returns user information at a given user id
- Make sure to have postgres install
- create postgres database
- create
.env
file and include necessary database information - Run the following commands to populate db
psql winter-breeze < structure.sql
psql winter-breeze < data.sql
npm install
npm run start
for productionnpm run start:dev
for development
- Create
docker-compose.yml
. Seedocker-compose.yml.example
for reference - Node app image will be created when postgres db is running
- Check information in
Dockerfile
Estimated time 7-9hr Actual time 12hr
- 0.5hr Understanding of requirements
- 1.5hr getting familiar with Docker usage
- 1.0hr Setting up Node.js and Express.js app
- 2.5hr /topActiveUsers view SQL
- 2.5hr /users view SQL
- 2.0hr testing endpoints and adjust HTTP responses
- 1.5hr experiencing difficulties with Docker ran locally on Windows OS
- 0.5hr documentation