https://github.com/melitus/developer-api
Design and implementation of Developer Api interface
https://github.com/melitus/developer-api
docker docker-compose javascript nodejs typescript
Last synced: 2 months ago
JSON representation
Design and implementation of Developer Api interface
- Host: GitHub
- URL: https://github.com/melitus/developer-api
- Owner: melitus
- License: apache-2.0
- Created: 2023-05-17T07:45:29.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-03T09:42:03.000Z (over 1 year ago)
- Last Synced: 2025-01-29T22:26:52.902Z (4 months ago)
- Topics: docker, docker-compose, javascript, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Developer API Interface
## Design and implementation of Developer Api interface
# Problem description
The following is about designing and implementing an interface with the following main functions:
- Create, edit, view and delete developer entities via an interface.
- The dataset should also be persisted.
- The implementation includes different focal points from different areas, which in combination result in an application.## These are your specifications:
Default Technologies:
- Typescript
- Node.js
- Express.js or Nest.js
- Docker and Docker Compose
- Any database (e.g. Redis, SQL, MongoDB ...).
The rest is up to you.
### Default data models:
- Developer model: id, name, email, level (senior or junior).### The implementation is divided into several sub-areas / focal points:
1. implementation of the interface
- Return of all developers
- Filtering by level
- Return of a specific developer
- Creation of a developer with the developer model defined above
- Editing a developer
- Deleting a developer
2. orchestration
- The application is to be implemented as a Docker container
- The application and the Redis database should be integrated into docker-compose.
# Tools
- NodeJS
- Express
- Typescript
- Mongodb
- Mongoose
- Docker
- Docker compose## Set Up
The easiest way to get started is to clone the repository:
# clone the repository
```
git clone https://github.com/melitus/developer-api.git
```# Change directory
```
cd developer-api
```# Install NPM dependencies
```
yarn install
```
```
create .env file at the root directory
```
Samples:- NODE_ENV=development
- APP_PORT=3001# Database
- MONGODB_USER=xxx
- MONGODB_PASSWORD=xxx
- MONGODB_DATABASE=xxxx
- MONGODB_DOCKER_PORT=27017# start the server without docker
```
yarn run dev
```
# # start the server with docker```
docker-compose up or sudo docker-compose up
```# To test the endpoint on postman
I used postman to test the api.
To use postman, go to the project doc folder and import the docs file into your postman client to ease the testing## Developers Endpoints
- Create a developer - `http://localhost:3001/v1/api/developer`
- Get all developers - `http://localhost:3001/v1/api/developer`
- Get a specific developer - `http://localhost:3001/v1/api/developer/644f977b19b115001ce4e306`
- Get developers filtered by level - `http://localhost:3001/v1/api/developer/filter?level=senior`
- Edit a developer record - `http://localhost:3001/v1/api/developer/644f977b19b115001ce4e306`
- Delete a developer - `http://localhost:3001/v1/api/developer/644f977b19b115001ce4e306`