Challenge Overview
Challenge Overview
Welcome to the Apophis Bunker App API challenge. Our goal here is to implement authentication and admin (CRUD) endpoints for the application. Swagger and db model design is provided and we’re using starter pack code - Node + Postgres
Project Overview
The intent of this project is to create an MVP web application - Bunker Desk Tool Kit - to manage the activities currently done with a combination of excel tools and manual tasks. Using the new web application, users will be able to:
-
Schedule bunker deliveries and resupply movements
-
Report and communicate effectively with third-party terminals, barges, and agents
-
Provide optimal blend opportunities
-
Update Marketers and Traders of the status of inventories and deliveries
Technology Stack
-
NodeJS
-
Postgres
-
Sequelize
Assets
Swagger API definition and database model is provided in the forums. Starter pack for the codebase is available here.
Individual requirements
Endpoints in scope are:
-
Auth
-
Areas
-
Users (except for GET ���/users���/azure)
-
Facilities
-
Contacts
-
Products
-
Tanks
All the endpoints are plain CRUD endpoints with no additional business logic attached, except for the login endpoint (see below for login requirements)
Read operations (list, get) are available to any logged in user. All other (POST/PUT/PATCH/DELETE) are available only to users with “admin” or “super_admin” roles. Additionally, only super admin can manage areas/regions. Delete operations should NOT do cascade deletes - should throw exceptions if existing data is referencing a record that is being deleted.
Login endpoint will be just a mock endpoint for now - it should take a user name as a query parameter and return a JWT token to use for all other endpoints. Token should contain user attributes - id, name, uid, role, defaultLocationId, defaultLocation. Ignore the Authorization header that is defined in the swagger spec - we will use that later while implementing single sign on.
All database models should be defined using sequelize - use camelCase for attribute names. Follow the code structure of the starter pack codebase. On application startup, create a default app user with super admin role and default user name “superAdmin”.
NOTE: unit tests are NOT required
What to submit
-
Submit the updated codebase
-
README document with deployment and verification steps
-
Postman collection to verify the endpoints