Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/atulmy/crate

๐Ÿ‘• ๐Ÿ‘– ๐Ÿ“ฆ A sample web and mobile application built with Node, Express, React, React Native, Redux and GraphQL. Very basic replica of stitchfix.com / krate.in (allows users to get monthly subscription of trendy clothes and accessories).
https://github.com/atulmy/crate

adobe-xd android babel es6 express graphql ios jwt mobile-application mysql nodejs react react-native redux seo-friendly sequelize server-side-rendering ssr web-application webpack

Last synced: 5 days ago
JSON representation

๐Ÿ‘• ๐Ÿ‘– ๐Ÿ“ฆ A sample web and mobile application built with Node, Express, React, React Native, Redux and GraphQL. Very basic replica of stitchfix.com / krate.in (allows users to get monthly subscription of trendy clothes and accessories).

Awesome Lists containing this project

README

        

> # ๐Ÿ†• Upgraded version is now available!
> An upgraded and more modern version with full-stack monorepo, featuring an event-driven, highly scalable architecture using Node.js, React, Redis, MongoDB, and Docker is now available,
check out [github.com/atulmy/fullstack-event-driven-architecture](https://github.com/atulmy/fullstack-event-driven-architecture)

![Crate](https://raw.githubusercontent.com/atulmy/atulmy.github.io/master/images/crate/hero-with-link.png)

# Crate ๐Ÿ‘•๐Ÿ‘–๐Ÿ“ฆ

#### Get monthly subscription of trendy clothes and accessories.
- **API** built with Node, GraphQL, Express, Sequelize (MySQL) and JWT Auth
- **WebApp** built with React and Redux along with Server Side Rendering (SSR) / SEO friendly
- **Mobile** (Android and iOS) Native App build with React Native
- Written in ES6+ using Babel + Webpack
- Designed using Adobe Experience Design. Preview it [here](https://xd.adobe.com/view/a662a49f-57e7-4ffd-91bd-080b150b0317/).

## Features
- Modular and easily scalable code structure
- Emphasis on developer experience
- UI components in separate folder which can be swapped for your favorite UI framework easily
- Responsive UI for React Native to support Mobile and Tablet
- GraphQL schema with associations
- Database migration and data seeding
- User authentication using JSON Web Tokens with GraphQL API
- File upload feature with GraphQL
- React storybook demonstrating UI components for web
- Server side rendering
- Multi-package setup and dev scripts for an automated dev experiance

## Useful for
- Developers with basic knowledge on React exploring advance React projects
- Developers learning React Native
- Exploring GraphQL
- Scalable project structure and code
- Starter application for Mobile and Web along with SSR
- Multi-package scripts
- Sample project with combination of all above

## Screenshots and GIFs
Click on image to view fullscreen and zoom

### Desktop
[IMAGE](https://github.com/atulmy/atulmy.github.io/blob/master/images/crate/desktop-all-with-link.png)

![Crate Desktop](https://raw.githubusercontent.com/atulmy/atulmy.github.io/master/images/crate/desktop-all-with-link.png)

### Mobile
[IMAGE](https://github.com/atulmy/atulmy.github.io/blob/master/images/crate/mobile-all-with-link.png) ยท [GIF](https://github.com/atulmy/atulmy.github.io/blob/master/images/crate/mobile.gif)

![Crate Mobile](https://raw.githubusercontent.com/atulmy/atulmy.github.io/master/images/crate/mobile-all-with-link.png)

### Tablet
[IMAGE](https://github.com/atulmy/atulmy.github.io/blob/master/images/crate/tablet-all-with-link.png) ยท [GIF](https://github.com/atulmy/atulmy.github.io/blob/master/images/crate/tablet.gif)

![Crate Tablet](https://raw.githubusercontent.com/atulmy/atulmy.github.io/master/images/crate/tablet-all-with-link.png)

## Core Structure
code
โ”œโ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ api (api.example.com)
โ”‚ โ”œโ”€โ”€ public
โ”‚ โ”œโ”€โ”€ src
โ”‚ โ”‚ โ”œโ”€โ”€ config
โ”‚ โ”‚ โ”œโ”€โ”€ migrations
โ”‚ โ”‚ โ”œโ”€โ”€ modules
โ”‚ โ”‚ โ”œโ”€โ”€ seeders
โ”‚ โ”‚ โ”œโ”€โ”€ setup
โ”‚ โ”‚ โ””โ”€โ”€ index.js
โ”‚ โ”‚
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ mobile (Android, iOS)
โ”‚ โ”œโ”€โ”€ assets
โ”‚ โ”œโ”€โ”€ src
โ”‚ โ”‚ โ”œโ”€โ”€ modules
โ”‚ โ”‚ โ”œโ”€โ”€ setup
โ”‚ โ”‚ โ”œโ”€โ”€ ui
โ”‚ โ”‚ โ””โ”€โ”€ index.js
โ”‚ โ”‚
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ web (example.com)
โ”‚ โ”œโ”€โ”€ public
โ”‚ โ”œโ”€โ”€ src
โ”‚ โ”‚ โ”œโ”€โ”€ modules
โ”‚ โ”‚ โ”œโ”€โ”€ setup
โ”‚ โ”‚ โ”œโ”€โ”€ ui
โ”‚ โ”‚ โ””โ”€โ”€ index.js
โ”‚ โ”œโ”€โ”€ storybook
โ”‚ โ”‚
โ”‚ โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

## Setup and Running
- Prerequisites
- Node
- MySQL (or Postgres / Sqlite / MSSQL)
- Clone repo `git clone [email protected]:atulmy/crate.git crate`
- Switch to `code` directory `cd code`
- Configurations
- Modify `/api/src/config/database.json` for database credentials
- Modify `/api/.env` for PORT (optional)
- Modify `/web/.env` for PORT / API URL (optional)
- Modify `/mobile/src/setup/config.json` for API URL (tip: use `ifconfig` to get your local IP address)
- Setup
- API: Install packages and database setup (migrations and seed) `cd api` and `npm run setup`
- Webapp: Install packages `cd web` and `npm install`
- Mobile:
1. Install packages `cd mobile` and `npm install`
2. Install iOS dependencies `cd mobile/ios` `pod install`
- Development
- Run API `cd api` and `npm start`, browse GraphiQL at http://localhost:8000/
- Run Webapp `cd web` and `npm start`, browse webapp at http://localhost:3000/
- Run Mobile `cd mobile` and `npx react-native run-ios` for iOS and `npx react-native run-android` for Android
- Production
- Run API `cd api` and `npm run start:prod`, creates an optimized build in `build` directory and runs the server
- Run Webapp `cd web` and `npm run start:prod`, creates an optimized build in `build` directory and runs the server

## Multi-package automation
- New developers are advised to run through the above 'setup and running' process before reading further.
- Optional multi-package automation for faster setup and easier dev environment initiation.
- No need to cd to sub-folders unless working with mobile or running a production build.
- Once Node, MySQL, repo clone and configuration are setup correctly
- Switch to `code` directory `cd code`
- Setup
- Setup API, Webapp and Mobile with a single command `npm run setup`
- Development
- Run API and Webapp `npm start`, browse GraphiQL at http://localhost:8000/ and Webapp at http://localhost:8000/
- Run API alone `npm start:api`, browse GraphiQL at http://localhost:8000/
- Run Webapp alone `npm start:web`, browse webapp at http://localhost:3000/

## Resources and Inspirations
- โœ๏ธ Opinionated project architecture for Full-Stack JavaScript Applications - [GitHub](https://github.com/atulmy/fullstack-javascript-architecture)
- ๐ŸŒˆ Simple Fullstack GraphQL Application - [GitHub](https://github.com/atulmy/fullstack-graphql)
- ๐ŸŒ Universal react application with server side rendering - [GitHub](https://github.com/atulmy/universal-react)
- Container Components - [Medium Post](https://medium.com/@learnreact/container-components-c0e67432e005)
- Zero to GraphQL in 30 Minutes - [YouTube](https://www.youtube.com/watch?v=UBGzsb2UkeY&list=PLkuiMQfg5DujhOSZ1A8kDl0hKV_ICTjp-)
- Building a GraphQL Server [YouTube Playlist](https://www.youtube.com/playlist?list=PLillGF-RfqbYZty73_PHBqKRDnv7ikh68)
- Universal JavaScript Web Applications with React by [Luciano Mammino](https://github.com/lmammino) - [YouTube](https://www.youtube.com/watch?v=0VEwRFP8WtI)
- Building Youtube UI in React Native in 30 Mins - [YouTube](https://www.youtube.com/watch?v=LdKtugH-sb8)
- Building Stellar Mobile UX With React Native - [YouTube](https://www.youtube.com/watch?v=ssXB9RMTpTs)
- Free MySQL hosting https://remotemysql.com

## Why open source a project and not a boilerplate or framework?
- While building a new project with Node, you can basically start scratch, adding libraries and tools as you go on building it further.
- Comparing with any other languague, you usually start with a framework, for example, Laravel (PHP), Django (Python) or Ruby on Rails (Ruby) which includes a ton of features and codebase which you never end up using.
- I've personally found, learning by going through a good project codebase step by step while building your own project helps in ease of understanding and remembering

## Author
- Atul Yadav - [GitHub](https://github.com/atulmy) ยท [Twitter](https://twitter.com/atulmy)

## Contributors
- Ebou Jobe - [GitHub](https://github.com/ebouJ)
- Nenad Radovanovic - [GitHub](https://github.com/nrcloud) ยท [Twitter](https://twitter.com/publicshone)
- Nicholas Drew - [GitHub](https://github.com/nickdrew)
- Mateus Abdala - [GitHub](https://github.com/mateusabdala)
- Hossein Nedaee - [GitHub](https://github.com/hosseinnedaee)
- Mohammad Afzal - [GitHub](https://github.com/afzalex)
- [YOUR NAME HERE] - Feel free to contribute to the codebase by resolving any open issues, refactoring, adding new features, writing test cases or any other way to make the project better and helpful to the community. Feel free to fork and send pull requests.

## Donate
If you liked this project, you can donate to support it โค๏ธ

[![Donate via PayPal](https://raw.githubusercontent.com/atulmy/atulmy.github.io/master/images/mix/paypal-me-smaller.png)](http://paypal.me/atulmy) [![Become a Patreon](https://raw.githubusercontent.com/atulmy/atulmy.github.io/master/images/mix/patreon.png?v=1)](https://www.patreon.com/atulmy)

## Hire me
Looking for a developer to build your next idea or need a developer to work remotely? Get in touch: [[email protected]](mailto:[email protected])

## License
Copyright (c) 2018 Atul Yadav http://github.com/atulmy

The MIT License (http://www.opensource.org/licenses/mit-license.php)