All Projects → atulmy → Fullstack Javascript Architecture

atulmy / Fullstack Javascript Architecture

Licence: mit
✍️ Opinionated project architecture for Full-Stack JavaScript Applications.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fullstack Javascript Architecture

Typerx
A lightweight typescript annotation rest based extra (express、 mongoose、 angular、zorro、ng-alain ...).
Stars: ✭ 76 (-83.62%)
Mutual labels:  mongodb, express, fullstack
React Express Fullstack
Full stack (mostly unopinionated) starter pack with React+Redux and Expressjs
Stars: ✭ 23 (-95.04%)
Mutual labels:  express, fullstack, nginx
Node Production
Take Your Node.js Project to The Production Environment (VPS/Dedicated Server).
Stars: ✭ 35 (-92.46%)
Mutual labels:  mongodb, express, nginx
Mern Boilerplate
Fullstack boilerplate with React, Redux, Express, Mongoose, Passport Local, JWT, Facebook and Google OAuth out of the box.
Stars: ✭ 112 (-75.86%)
Mutual labels:  mongodb, express, fullstack
Typescript Mern Starter
Build a real fullstack app (backend+website+mobile) in 100% Typescript
Stars: ✭ 154 (-66.81%)
Mutual labels:  mongodb, express, fullstack
Typescript Express Starter
🚀 TypeScript Express Starter
Stars: ✭ 238 (-48.71%)
Mutual labels:  mongodb, express, nginx
Mern
🌐 MERN stack 2.0 - MongoDB, Express, React/Redux, Node
Stars: ✭ 175 (-62.28%)
Mutual labels:  mongodb, express, fullstack
Saas
Build your own SaaS business with SaaS boilerplate. Productive stack: React, Material-UI, Next, MobX, WebSockets, Express, Node, Mongoose, MongoDB. Written with TypeScript.
Stars: ✭ 2,720 (+486.21%)
Mutual labels:  saas, mongodb, express
Bulletproof Nodejs
Implementation of a bulletproof node.js API 🛡️
Stars: ✭ 4,369 (+841.59%)
Mutual labels:  mongodb, express
Full Stack Notes
全栈工程师手册
Stars: ✭ 366 (-21.12%)
Mutual labels:  mongodb, nginx
Nodejs Api Boilerplate
A boilerplate for kickstart your nodejs api project with JWT Auth and some new Techs :)
Stars: ✭ 364 (-21.55%)
Mutual labels:  mongodb, express
Vue Chess
Multiplayer online chess game use Vue , Nodejs, Webpack, Em6, Socket.io, Mongodb, Express
Stars: ✭ 350 (-24.57%)
Mutual labels:  mongodb, express
Nuxt Ssr
✨vue+nuxt+sass+node+express+MongoDB 实现的SSR项目。
Stars: ✭ 323 (-30.39%)
Mutual labels:  mongodb, express
Blog Node
基于 node + express + mongodb 的博客网站后台
Stars: ✭ 364 (-21.55%)
Mutual labels:  mongodb, express
Steedos Platform
华炎魔方低代码/无代码平台。内核采用了元数据、微服务、微前端、K8S等最新的技术架构。Steedos Low-Code / No-Code Platform in nodejs and mongodb.
Stars: ✭ 310 (-33.19%)
Mutual labels:  saas, mongodb
Practicalnode
Practical Node.js, 1st and 2nd Editions [Apress] 📓
Stars: ✭ 3,694 (+696.12%)
Mutual labels:  mongodb, express
Notebook
🍎 笔记本
Stars: ✭ 381 (-17.89%)
Mutual labels:  mongodb, nginx
Nest Angular
NestJS, Angular 6, Server Side Rendering (Angular Universal), GraphQL, JWT (JSON Web Tokens) and Facebook/Twitter/Google Authentication, Mongoose, MongoDB, Webpack, TypeScript
Stars: ✭ 307 (-33.84%)
Mutual labels:  mongodb, express
Rest Api Node Typescript
Building RESTful Web APIs with Node.js, Express, MongoDB and TypeScript
Stars: ✭ 373 (-19.61%)
Mutual labels:  mongodb, express
Shell
Infrastructure Management Shell - Linux
Stars: ✭ 381 (-17.89%)
Mutual labels:  mongodb, nginx

