Code Monkey home page Code Monkey logo

hajri-aymen / apollo-universal-starter-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sysgears/apollo-universal-starter-kit

0.0 2.0 0.0 9.89 MB

Apollo Universal Starter Kit is a GraphQL-based JavaScript starter application for mobile, web, and server development. The code for each platform is built with Webpack to enable ultimate code reuse. The stack includes Apollo, GraphQL, React, React Native, Expo, Node.js, Express, Knex, SQLite, Bootstrap, Babel, SpinJS, Webpack, and other tools.

License: MIT License

Dockerfile 0.06% JavaScript 75.45% TypeScript 23.97% CSS 0.52%

apollo-universal-starter-kit's Introduction

Apollo Universal Starter Kit

Backers on Open Collective Sponsors on Open Collective Join the chat at https://gitter.im/sysgears/apollo-fullstack-starter-kit Build Status code style: prettier Twitter Follow

Use our chat to get help or to discuss general topics about the Apollo Universal Starter Kit.

Description

Apollo Universal Starter Kit is an SEO-friendly, fully-configured, modular starter project for developing Universal JavaScript applications. You can use this kit to create your applications in JavaScript or TypeScript for all major platforms – mobile, web, and server.

Apollo Universal Starter Kit is built on top of Apollo, GraphQL, JWT, React 16, Redux, React Native, Expo, Knex, and Express with support for relational databases such as PostgreSQL and MySQL. TypeScript is used across the entire project, but you can freely mix vanilla JavaScript (ES6 and ES7) and TypeScript.

The starter kit also integrates Twitter Bootstrap, Ant Design, and NativeBase to provide great possibilities for styling for your applications.

Table of Contents

Overview

Why Use Apollo Universal Starter Kit

I Am a Developer

  • Better productivity thanks to live reloading
  • An example of the modular architecture that's easy to support and extend
  • The possibility to write app modules using both TypeScript and JavaScript (both ES6 and ES7 styles)
  • No need to develop typical functionalities for your app
  • Zero Webpack configurations thanks to SpinJS

