Giter Club home page Giter Club logo

obscurely's Introduction

Project Structure

The project is split into 3 parts:

  • Backend: A simple express app. Files are located in project_directory/backend
  • Frontend: A create-react-app based app. Files are located in project_directory/frontend
  • Reverse Proxy Server: A reverse proxy server to remove cross-origin requests security errors. File are located in project_directory/proxyserver

The backend

This uses expressjs and mongoose to connect to a mongodb server which manages the data for this simple app. This runs on port 3000 on the server.

The frontend

This is a create-react-app based project with added scss support. The entry point for this is App.js. The .env file makes sure that it runs on port number 8000.

The reverse proxy server

This was added because a client requesting from 8000 to 3000 will cause cross-origin header red flags in most browsers. One way handle them is add a cors-allow header from the backend, however it still exposes the port number for the backend. So, this simple 25 line code helps with that.

The project_directory/proxyserver is a reverse proxy server which just redirects requests as follows:

  • /api/ -> backend (running on port 3000)
    • -> everything else, meaning frontend, (running on port 8000) You can change these ports at your convenience.

obscurely's People

Contributors

navarjun avatar

Watchers

 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.