A RESTful API server for Simple Twitter project built with Node.js, Express framework, and MySQL.
This is a collaborate project to make a simple Twitter web app. And the server-side API majors in authentication and data CRUD features.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Simple Twitter API is hosted on Heroku now. You can give it a try by using following base URL.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Simple Twitter Demo is hosted here. You can use the following accounts to login and try all the features:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Simple Twitter Frontend is developed by Vue.js (repo link).API Features
Authentication
Check if the user is authenticated and authorized. Some routes are available to use after login, some are admin/user role only. Please refer to the API documents.
Admin
- Signin background(後台)
- Get the list of all users
- Get the list of all tweets
- Delete tweet
Users
- Signin foreground(前台)
- Signup an new account
- Post, like, reply or read a tweet
- Follow, unfollow other users
- Edit own profile(include upload image)
- Get data of a certain user(personal info, tweets, likes, followings, followers, replies)
API Documents
Build a local API server
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
Node.js, Express and MySQL are installed.
Installing
Clone the repo
Install dependencies
Create file and folder in root
- Create a
.env
file and set variables(see .env.example
). Notice that JWT_SECRET
is required and IMGUR_CLIENT_ID
is optional.
- Make a
temp
folder for image upload feature.
Setting for database
- Modify
/config/config.json
- Create database to your MySQL
- Migrations and seeds(run in terminal)
Start the server
Auto-testing
There are auto-test files for models and requests in this repo. Look for more details in /test
folder.
Set NODE_ENV before test
Run the tests
Set NODE_ENV after test
Check current enviornmment
Built With
Authors
List of contributors who participated in this project.