GithubHelp home page GithubHelp logo

austin88-pro / fuelstack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from riipandi/fuelstack

0.0 0.0 0.0 2.14 MB

Monorepo starter pre-configured with Turborepo, Fastify, Drizzle ORM, Vite React, Next.js, TypeScript, and Jest.

License: MIT License

JavaScript 22.04% TypeScript 61.22% HTML 1.40% Dockerfile 15.34%

fuelstack's Introduction

Project Logo

Contribution welcome Top language License

Introduction

A full-stack monorepo starter kit powered by Turborepo, originally based on Turborepo example kitchen-sink.

This starter kit is already pre-configured with some additional packages and tools, such as:

Each package and app is 100% TypeScript.

Quick Start

Prerequisites

  1. Install Node.js v18.16.1 or greater: https://nodejs.org/en/download
  2. Install pnpm package manager: https://pnpm.io/installation
  3. Docker and Docker Compose: https://docs.docker.com/desktop

Setup New Project

# Using npx
npx create-turbo@latest -e https://github.com/riipandi/fuelstack

# Using yarn
yarn create-turbo@latest -e https://github.com/riipandi/fuelstack

# Using pnpm
pnpm dlx create-turbo@latest -e https://github.com/riipandi/fuelstack

Changing The Organization Scope

The organization scope for this starter is @acme. To change this, you'll need to do the following:

  • Rename folders in packages/* to replace acme with your desired scope.
  • Search and replace acme string with your desired scope.

Generate Secret Key

Before you continue, you need to create .env file (you can duplicate .env.example) and fill the application secret key with some random string. To generate a secret key, use the following command:

openssl rand -base64 500 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1

Up and Running

This turborepo uses pnpm as a package manager. Run pnpm install to install required npm dependencies.

Start all packages in development

pnpm dotenv -e .env.local -- turbo run dev

Run or build partial apps or package

# Running the Fastify API in development mode
pnpm dotenv -e .env.local -- turbo run dev --filter=api...

# Running the Next.js application in development mode
pnpm dotenv -e .env.local -- turbo run dev --filter=website...

# Build the Next.js application for production
pnpm dotenv -e .env.local -- turbo run build --filter=website...

For more detailed explanation, check out Turborepo documentation.

Turborepo's team currently recommend using dotenv-cli as the simplest way to bring your environment variables into your development tasks. Turborepo's team looking forward to improving the developer experience and ergonomics for your environment variables in a future release of Turborepo.

Turborepo Remote Caching

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

# Authenticate the Turborepo CLI with your Vercel account
pnpm dlx turbo login

# Link your project to your Remote Cache
pnpm dlx turbo link

Useful Commands

This starter contains a command line script to help you manage the project such as running the PostgreSQL, Redis, and Mailpit on Docker.

pnpm dev          # Develop all packages and the docs site
pnpm build        # Build all packages and the docs site
pnpm lint         # Lint all packages
pnpm cleanup      # Clean up all node_modules and dist folders

Deploying with Docker

Build Docker image

docker build -f apps/website/Dockerfile . --no-cache \
  -t acme-website:$(npm pkg get version | tr -d "\042") \
  -t acme-website:latest

If you want to use Turbo caching:

docker build -f apps/website/Dockerfile . --no-cache \
  --build-arg TURBO_TEAM="your_team_name" \
  --build-arg TURBO_TOKEN="your_token" \
  -t acme-website:$(npm pkg get version | tr -d "\042") \
  -t acme-website:latest

Run Docker image

docker run --rm -it --name acme-website -p 3000:3000 \
  --env-file .env.docker acme-website:latest

For more detailed explanation, check out Deploying with Docker documentation.

Deploy your own

You'll want to fork this repository and deploy your own Next.js website. Once you have an image generator that sparks joy, you can setup automatic GitHub deployments so that pushing to master will deploy to production! ๐Ÿš€

Deploy to Vercel

Vercel Deployment

You will need to configure a few things:

  • Settings -> General -> Root Directory : apps/website/
  • Settings -> Git -> Ignored Build Step : git diff --quiet HEAD^ HEAD ./

Ignored Build Step configuration used to avoid rebuilding on Vercel when pushing the changes. So, Vercel will deploy only when any changes on the specific directory.

Cloudflare Deployment

You need to add NODE_VERSION with value 18.16.1 on the environment variables setting.

Thanks to...

In general, I'd like to thank every single one who open-sources their source code for their effort to contribute something to the open-source community. Your work means the world! ๐ŸŒ โค๏ธ

Useful Links

Learn more about the power of Turborepo:

License

This project is open-sourced software licensed under the MIT license.

Copyrights in this project are retained by their contributors. See the license file for more information.


๐Ÿคซ Psst! If you like my work you can support me via GitHub sponsors.

fuelstack's People

Contributors

riipandi 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.