GIT-USERNAME-HERE REPO-NAME-HERE APP-NAME-HERE PUT-TECH-STACK-HERE CLIENT-DEPLOY-URL-HERE

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

APP-NAME-HERE - Client

PUT-TECH-STACK-HERE
Explore the docs »

Report Bug · Request Feature?


Set List App


This will be a comprehensive README for the sake of both prospective employers and fellow cohort peers, and whomever else would be interested in some of the techniques I've learned creating my frist Fullstack application. As a bonus, this README has some interesting implementations, though I won't address them here. Enjoy!



This README will systematically go over the entire app from the top level to the bottom layer, so I'll provide links to various sections for convenience.

TODO - ADD DIRECTORY LINKS!


public

The Public folder is nothing special, besides the custom favicon and (as I'll note later) some imported CDNs in the head of index.html for a few Google Fonts.

As an aside, it's actually faster (from a runtime perspective) to import fonts via CDNs, as apposed to importing them directly into stylesheets


src:

config.js, index.js, and setupTests.js

[ config.js ] - this is essentially where I store "environment" variables. One important thing to know is that React has a built-in NODE_ENV variable that is set automatically when running scripts:

  1. Run Start: NODE_ENV = developement
  2. Run Build: NODE_ENV = production

    Knowing this, you can take advantage and set up conditionals based on the already-available NODE_ENV. A major advantage is setting up API urls. When exporting like this...

    export default { ...config };

    ... you can access variables like this...

    import config from '.../config.js';
    ...
      await fetch(config.API_ENDPOINT)

    [ index.js ] - bog-standard React App-wrapper using BrowserRouter [ setupTests.js ] - configuration for Enzyme testing


styles:

Fairly straight-forward Sass setup, with a simple reset and global stylesheet imported into the root index file. I won't get into Sass here, but know that I broke-out individual mixins to be used as imports in isolated [ .scss ] files


I'll briefly cover some global-level stuff before breaking down the App itself

jsconfig.json:

This is at the root level, but it's use is important in understanding the syntax used throughout the app. I won't go too in-depth, but essentially what's going on is it's creating a global alias for the [ src/ ] file directory. The side effect is that you can re-factor local imports:

/* someComponent.js */
import { PostService } from '../../../../../src/services';
...to...
import { PostService } from 'src/services';

For more info on the jsconfig.json, check out the docs HERE!

constants:

Not strictly necessary, but this can help prevent typos, along with making changes to the database less tedious to update throughout the app.

TODO!!!

Barrels...

You may have already noticed that there are actually many [ index.js ] files peppered throughout the app. These are known as "barrel" exports, and have a few advantages when dealing with a complex file-directory. The index file in the [ components ] folder has a short explanation, but I'll also put it here:

/*
|------------------------------------------------------
| BARREL EXPORT FILE
|------------------------------------------------------
| How-To barrel-export components:
| export { default as Comp1 } from './comp1/comp1.js' (omit .js)
|
| Why? Readability and (to an extent) testing:
| import { Comp1, Comp2, Comp3, Comp4 } from './components'
| import { Route1, Route2, Route3, Route4 } from './routes'
*/
export { default as LoginForm } from './loginForm/loginForm'
export { default as Header } from './header/header'
etc...

You can see this in action in [ app.js ]:

TODO!!!

Note that the import doesn't point to the index file. Node perceives [ index.js ] files as points of entry and the default file to grab exports from, essentially making it an implicit file in import statements


app:


routes:

There's not much to say here, these essentially just import and render components, acting as entry points to component trees. However, I'll briefly cover...

utils:

1. Private/Public-Routes: This serves as a UX enhancement, both preventing users not logged in from accessing the app, and already logged in users from accessing the Login page. 1. PageNotFound: Standard inclusion, and in the case of this version, you can access this page vie the "Gigs" page as this is a feature not yet implemented.



Contact

Github - musicMan1337

LinkedIn - Derek-8Bit-Nellis

Facebook - Derek Nellis

Instagram - @derek.8bit.nellis