ODMS REST API - it's Node.js application which is created to model a communication with a simple web server and open data management system's database prototype and to perfom basic CRUD operations.
- Runtime environment: Node.js
- Web framework: Fastify
- ORM: Sequelize
- Database: MySQL
- Testing framework: JEST
-
Clone the repo:
git clone https://github.com/KhrapkoVasyl/open-data-manage-system.git
-
Open
src/js
directory and install NPM packages:npm install
-
Got to
src/js
directory. -
Create a local instance of the database by executing
Model.sql
SQL script which is insrc/sql
directory. -
Create
.env
file and fill it with your own configuration data as follows:MYSQL_HOST=MYSQL_HOST MYSQL_PORT=MYSQL_PORT MYSQL_USER=MYSQL_USER MYSQL_PASS=MYSQL_PASS MYSQL_DB=omds FASTIFY_PORT=FASTIFY_PORT
-
Start the application:
npm start
-
Run the tests:
npm test
All of the requests should be executed on http://localhost:FASTIFY_PORT/
Open endpoints require no Authentication.
Endpoints for viewing and manipulating datasets:
- Create new dataset:
POST /api/v1/dataset/
- Get all available datasets:
GET /api/v1/dataset/
- Get dataset by id:
GET /api/v1/dataset/:id/
- Update dataset by id:
GET /api/v1/dataset/:id/
- Delete dataset by id:
DELETE /api/v1/dataset/:id/
Endpoints for viewing and manipulating categories:
- Create new category:
POST /api/v1/category/
- Get all available categories:
GET /api/v1/category/
- Get category by id:
GET /api/v1/category/:id/
- Update category by id:
GET /api/v1/category/:id/
- Delete category by id:
DELETE /api/v1/category/:id/
Endpoints for viewing and manipulating datafiles:
- Create new datafile:
POST /api/v1/datafile/
- Get all available datafiles:
GET /api/v1/datafile/
- Get datafile by id:
GET /api/v1/datafile/:id/
- Update datafile by id:
GET /api/v1/datafile/:id/
- Delete datafile by id:
DELETE /api/v1/datafile/:id/
Endpoints for viewing and manipulating metadatakeys:
- Create new metadatakey:
POST /api/v1/metadatakey/
- Get all available metadatakeys:
GET /api/v1/metadatakey/
- Get metadatakey by id:
GET /api/v1/metadatakey/:id/
- Update metadatakey by id:
GET /api/v1/metadatakey/:id/
- Delete metadatakey by id:
DELETE /api/v1/metadatakey/:id/
Distributed under the MIT License. See LICENSE.txt for more information.
- Vasyl Khrapko - @vazzz7zzzok - [email protected]
- Artem Matiushenko - @artemko_m - [email protected]
- Bogdan Zinovij - @bzinovoy - [email protected]