Skip to content

plkpiotr/stock-exchange-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Exchange Application (Backend)

Overview

RESTful Web API implemented in TypeScript using Node.js, Express.js, JWT, MongoDB, Mongoose and Heroku.

Quick start

Install dependencies:

npm i

Run on localhost:8080:

nodemon

Connection with your own database

Replace the connection string in app.ts with your own:

  private static configureDatabase(): void {
-   mongoose.connect('mongodb+srv://stock-exchange:stock-exchange@stock-exchange-btfeh.mongodb.net/' +
-     'test?retryWrites=true&w=majority', {
+   mongoose.connect('your-connection-string', {
      useNewUrlParser: true,
      useCreateIndex: true
    });
  }

Model

Article

Field Type POST / PUT
_id ObjectId
created Date
description String required
link String required
modified Date
title String required
userId ObjectId

Note

Field Type POST / PUT
_id ObjectId
created Date
description String required
modified Date
title String required
userId ObjectId

Transaction

Field Type POST
_id ObjectId
amount Number required
comment String required
date Date required
symbol String required
userId ObjectId

User

Field Type POST
_id ObjectId
email String required
password String required

Endpoints

Article*

/articles 200 201 401 404 409 500
GET
POST
/articles/:id 200 201 401 404 409 500
GET
PUT
DELETE

Note*

/notes 200 201 401 404 409 500
GET
POST
/notes/:id 200 201 401 404 409 500
GET
PUT
DELETE

Transaction*

/transactions 200 201 401 404 409 500
GET
POST
/transactions/:id 200 201 401 404 409 500
DELETE

User

/users/register 200 201 401 404 409 500
POST
/users/login 200 201 401 404 409 500
POST

Asterisk indicates that an access token is required.

Comments

This is a back-end part of Stock Exchange Application.

Visit also a front-end repository: github.com/plkpiotr/stock-exchange-frontend

License

Copyright © 2019, Piotr Pałka. Released under the MIT License.