Full-Stack JavaScript Architecture

Full-Stack JavaScript Architecture

Opinionated project architecture for Full-Stack JavaScript Applications.

About

Using JavaScript for full-stack has always been a challenge especially with architecting various pieces of the application, choosing technologies and managing devOps. This project provides a base for typical project consisting a Landing Website, Web and Mobile Applications, API service and easy deployment of these services. This project uses a microservice architecture where all individual project runs as a service (container).

A typical product (SaaS, etc.) usually consists of following services:

  • Landing page
    • Used for introducing your business to customers
    • Provide links to download the mobile application
    • Provide link to access web application
    • Contact page
    • Privacy policy page
    • Terms of use page
    • SEO friendly (should support server side rendering)
  • Web Application
    • Your actual application for your customers to use
    • Desktop browser
    • Tablet and mobile browser via responsive design
  • Mobile Application
    • Your actual application for your customers to use
    • Android (Mobile/Tablet)
    • iOS (Mobile/Tablet)

Core Structure

fsja
  ├── backend
  │   ├── api
  │   │   > NodeJS
  │   │   > PORT 8000
  │   │   > api.example.com
  │   │
  │   ├── database
  │   │   > MongoDB
  │   │   > PORT 27017
  │   │
  │   └── proxy
  │       > NGINX
  │       > PORT 80 / 443
  │
  ├── deployment
  │   > Docker Compose
  │
  ├── frontend
  │   ├── app
  │   │   ├── mobile
  │   │   │   > React Native
  │   │   │   > iOS (Apple App Store)
  │   │   │   > Android (Google Play Store)
  │   │   │
  │   │   └── web
  │   │       > React
  │   │       > Single page application
  │   │       > PORT 5000
  │   │       > app.example.com
  │   │
  │   └── landing
  │       > React
  │       > Server side rendered
  │       > PORT 3000
  │       > example.com
  │
  └── README.md (you are here)

Stack

Backend

  • API
    • NodeJS
    • Express
  • Database
    • MongoDB
  • Proxy
    • NGINX

Frontend

  • Landing

    • React
    • Next.js
    • Material UI
    • Server Side Rendering
  • Web

    • React
    • Redux
    • React Router
    • Material UI
  • Mobile (iOS, Android)

    • React Native
    • Redux
    • React Navigation

Deployment

  • Technologies
    • Docker
    • Docker compose

