Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanvirstreame/twitter-api
https://github.com/tanvirstreame/twitter-api
expressjs mocha mocha-chai mongo-in-memory-server mongodb mongoose typescript
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tanvirstreame/twitter-api
- Owner: tanvirstreame
- Created: 2022-06-24T11:25:51.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-27T03:24:55.000Z (over 2 years ago)
- Last Synced: 2023-03-03T00:19:10.822Z (almost 2 years ago)
- Topics: expressjs, mocha, mocha-chai, mongo-in-memory-server, mongodb, mongoose, typescript
- Language: TypeScript
- Homepage:
- Size: 203 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Twitter api with express js
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)
# Features
- Sign up / login
- Create tweets
- Follow other users
- Fetch their tweets
- See tweets from people who they follow
## Tech
* Express JS
* Type Script### Installation
Install the dependencies and devDependencies and start the server.
```sh
$ npm install
```
Running the backend project...```sh
$ npm run dev
```
Verify the deployment by navigating to your server address in your preferred browser.```sh
127.0.0.1:8080
```
Running seed...
```sh
$ npm run seed
```Running test...
```sh
$ npm run test
```## Endpoints
```http
POST /api/v1/users/signup
POST /api/v1/users/login
POST /api/v1/follows/:userId
POST /api/v1/tweets
GET /api/v1/tweets
GET /api/v1/tweets?limit=10&offset=0
GET /api/v1/tweets/feeds
GET /api/v1/tweets/feeds?limit=10&offset=0
```
## Responses```javascript
{
"data": [],
"totalCount": 0,
"itemPerPage": 10,
"totalPage": 1,
"success": true
}
``````javascript
{
"message": "Tweet saved successfully",
"success": true
}
``````javascript
{
"token": "Bearer ",
"message": "User registered successfully",
"success": true
}
```## Status Codes
| Status Code | Description |
| :--- | :--- |
| 200 | `OK` |
| 201 | `CREATED` |
| 400 | `BAD REQUEST` |
| 404 | `NOT FOUND` |
| 500 | `INTERNAL SERVER ERROR` |License
----MIT