I Am a Client

  • Your team can start creating an app for any platform – web, server, and mobile
  • Your team wil be able to reuse the code they write for all the platforms
  • Your app will work faster thanks to the use of GraphQL instead of REST
  • Your app will be easier to support and evolve thanks to the modular architecture
  • Your app will be based on a widely used JavaScript ecosystem (read: it's easy to find JS developers)
  • Your team can focus on the application features straightaway instead of creating the basic functionality
  • Your app will be integrated with Stripe, one of the top payment processors

Concept

Configuring JavaScript-based client-server-mobile projects never was a trivial task. Not only do you have to spend time installing all the dependencies and managing them, but you're also constrained to implement many basic functionalities over and over again. And you never have time for building a starter codebase that you can reuse across all of your projects.

To relieve you from the burden of configuring the project, building the application structure, and implementing typical features, we've created Apollo Universal Starter Kit.

Apollo Universal Starter Kit provides you with a client-server-mobile application that you can employ as a foundation for developing new web or mobile projects using popular tools from the JavaScript ecosystem. But the starter kit doesn't just creates a mix of top JS technologies. In fact, the kit is powered by several custom libraries and solutions to simplify managing project configurations, creating new modules, building GraphQL queries, and carry out other tasks.

One such solution that helps to build and configure your Apollo Universal Starter Kit project without any complications is SpinJS, a custom build tool that configures Webpack for you. With SpinJS, we reduced the amount of errors that are caused by the third-party libraries used for building the project.

The starter kit also consists of many modules that you can augment and adapt to your specific application, or use as a reference when implementing basic features for your applications (even if you build them with other technologies).

If you want to learn more about the features available in Apollo Universal Starter Kit, follow to the dedicated Wiki section.

Learn more about the main modules in Architecture and Implemented Modules.

Architecture and Implemented Modules

Among all the approaches to building the application architecture, we chose the modular architecture. You can remove any built-in modules without breaking the application. We recommend that you develop your custom modules with the same idea in mind when using the starter kit.

The implemented modules are:

  • Authentication. This module provides authentication via social networks (Facebook, GitHub, and Google using OAuth 2.0) and with username and password. It also implements functionality for refreshing a forgotten password.
  • Authorization. Various user roles are available – the admin and registered user.
  • Pagination. The app provides navigation between pages and presentation of entities.
  • Contact Us Form. Provided functionality to send messages with attachments to the server side.
  • Posts and Comments. The module includes functionality to add, delete, and update posts and comments.
  • 404 Not Found Page. A minimalistic module for handling 404 requests.
  • State Management. The application state stored in the database and on the client.
  • Payments. The billing module provides functionality for recurring payments based on Stripe.

Modules in progress:

  • Mobile Chat. The live chat is based on the famous React Native Gifted Chat UI and is powered by GraphQL subscriptions.

Demo

Here's a demo of Apollo Universal Starter Kit in work:

screencast

You can also view the latest version of Apollo Universal Starter Kit deployed to Heroku. If you want to see a mobile application in action, check out this demo on Expo.io.

Branches

Branch Description
stable The latest stable version of the kit (recommended)
single A single-package Apollo v2 version of the kit
apollo1 The Apollo v1 version of the kit
cli-crud This version features a CLI to generate CRUD implementations

First Run of Apollo Universal Starter Kit

Verify if you use Node.js 6.x or higher (Node.js 8.x is recommended) before running the starter kit in your development environment.

  1. Clone the stable branch of Apollo Universal Starter Kit.
git clone -b stable https://github.com/sysgears/apollo-universal-starter-kit.git
cd apollo-universal-starter-kit
  1. Install the dependencies. Make sure that you use Yarn 1.0.0 or higher; or you can use NPM instead of Yarn to handle the starter kit dependencies and to run scripts.
yarn
  1. Seed sample data to the database. The command below will create new tables with sample data in SQLite:
yarn seed
  1. Run the starter kit in development mode:
yarn watch

For more information about running this starter kit for mobile development or Docker, consult the Getting Started Wiki section.

Project Structure

The project structure presents generally accepted guidelines and patterns for building scalable web and mobile applications.

The structure is fractal meaning the functionality is grouped primarily by feature rather than by file type. But the current structure isn't prescriptive, and you can change it however you need.

apollo-universal-starter-kit
├── config/                     # Global application configurations
├── docs/                       # Documentation
├── node_modules/               # Global Node.js modules
├── packages/                   # Source code of the application
│   ├── client/                 # Front-end package
│   │   └── src/
│   │       ├── app/            # Common front-end application code
│   │       ├── modules/        # Front-end feature-modules, each module has:
│   │       │                   # components, containers, GraphQL queries, and redux reducers
│   │       ├── testHelpers/    # Test helper for front-end integration tests
│   │       └── index.tsx       # Entry point to web front-end with hot code reload
│   ├── common/                 # Yarn package with common code, a Redux store, and logging
│   ├── mobile/                 # Mobile front-end package
│   │   └── src/
│   │       ├── .spinrc.js      # Mobile application properties 
│   │       └── index.ts        # Entry point to mobile front-end with live code reload
│   └── server/                 # Back-end Yarn package
│       ├── src/
│       │   ├── api/            # GraphQL API implementation
│       │   ├── database/       # Database migrations and seeds
│       │   │   └── migrations/ # Database migration scripts using Knex
│       │   │   └── seeds/      # Database seed scripts using Knex
│       │   ├── middleware/     # GraphQL Playground, GraphQL express and SSR rendering
│       │   ├── modules/        # Back-end server feature-modules, each module has:
│       │   │                   # schema definition, resolvers, and sql queries
│       │   ├── sql/            # Knex connector
│       │   ├── testHelpers/    # Test helper for back-end integration tests
│       │   ├── server.js       # GraphQL api server setup
│       │   └── index.ts        # Entry point to back-end with hot code reload
│       └── .spinrc.js          # Server application properties
└── tools/                      # All build and CLI-related files

Wiki Sections on Apollo Universal Starter Kit

In the list below, you can follow to various documents that explain different aspects of running, using, and configuring Apollo Universal Starter Kit.

Support

Community Support

  • Gitter channel – ask questions, find answers, and participate in general discussions
  • GitHub issues – submit issues and send feature requests
  • Wiki – read documentation for the usage scenarios of the starter kit; edit the documentation
  • FAQ – consult the Frequently Asked Questions section in Wiki

Commercial Support

The SysGears team provides comprehensive support for commercial partners. Our team will give guidance on the usage of Apollo Universal Starter Kit and will help you build your application based on the kit.

You can contact us via Skype or email [email protected].

Contributors

Thanks a lot to all the wonderful people who contributed to Apollo Universal Starter Kit!

Backers

Thanks a lot to all our backers!

Sponsors

You can support this project by becoming a sponsor! Your logo will show up here with a link to your website.

License

Copyright © 2016, 2017 SysGears INC. This source code is licensed under the MIT license.

apollo-universal-starter-kit's People

Contributors

larixer avatar mitjade avatar mairh avatar greenkeeper[bot] avatar sergei-gilevich avatar lyzhovnik avatar gekanchiko avatar josephdburdick avatar dmitriypdv avatar zirho avatar verdverm avatar alekseyzadorozhniy avatar asood123 avatar johnthepink avatar vsevolodbvd avatar giladshoham avatar werter12 avatar adam-s avatar h1net avatar tv-dm avatar andsviat avatar sergiiivzhenko avatar dcurletti avatar claym avatar lxwbr avatar yishaic avatar mkondel avatar lgants avatar greenkeeperio-bot avatar bamne123 avatar

Watchers

James Cloos avatar Hajri_Aymen 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.