This is a boilerplate/starter project for the Turbo engine.
- Turbo Engine
- MongoDB
- Prisma ORM (Turbo initialises this).
- Translations
- Docker build file.
- Vue 3
- Vue Router
- Pinia (Vuex replacement)
- TypeScript
- Eslint
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.
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
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
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