Giter Club home page Giter Club logo

cra-boilerplate's Introduction

Getting Started with Create React App

Demo at:

The app was created with create-react-app, redux, typescript and styled-components for styling. See the full create-react-app guide, redux and redux toolkit. Thank you for using my boilerplate.

Table of Contents

Installation

To use this app, first clone from GitHub via 'git clone https://github.com/katiaipduarte/cra-boilerplate' at your terminal, cd to the new directory, then run npm install. Before running this project, you will need to create a .env.local file, with the same env as the ones in the .env.example. At last, run npm run start to launch your http server.

API Keys

Future Work

[ ] Future work example message

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/katiaipduarte/cra-boilerplate. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The code is available as open source under the terms of the MIT License.

Folder Structure

After creation, your project should look like this:

my-app/
  README.md
  node_modules/
  package.json
  public/
    index.html
    favicon.ico
  src/
    assets/
    components/
    interfaces/
    lib/
    pages/
    store/
    styles/
      index.ts
      reset-css.ts
      typography.ts
    utils/
    App.tsx
    index.css
    index.tsx

For the project to build, these files must exist with exact filenames:

  • public/index.html is the page template;
  • src/index.tsx is the TypeScript entry point.
  • src/components is the folder that houses all the components used.
  • src/interfaces is the folder with all the interfaces/type files used in the components.
  • src/lib is the folder for all the services/providers.
  • src/pages is the folder that contains the files with the initial logic used for each route.
  • src/store is the folder with the redux logic.
  • src/style is the folder with typography, reset and any other style rules shared by all React components.
  • src/utils is the folder with helper functions.

You may create subdirectories inside src. For faster rebuilds, only files inside src are processed by Webpack.
You need to put any TypeScript and styles files inside src, otherwise Webpack won’t see them.

Only files inside public can be used from public/index.html.

Routes

/

Available Scripts

In the project directory, you can run:

yarn start or npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test or npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build or npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

yarn eject or npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

npm run lint

Automatic linting, with rules to work with TypeScript and React. The src/serviceWorker.ts file and the node_modulesm folder are not included.

This is runned each time you do a commit and a push it to your branch.

For more information see the ESLint documentation.

npm run format

Command to format the code according to the rules that can be found in .prettierrc. The node_modules folder is not included.

This will be automatically run each time you do a commit.

For more information see the Prettier documentation.

npm run predeploy

This commands basically, runs the npm run build command. To read more just check yarn build or npm run build.

npm run deploy

Command to deploy the current application using Github Pages. If you forked this project onto a repository of your own, do not forget to create a gh-pages branch, before running this command.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

To learn more about how to deploy a CRA app using Github Pages, go to this link.

cra-boilerplate's People

Contributors

katiaipduarte avatar

Watchers

 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.