Setup and Running

  • Prerequisites

    • Node (v10.x)
    • MongoDB (v4.x)
    • Xcode (for iOS) (latest)
    • Android Studio (for Android) (latest)
    • Follow React Native Guide to setup your local machine
  • Clone repository git clone [email protected]:atulmy/fullstack-javascript-architecture.git fullstack

  • API

    • Info
      • Authentication strategy: JWT (JSON Web Token)
      • Current implementation uses RPC (Remote Procedure Call) for API endpoints (one endpoint URL, multiple operations) and can be easily replaced with REST.
      • Resources
    • Switch to api directory cd backend/api
    • Configuration
      • Create local environment file cp .env.dev.example .env.local
      • Modify .env.local for
        • PORT (8000)
        • NODE_ENV (development | production)
        • SECURITY_SECRET (Use passwordsgenerator)
        • SECURITY_SALT_ROUNDS (10)
        • MONGO_URL (mongodb://localhost:27017/example)
        • LANDING_URL (http://localhost:3000)
        • WEB_URL (http://localhost:5000)
        • API_URL (http://localhost:8000)
        • EMAIL_ON (0 | 1 (in development, you can toggle to send emails or not))
        • EMAIL_TEST (send test emails to this address)
        • EMAIL_HOST, EMAIL_USER, EMAIL_PASSWORD (use any email service, eg. mailgun.com and get credentials to start sending emails
    • Setup
      • Install packages and seed database npm run setup
    • Run
  • Landing

    • Switch to landing directory cd frontend/landing
    • Configuration
      • Create local environment file cp .env.dev.example .env.local
      • Modify .env.local for
        • PORT (3000)
        • NODE_ENV (development | production)
        • URL_LANDING (http://localhost:3000)
        • URL_WEB (http://localhost:5000)
        • URL_API (http://localhost:8000)
        • GA_TRACKING_ID (Google analytics tracking ID)
    • Setup
      • Install dependencies: npm install
    • Run
    • Resources
  • Web

    • Switch to web directory cd frontend/app/web
    • Configuration
      • Create local environment file cp .env.dev.example .env.local
      • Modify .env.local for
        • PORT (5000)
        • REACT_APP_LANDING_URL (http://localhost:3000)
        • REACT_APP_WEB_URL (http://localhost:5000)
        • REACT_APP_API_URL (http://localhost:8000)
    • Setup
      • Install dependencies: npm install
    • Run
  • Deployment

    • Deploy code
      1. Login to the server (SSH)
      2. Create a new directory on server: mkdir /var/www/fullstack and switch to the directory cd /var/www/fullstack
      3. Clone repository git clone [email protected]:atulmy/fullstack-javascript-architecture.git .
      4. Switch to deployment directory cd deployment
      5. Build containers docker-compose up --build -d
        • up = Builds, (re)creates, starts, and attaches to containers for a service.
        • --build = Build images before starting containers
        • -d = Detached mode: Run containers in the background, print new container names
      6. Re-deploy with following steps:
        • Change directory cd /var/www/fullstack
        • Pull latest code git pull
        • Rebuild containers: docker-compose up --build -d
    • Resources
  • Mobile

    • Switch to mobile directory cd frontend/app/mobile
    • Configuration
      • Modify src/setup/config/env.js for
        • APP_ENV (development | production)
        • LANDING_URL (http://<your local network IP>:3000)
        • WEB_URL (http://<your local network IP>:5000)
        • API_URL (http://<your local network IP>:8000)
        • Tip: use ifconfig on macOS or Linux to get your local IP address
    • Setup
      • Install dependencies: npm install
    • Run
      • iOS react-native run-ios --simulator='iPhone 8'
      • Android react-native run-android (connect your Android phone via USB or use already created simulator with name Mobile_-_5 by running cd ~/Library/Android/sdk/tools && ./emulator -avd Mobile_-_5)
    • Publish
      • Android
        • Build: cd android && ./gradlew assembleRelease && cd ...
        • Upload frontend/app/mobile/android/app/build/outputs/apk/release/app-release.apk to Play Store.
      • iOS
        • Build: Open frontend/app/mobile/ios/example.xcodeproj in Xcode -> Choose Generic iOS Device (top left) -> Product (top menu) -> Archive.
        • Upload using Archiver (will open automatically once Archive is complete)
    • Resources

Screenshots

View all screenshots here.

Landing
Landing Landing
Web
Web Web
Mobile
Mobile Mobile

Authors

Collaborators

  • Hossein Nedaee - GitHub
  • [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.

Resources and Inspirations

  • 💁‍♂️ Hand picked collection of packages, tutorials and more for React Native - GitHub
  • 🌱 Lightweight (remote procedure call) API pattern - GitHub
  • 🛡 A simple validation library for server and client side applications - GitHubNPM
  • 🌐 Universal react application with server side rendering - GitHub
  • 📦 A sample web and mobile application built with Node, Express, React, React Native and Redux - GitHub
  • Start learning by looking at sample codes on GitHub: #LearnByExamples

Hire me

Looking for a developer to build your next idea or need a developer to work remotely? Get in touch: [email protected]

Donate

If you liked this project, you can donate to support it ❤️

Donate via PayPal

Thank you for donating:

License

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

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].