Giter VIP home page Giter VIP logo

twitter-api-2020's Introduction

Simple Twitter API

This is back-end REST-API app for AC Simple Twitter Project

How to use?

**Note: ** This instruction is for local side

Project init

  1. Open you terminal and clone this repo to your local machine
git clone https://github.com/cincinfish/twitter-api-2020
  1. Get into the folder you cloned
cd PaulChen-twitter-api-2020
  1. Install all dependencies
npm install
  1. Add new .env file and add envirement variables with following
JWT_SECRET =
IMGUR_CLIENT_ID =
  1. Modify the config.json file in config folder with you mySQL setting
"development": {
    "username": "root",
    "password": <your mysql password>,
    "database": "ac_twitter_workspace",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "test": {
    "username": "root",
    "password": <your mysql password>,
    "database": "ac_twitter_workspace_test",
    "host": "127.0.0.1",
    "dialect": "mysql",
    "logging": false
  },
  1. Create database to your MySQL server
CREATE DATABASE ac_twitter_workspace;
CREATE DATABASE ac_twitter_workspace_test;
  1. Back to your terminal and do migrations and create seeds data
npx sequelize db:migrate
npx sequelize db:seed:all
  1. Run the server and you can test APIs with the host: localhost:3000/api/
npm run start

Run test

For running test you have to set your NODE_ENV to test

$env:NODE_ENV="test"

If it is first time you run the test, make sure your migrate the DB to your test DB

npx seqeulize db:migrate

Then run the test

npm run test

After you finished your test, make sure you change NODE_ENV back to development

$env:NODE_ENV="development"

Features

  • User can register and login as user
  • After login, User can post tweet or view other user's tweet
  • User can edit/delete their own tweet
  • User can edit their profile data
  • User can reply, like or unlike to other tweet
  • User can follow or unfollow other user
  • User can not login to admin page
  • You can not register to be an admin. Admin user can only be create by manual in DB
  • Admin can not login to normal page
  • Admin can delete any tweet, view all users data

FrontEnd Repo

https://github.com/SajinYang/simple-twitter-frontend

Contributors

PaulChen79 cincinfish

twitter-api-2020's People

Contributors

amberyen avatar carrot7712 avatar cincinfish avatar ellenlee avatar fornacy avatar v123582 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.