NOTE: This is old and no longer maintained.
I built this app in order to learn more about Node, Express and MongoDB. I hope it helps others do the same :-)
-
Install the dependencies:
npm install
-
Start the server:
grunt
(port 2000)
If you have your own mongo db, update the url in server.js
or use dotenv.
- MEAN stack: MongoDB, Express, Angular, Node.js
- Angular services/modules
- ui-router
- restangular
- angular-moment
- angular-elastic
- ui-router-title
- ngDialog
- auth0
- mongoDB, mongoose
- grunt
- karma, jasmine (front end tests)
- mocha, should.js (api tests)
- lodash
- fontawesome
-
start server:
grunt
(runs tests, watches for changes). -
run front end tests:
grunt test
-
run api tests:
grunt test:api
password is the obvious.
-
Currently for v1, authentication is done with auth0. It would be great to use Passport instead.
-
Currently no e2e tests, only unit tests.
-
post a single tweet
- POST
/api/tweets
- POST
-
get all tweets by username
- GET
/api/tweets/:username
- eg: /api/tweets/whereswally
- GET
-
get a single tweet by tweet_id
- GET
/api/tweets/:tweet_id
- GET
-
update a tweet by tweet_id
- PUT
/api/tweets/:tweet_id
- PUT
-
delete a tweet by tweet_id
- DELETE
/api/tweets/:tweet_id
- DELETE
-
add a username to a tweet's favourites array
- PUT
/api/tweets/:tweet_id/favourites
- PUT
-
delete a favourite from a tweet
- DELETE
/api/tweets/:tweet_id/favourites/:fav_tweet_id
- eg: /api/tweets/1a2b3c4d/favourites/q5w6e7r8
- DELETE
-
add a username to a tweet's retweets array
- PUT
/api/tweets/:tweet_id/retweets
- PUT
-
delete a retweet from a tweet
- DELETE
/api/tweets/:tweet_id/retweets/:retweet_id
- DELETE
- search and return tweets with usernames from a query
- GET
/api/timeline
- eg: /api/timeline?userFollowing=bill&userFollowing=ben
- GET
- search and return tweets containing someString
- GET
/api/search/:someString
- eg: /api/search/hotWeather
- GET
-
get a single user
- GET
/api/profiles/:username
- eg: /api/profiles/whereswally
- GET
-
add a single new username
- POST
/api/profiles/:username
- eg:
{ username: String }
- POST
-
add public profile details
- POST
/api/profiles/:username/:details
- POST
-
add a new following username to a user's profile
- PUT
/api/profiles/:username/following
- PUT
-
add a new follower username to a user's profile
- PUT
/api/profiles/:username/followers
- PUT
-
add a username to a user's favourites array
- PUT
/api/profiles/:username/tweets/favourites/:tweet_id
- PUT
-
delete a username from a user's favourites array
- DELETE
/api/profiles/:username/tweets/favourites/:tweet_id
- DELETE
-
add a username to a user's retweets array
- PUT
/api/profiles/:username/tweets/retweets/:tweet_id
- PUT
-
get all tweets
- GET
/api/test/tweets/all
- GET
-
delete all tweets
- DELETE
/api/test/tweets/all
- DELETE
-
delete all profiles
- DELETE
/api/test/profiles/all
- DELETE
Always welcome, please submit a PR :-)