Skip to content

A boilerplate application for the Turbo engine with the Turbo Vite SSR plugin installed with Translations, Prisma ORM, Docker build files, Pinia, Vue Router and using Vue 3 + TypeScript.

License

Notifications You must be signed in to change notification settings

Symbux/Turbo-Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turbo Starter Project

This is a boilerplate/starter project for the Turbo engine.


Features

  • Turbo Engine
  • MongoDB
  • Prisma ORM (Turbo initialises this).
  • Translations
  • Docker build file.
  • Vue 3
  • Vue Router
  • Pinia (Vuex replacement)
  • TypeScript
  • Eslint

Project Setup

Clone the repository.

git clone [email protected]:Symbux/Turbo-Starter.git <folder>
cd <folder>

Setup the project.
This will install any required dependencies in both the web and api folders.

yarn setup

Copy and fill out the environment file.
Make sure that the port you use in the .env file is the same as the one in the vite.config.js file.

cp api/.env.example api/.env

Generate the prisma client.
This will generate the prisma client with all the types based on the schema.

yarn prisma:gen

Database Configuration.
Prisma ORM requires that the MongoDB instance is setup as a replica set, in the ./db folder there is an example single node cluster for development, we suggest that for large scale production apps you configure a multi-node replica set, or using something like Mongo Atlas.

cd ./db
docker-compose up -d

# Only run the below once on first launch of the database (the setting is saved after restarts).
docker-compose exec mongo mongo --eval "rs.initiate({_id: 'rs0', members: [{_id: 0, host: '127.0.0.1:27017'}]});"

You are now all set, see the next section to start developing.


Developing

Run the development server.
This will launch the Vite dev server and the turbo engine in dev mode together.

yarn dev

Run the dev server's seperately.
If you want to launch the dev servers separately, because you want to see the logs better, you can run the following commands in two different terminals.

yarn dev:api
yarn dev:web

Navigate to browser.
This will be the Vite dev server, proxying all connections to your turbo app.

http://localhost:3000

Building

Build the project.
This will build both projects, and the API will host the built Vue files.

yarn build

Build only the API. This will build the API only.

yarn build:api

Build only the web. This will build the web only.

yarn build:web

Launching Production

Make sure you have built the application first!

Start the server.
This will start the Turbo engine which will host the built Vue files.

yarn start

About

A boilerplate application for the Turbo engine with the Turbo Vite SSR plugin installed with Translations, Prisma ORM, Docker build files, Pinia, Vue Router and using Vue 3 + TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published