Skip to content

AkibaSato/NanoTwitter

Repository files navigation

nanoTwitter

Team Japan and Kevin

Portfolio

Portfolio Page

Services

Main application

User Service

Tweet Service

Search Service

Write Service

nt Client

NOTE: The following service is no longer used.

Cache Service

Usage

Requirements

These are required for your local development environment:

STEP 1: Clone the repositories

$ git clone https://github.com/AkibaSato/NanoTwitter
$ git clone https://github.com/mgkbsh/ntUserService
$ git clone https://github.com/mgkbsh/ntTweetService
$ git clone https://github.com/mgkbsh/ntSearchService
$ git clone https://github.com/mgkbsh/ntWriteService

STEP 2: Install the necessary modules

Run the following commands in each repo directory. Install sequelize to global directory to just use sequelize prefix instead of specifying path name to binary for commands:

$ npm install
$ npm install -g sequelize-cli

STEP 3: Start the Postgres server

Postgres directory might be: /usr/local/var/postgres

$ pg_ctl -D <Postgres directory> start

STEP 4: Create the database on your local machine

$ sequelize db:migrate

STEP 5: Run the app locally

Run every service with the following command.

$ node index.js

Point your browser to http://localhost:3000 and voila!

Notes for developers

  sequelize db: [create/migrate/drop] --env [development/test]

Local Development

To connect to the Postgres shell:

$ psql ntdev

Create migrations

First create a boilerplate migration and model file with the basic columns. This example creates a new model:

$ sequelize model:create --name User --attributes fname:string,bio:text

Further modify the migration file and model file if necessary. Any changes to either file must be reflected in the other manually.

To migrate:

$ sequelize db:migrate

If you want to undo the migration:

$ sequelize db:migrate:undo:all

Heroku Deployment

To migrate Postgres models on Heroku:

$ heroku sequelize db:migrate --env production

Check results of change in Postgres shell.

$ heroku pg:psql

Testing

To run tests, run: npm test

Change History

nanoTwitter 0.1: Foundation

  • Setup Github with LICENSE.txt, README.md, version.rb.
  • Design relational database schema.
  • Design and layout user interface of nT.
  • Design API interface.
  • Explored several options such as MongoDB, Node.js, GraphQL, etc.

nanoTwitter 0.2: MVP - First Minimal Implementation

  • Create skeleton app using MongoDB and Express.
  • Create migration for database.
  • Implement authentication for login and logout using bcrypt.
  • Configured Heroku and deployed skeleton.

nanoTwitter 0.3: Core functionality

  • Write unit tests.
  • Implement test interface.
  • Setup automatic deployment.
  • Load seed data.
  • Migrated to Postgres and configured Heroku accordingly.

nanoTwitter 0.4: Testing and Deployment

  • Perform simultaneous manual testing.
  • Implement the complete test interface.
  • Use loader.io to generate some artificial loads.
  • Add tests to test suite.

nanoTwitter 0.5: Initial Load Testing

  • Instrument app to collect performance data.
  • Run load experiments.
  • Update schema to put indices and other enhancements.

nanoTwitter 0.6: Advanced Scaling

  • Setup caching service for timelines and user information. Put on hold for comparing performance between cached vs non-cached.
  • Implemented new authentication system due to issues when accessing the API from the client (nt0.7) and loader.io.
  • Designed service oriented architecture and defined communication logic.

nanoTwitter 0.7: Web Service API and Client

  • API Routes were implemented and JSON data for output can be generated by including /api/v1/(API_TOKEN)/ between the main url and the necessary route and value.
  • ntClient has been built and allows basic client side capabilities to create a user and tweet and check timelines through the command line.

nanoTwitter 1.0: Completion

  • Write microservice to allow cached database writing was implemented and other microservices were cleaned up.
  • UI and functionalities were completed.

Mockups

UI Design 1: Front Page UI Design 2: Your User Page UI Design 3: Other User Page

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •