A take-home assignment for back end candidates at Kesowa. You build a Node.js
REST API that ingests geospatial imagery and extracts location information from
it. The test suite in __tests__/ defines the contract — your job is to make it
pass.
This repository is published openly so candidates can read the task before applying, and so the tests can be reviewed by anyone. It is not a production service.
A REST server that lets a user register, log in, upload geotagged images, and
read back the extracted coordinates. The expected endpoints, status codes and
response shapes are all specified by __tests__/app.test.ts.
- Node.js 16 or later
- A running MongoDB instance
git clone https://github.com/Kesowa/backend_assignment.git
cd backend_assignment
npm install
cp .env.example .env # then edit .env for your local setup
npm run dev # starts the server with live reload
npm test # runs the suite you need to make passConfiguration is read from a .env file, which is git-ignored. Copy
.env.example and fill it in:
| Variable | Purpose |
|---|---|
MONGO_URI |
MongoDB connection string for the data store |
PORT |
Port the HTTP server listens on (defaults to 8080) |
JWT_SECRET |
Secret used to sign auth tokens — generate your own |
- Fork this repository.
- Implement the endpoints the tests require.
- Make the full suite pass with
npm test. - Open a pull request against
master. - Wait for review.
- Do not modify
__tests__/unless something there is genuinely broken. If you believe a test is wrong, say so in your pull request rather than editing around it. - Persist all data in a MongoDB instance.
- Store uploaded media on disk, not in the database.
- Authenticate using the
Authorizationheader.
Every image in assets/ carries EXIF GPS metadata. Use an EXIF parser to pull
out latitude and longitude — the raw tags look like this:
exif:GPSAltitude: 64022/1000
exif:GPSAltitudeRef: 1
exif:GPSDateStamp: 2022:01:03
exif:GPSInfo: 3627
exif:GPSLatitude: 22/1, 35/1, 179159/10000
exif:GPSLatitudeRef: N
exif:GPSLongitude: 88/1, 27/1, 37260/10000
exif:GPSLongitudeRef: E
exif:GPSProcessingMethod: 65, 83, 67, 73, 73, 0, 0, 0, 71, 80, 83, 0
exif:GPSTimeStamp: 10/1, 23/1, 54/1
Note that latitude and longitude are given as degrees, minutes and seconds in rational form — you will need to convert them to decimal degrees.
Candidate submissions go through the fork-and-pull-request flow above. For corrections to the assignment itself — a broken test, an unclear requirement, a bug in the scaffolding — see CONTRIBUTING.md.
Please do not open public issues for security problems. See SECURITY.md for how to report them.
Released under the MIT License. © Kesowa Infinite Ventures.