Skip to content

impactbyte-network/modusin-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modusin API & Data Specification

master mhaidarh-api

Modusin is a publishing network for learners

The goal of this app is to clone a Medium web app, called Modusin.

Screenshot

Tech Stack

  • Node.js
  • Yarn
  • Express.js / Sails.js
  • MongoDB, Mongoose, MongoDB Atlas
  • Travis CI
  • Heroku

Development

Application

Install yarn with npm

npm install -g yarn

Running

yarn install
yarn dev

Deployment

Infrastructure

GitHub => Heroku => CloudFlare => api.modusin.com

Application

node => pm2

Running

heroku login
yarn deploy

Access:


Data Models

Posts

{
  "_id": ObjectId,
  "id": Number,
  "title": String,
  "image_name": String,
  "image_url": String,
  "content": String,
  "author": {
    "name": String,
    "bio": String
  },
  "read_time": Number,
  "created_at": Date,
  "updated_at": Date
}

Accounts

{
  "_id": ObjectId,
  "id": Number,
  "name": String,
  "bio": Number
  "email": String,
  "password": String,
  "reset_token": "",
  "following": [],
  "followers": [],
  "created_at": Date,
  "updated_at": Date
}

API Endpoints

Root URL: http://localhost:3000

Posts

Endpoint HTTP Description
/posts GET Get all posts
/posts/:id GET Get thing by id
/posts POST Create a new post
/posts DEL Delete all posts
/posts/:id DEL Delete thing by id
/posts/:id PUT Update thing by id

Accounts

Endpoint HTTP Description
/accounts/register POST Sign up for a new user
/accounts/login POST Sign in with existed user
/accounts/logout POST Sign in with existed user
Endpoint HTTP Description
/accounts GET Get all accounts
/accounts/:id GET Get one user profile by id
/accounts DEL Delete all accounts
/accounts/:id DEL Delete one user profile by id
/accounts/:id PUT Update one user profile by id

License

MIT License

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%