GithubHelp home page GithubHelp logo

alexvcasillas / react-mobx-state-tree Goto Github PK

View Code? Open in Web Editor NEW
132.0 12.0 15.0 2.9 MB

Create React App with MobX State Tree, Styled Components and GraphQL

Home Page: https://alexvcasillas.com

HTML 9.20% JavaScript 84.60% CSS 6.21%
react create-react-app mobx mobx-state-tree mst boilerplate es6 javascript grahpq apollo-client

react-mobx-state-tree's Introduction

React + MobX State Tree & GraphQL Logo

About React + MobX State Tree & GraphQL

This project was initially built as a personal project to create my own website (https://alexvcasillas.com) to test the latest features of the awesome MobX State Tree and GraphQL. The React part of this project is based on the latest Create React App stable release (check their docs for further knowledge).

Purpose

The purpose of this project is only intended for learning. It's not intended to be a commercial product or any other related kind of stuff. This is Open Source so you should feel free to use it and modify it as you wanted. In fact, I encourage you to modify the structure or how I do things to fit your needs and the way you handle things, just set it to be comfortable to you.

How To

If you want to try this project the first thing you have to do is to clone this repository. How? Just go to your favourite terminal and execute the following command (assuming that you previously have git installed): git clone https://github.com/alexvcasillas/react-mobx-state-tree.git. By doing so, you'll have the repository cloned in your computer. The next step is to move inside by typing cd react-mobx-state-tree. Alright, we're in now! You can't run it at this point because you have no dependencies installed so, we need to start with that, run the following command: npm install or if you're a yarn user just yarn. This might take a while because it's downloading all the minimum requirements as local dependencies so you can run this project (they're just a few). When it's done, you're good to go, simply run the following command npm start or if you're a yarn user yarn start and you will see the development build process and when everything is done, your browser will open a new window/tab with this project up and running.

If you want your Github profile to fill this project, you need to generate a Github's Personal Access Token (PAT) and go to src/utils/graphql.js - line 10 and replace const githubToken = 'your_token_here'; the content within single quotes with your Personal Access Token (PAT). Then just make the build and deploy it somewhere or just run it as development.

You can customize everything with Styled Components!

TLDR: How To

  1. git clone https://github.com/alexvcasillas/react-mobx-state-tree.git
  2. cd react-mobx-state-tree
  3. npm install or yarn
  4. npm start or yarn start

Production Builds

Because this project is based on Create React App, you have all the CRA available commands and the build process is delegated to them. Simply run npm run build or yarn build and the build process will being and, at the end of it, you'll have a dist folder with your SPA ready to be deployed as a static website at any host.

Built with

This project is being used in:

https://alexvcasillas.com

Contributions

I'm always looking to improve this project so, if you feel like you can contribute to it to improve any of it's features, just fork it and make a proper Pull Request. I'll be so glad to check it with you and merge it into the master project.

Credits

I want to thank the following people and organizations for creating all that this project is based on:

Michel Weststrate for the incredible job creating MobX and MobX State Tree.

Mattia Manzati for it's support with everything related to MobX State Tree.

Max Stoiber for it's awesome Styled Components ๐Ÿ’…

Dan Abramov for creating Create React App (also all of the contributors to it!)

Apollo GraphQL Team for their awesome contribution with Apollo Client.

react-mobx-state-tree's People

Contributors

alexvcasillas avatar geowarin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-mobx-state-tree's Issues

Bypass Apollo Cache

@alexvcasillas, very interesting project. I have a quick question. I see that you are using the full Apollo Client to do GraphQL queries, e.g. here. This means that the fetched data is saved in the Apollo Cache as well as in MobX. Have you thought about bypassing the Apollo Cache completely and saving the fetched data only in MobX? Do you see any advantage in maintaining the Apollo Cache?

I was thinking of using Apollo Link to fetch data and then directly storing it in MobX store, bypassing the Apollo Cache. Haven't tried it yet, but wanted to bounce off the idea in case you have thought through this already.

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.