Code Monkey home page Code Monkey logo

full-stack-twitter-clone's Introduction

Full Stack Twitter Clone

In the project, I am doing it to develop myself on the back-end side. I spend my experience and effort to become a full-stack developer using Node.js and mongoDB.

In this project, I preferred Node.js in Back-end, mongoDB as Service, object document mapper (ODM) mongoose, Vue.js and pug in Front-end, SCSS for styling. I'm thinking of deploying my project to Google Cloud.

Running with Docker

$ docker-compose up

Running without Docker

You must have mongoDB, node.js and npm installed on your computer. Then, first, after the cd backend command, then the npm i or npm install command, if you are going to develop, you can restore the backend with the npm watch command. If you have seen

started listening on http://localhost:3000/ in your terminal we are connected to mongoDB!!!๐Ÿคช

if there is this command, it means its backend is working fine.

Then for the frontend, you can install the packages by saying yarn in the frontend folder, then you can raise the frontend with yarn serve. If there is no problem, you can completely restore the project at http://localhost:8080/.

Running backend

$ cd backend
$ npm i
$ npm start
$ npm watch #run with nodemon for development

Running frontend

$ cd frontend
$ yarn
$ yarn serve

Run npm install on the root folder and it will set up a pre-commit hook to lint the staged files. You will also have two lint commands, npm run lint and npm run lint-staged that you can run on the root folder.

These commands run the individual lint and lint-staged scripts in both the frontend and the backend folders, and they will respect individual configurations of these folders.

UML Diagram

Class Diagram(Plant Uml)

Basic version

Basic-II version

The starter repository of this project has been forked from dashersw/stack

Request end-points

GET  http://localhost:3000/users HTTP/1.1

###

POST  https://cs-twitter-clone-backend.herokuapp.com/users HTTP/1.1
content-type: application/json

{"name": "John Doe", "handle": "@johnDoe", "email": "[email protected]"}

###

DELETE  http://localhost:3000/users/611390360384a2befbbc7466 HTTP/1.1

###

GET http://localhost:3000/users/6113b3d9e2c6234211727249

###

POST    http://localhost:3000/users/617e978514928da134c12366/tweets HTTP/1.1
content-type: application/json

{"body": "This is a test tweet."}

###

PATCH   http://localhost:3000/users/6113a464e332bd183bf840d2 HTTP/1.1
content-type: application/json

{"name": "Cihat"}

###

PATCH   http://localhost:3000/users/611546eebd96a6a5e85c821d/following HTTP/1.1
content-type: application/json

{"userToFollowId": "6113dc26306ad96bcd30b251"}

###

PATCH   http://localhost:3000/users/612cea71e2e1167e4e1547ce/like HTTP/1.1
content-type: application/json

{"likeTweetId": "612cea85e2e1167e4e1547d1"}

###

PATCH   http://localhost:3000/users/6113dc26306ad96bcd30b251/retweet HTTP/1.1
content-type: application/json

{"retweetId": "6113de87306ad96bcd30b50b"}

###


GET  https://full-stack-twitter-clone-backend-i2smrx00x-cihat.vercel.app/users HTTP/1.1

###

MIT License

Copyright (c) 2022 Cihat Salik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

full-stack-twitter-clone's People

Contributors

cihat avatar r-j avatar womblewoo7547 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

full-stack-twitter-clone's Issues

vue-cli-service not found in Frontend

I've ran docker compose up but it gives me this error in Frontend container:

yarn run v1.22.4

$ vue-cli-service serve

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

/bin/sh: vue-cli-service: not found

error Command failed with exit code 127.

I've tried running yarn install inside frontend folder thinking it may need node-modules, but without success.

Site cannot be reached

I tried starting the app via docker by issuing docker-compose up but the site isn't reachable

Here are the logs printed out while the containers were getting spawned

