Git Product home page Git Product logo

fullstacktemplate's Introduction

Full-Stack Template

Welcome to my full-stack template!

The stack is nginx are a reverse proxy in front of a typescript, node, and express backend server, a postgres database, and a react front end. The backend server is run at the subdomain backend.localhost, while the frontend server is accessable through localhost:80 and localhost:3000 by default.

Configuration

To configure the server run ./build.sh to download all the dependencies and start nginx. The database can be configured by running ./database/init/init-db.sh, buil-db.sh, and populate-db.sh in that order (see the build scripts to see how each works).

Running

The react front end is run with 'npm start' in the client folder. The backend server is run with 'npm run start' which compiles and executes the typescript server. This typescript code lives in ts-src and is compiled into the src folder.

Implementation Details

After you have set up the server, it will be configured to run a login page, a signup page, a profile page, and a few query routes in the backend. Authentication is set up by default as well.

Authentication is done in the backend with JWT and the react frontend is configured to add the JWT to the header when requesting information from the backend (see ./client/src/pages/profile/index.js for an example). In the backend ./ts-src/middleware/authJWT contains the middleware function used for authentication (see ./ts-src/routes/users for an example). Users are authenticated on login and are issues a token which works for 24hrs.

The rest of the website now just needs to be built around this framework.

Have fun!

fullstacktemplate's People

Contributors

blankcanvasstudio avatar

Stargazers

Sage Sigler avatar

Watchers

 avatar

fullstacktemplate's Issues

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.