Code Monkey home page Code Monkey logo

twitter's Introduction

<Part-3>

PLease add GOPATH in ~/.profile file, our start scripts are using GOPATH for installing goreman

To start the etcd, auth, app and web server run the below sh file
./start_server.sh
(Servers may take around 30 to 60 seconds to boot up)
To stop all the servers, run the below sh file
./stop_server.sh

To make sure that etcd and goreman are installed, in the initial lines of start_server.sh we are go getting goreman
and etcd packages.

We are spawning 3 etcd servers namely etcd1, etcd2, etcd3. In order to stop anyone of them run the below command
goreman run stop etcd1 or
goreman run stop etcd2 or
goreman run stop etcd3

Server logs are written to authServer.log, storageServer.log(app_servers log),webServer.log and raft.log
main page will be hosted to http://localhost:8090/twitter


Please consider a gist of changes we made in part 3 of this assignment :

--Changed the project structure.

    Now, we can see 3 major directories in the project i.e.
        app_server      --> Exposes rpc's related to tweets like InsertTweets, GetFollowersTweets, FollowUser etc
        auth_server     --> Exposes services related to authentication of user like GetToken, Authenticate
        web_server      --> Exposes http endpoints for the user.

    We are trying to treat them as individual projects

    Apart from these, we have made below folders and files as well
        globals         --> Contains data structures used commonly in app, web and auth projects
        cmd             --> It contains startup go files for auth, app and web server
        server start    --> These calls the go program in cmd package to start app, auth and web servers and
        and stop scripts    uses goreman to start etcd servers (using Procfile available in project)

    Since, we are treating auth, app and web servers seperately, the all contain a folder called contract folder
    which contain required contracts(.proto file) which are consistent throughout the project.

    We are propagating error (both kind of errors, library specific and few made by us) from auth and app server to
    the web server and currently we are displaying those errors as is on the web browser (none of the servers are
    shutting down as it was happening earlier)

    We have used a logging library to print info and debug related logs

    We have incorporate suggestions given to us in the feedback of Part 1 of this project and also on a
    piazza post by Adam, we have used race detectors to clear as much potential race conditions in our test cases,
    piazza posts mentioned about propagating errors, using go modules and writing test, from which we have tried to
    incorporate all of them (as mentioned in above statements)



<Part-2>
We have now seperated auth code and tweet/post code by making seperate servers

To run the project run the below command
<Windows>
start_server.cmd

<LINUX>
sh start_server.sh --> this will start auth, storage and web servers at localhost:9000, localhost:9002 and
localhost:8090 respectively.
This command will host a webpage on http://localhost:8090/twitter endpoint
<Part-1>
To run this project :
navigate to <Project>/cmd/main/

Then run the below command

go build web.go

This command will download all the dependencies (currently just 1 used for generating UUID)

This command will host a webpage on http://localhost:8090/twitter endpoint

twitter's People

Contributors

parekhaagam avatar yshdave avatar na-mann514 avatar

Watchers

James Cloos avatar Adam avatar  avatar  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.