Creating fullstacktwitterclone_frontend_1 ... done
Creating fullstacktwitterclone_backend_1  ... done
Creating fullstacktwitterclone_mongodb_1  ... done
Attaching to fullstacktwitterclone_backend_1, fullstacktwitterclone_mongodb_1, fullstacktwitterclone_frontend_1
backend_1   |
backend_1   | > [email protected] start /app
backend_1   | > node src/.bin/www
backend_1   |
backend_1   | Mon, 11 Jul 2022 11:39:55 GMT express-session deprecated undefined resave option; provide resave option at src/app.js:60:3
backend_1   | Mon, 11 Jul 2022 11:39:55 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at src/app.js:60:3
backend_1   | Mon, 11 Jul 2022 11:39:55 GMT express-session deprecated req.secret; provide secret option at src/app.js:60:3
mongodb_1   | 2022-07-11T11:39:55.572+0000 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongodb_1   | 2022-07-11T11:39:55.575+0000 W  ASIO     [main] No TransportLayer configured during NetworkInterface startup
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=62c9c1beae00
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] db version v4.2.21
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] git version: b0aeed9445ff41af07449fa757e1f231bce990b3
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] allocator: tcmalloc
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] modules: none
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] build environment:
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten]     distmod: ubuntu1804
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten]     distarch: x86_64
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten]     target_arch: x86_64
mongodb_1   | 2022-07-11T11:39:55.575+0000 I  CONTROL  [initandlisten] options: { net: { bindIp: "*" } }
mongodb_1   | 2022-07-11T11:39:55.576+0000 I  STORAGE  [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mongodb_1   | 2022-07-11T11:39:55.576+0000 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3479M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
backend_1   | MongoParseError: Invalid connection string
backend_1   |     at parseConnectionString (/app/node_modules/mongodb/lib/core/uri_parser.js:585:21)
backend_1   |     at connect (/app/node_modules/mongodb/lib/operations/connect.js:283:3)
backend_1   |     at /app/node_modules/mongodb/lib/mongo_client.js:284:5
backend_1   |     at maybePromise (/app/node_modules/mongodb/lib/utils.js:692:3)
backend_1   |     at MongoClient.connect (/app/node_modules/mongodb/lib/mongo_client.js:280:10)
backend_1   |     at /app/node_modules/mongoose/lib/connection.js:836:12
backend_1   |     at new Promise (<anonymous>)
backend_1   |     at NativeConnection.Connection.openUri (/app/node_modules/mongoose/lib/connection.js:832:19)
backend_1   |     at /app/node_modules/mongoose/lib/index.js:351:10
backend_1   |     at /app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5
backend_1   |     at new Promise (<anonymous>)
backend_1   |     at promiseOrCallback (/app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10)
backend_1   |     at Mongoose._promiseOrCallback (/app/node_modules/mongoose/lib/index.js:1149:10)
backend_1   |     at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:350:20)
backend_1   |     at Object.<anonymous> (/app/src/mongo-connection.js:14:4)
backend_1   |     at Module._compile (internal/modules/cjs/loader.js:1200:30)
frontend_1  | yarn run v1.22.4
frontend_1  | error Command "serve" not found.
frontend_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
mongodb_1   | 2022-07-11T11:39:56.210+0000 I  STORAGE  [initandlisten] WiredTiger message [1657539596:210903][1:0x7f8a1c3a8b00], txn-recover: Recovering log 5 through 6
mongodb_1   | 2022-07-11T11:39:56.233+0000 I  STORAGE  [initandlisten] WiredTiger message [1657539596:233504][1:0x7f8a1c3a8b00], txn-recover: Recovering log 6 through 6
mongodb_1   | 2022-07-11T11:39:56.270+0000 I  STORAGE  [initandlisten] WiredTiger message [1657539596:270175][1:0x7f8a1c3a8b00], txn-recover: Main recovery loop: starting at 5/4864 to 6/256
mongodb_1   | 2022-07-11T11:39:56.315+0000 I  STORAGE  [initandlisten] WiredTiger message [1657539596:315407][1:0x7f8a1c3a8b00], txn-recover: Recovering log 5 through 6
mongodb_1   | 2022-07-11T11:39:56.427+0000 I  STORAGE  [initandlisten] WiredTiger message [1657539596:427669][1:0x7f8a1c3a8b00], txn-recover: Recovering log 6 through 6
mongodb_1   | 2022-07-11T11:39:56.450+0000 I  STORAGE  [initandlisten] WiredTiger message [1657539596:450516][1:0x7f8a1c3a8b00], txn-recover: Set global recovery timestamp: (0, 0)
fullstacktwitterclone_frontend_1 exited with code 1
mongodb_1   | 2022-07-11T11:39:56.930+0000 I  RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
mongodb_1   | 2022-07-11T11:39:56.932+0000 I  STORAGE  [initandlisten] No table logging settings modifications are required for existing WiredTiger tables. Logging enabled? 1
mongodb_1   | 2022-07-11T11:39:56.933+0000 I  STORAGE  [initandlisten] Timestamp monitor starting
mongodb_1   | 2022-07-11T11:39:57.060+0000 I  CONTROL  [initandlisten]
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten]
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten]
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten] **        We suggest setting it to 'never'
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten]
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten] **        We suggest setting it to 'never'
mongodb_1   | 2022-07-11T11:39:57.061+0000 I  CONTROL  [initandlisten]
mongodb_1   | 2022-07-11T11:39:57.064+0000 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
mongodb_1   | 2022-07-11T11:39:57.066+0000 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongodb_1   | 2022-07-11T11:39:57.069+0000 I  NETWORK  [listener] Listening on /tmp/mongodb-27017.sock
mongodb_1   | 2022-07-11T11:39:57.069+0000 I  NETWORK  [listener] Listening on 0.0.0.0
mongodb_1   | 2022-07-11T11:39:57.069+0000 I  NETWORK  [listener] waiting for connections on port 27017

Any help in this regard would be really great! TIA

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.