This template provides a comprehensive starting point for a full-stack application using the following technologies:
- Turborepo: A high-performance build system for JavaScript and TypeScript codebases, enabling efficient management of monorepos.
- NestJS: A progressive Node.js framework for building efficient and scalable server-side applications.
- PostgreSQL: A powerful, open-source object-relational database system.
- Prisma ORM: A modern database toolkit for TypeScript and Node.js, making database access easy with an auto-generated query builder.
- Redis: An in-memory data structure store, used as a database, cache, and message broker.
- Next.js: A React framework for building fast and user-friendly static websites and web applications.
This template is organized into a monorepo structure using Turborepo, with the following main components:
- api: A NestJS-based API that connects to a PostgreSQL database using Prisma ORM. It also integrates Redis for caching.
- web: A Next.js frontend application that connects to the API.
- Efficient Monorepo Management: Utilizing Turborepo for streamlined development and deployment processes across multiple applications and libraries.
- Scalable API: Built with NestJS, providing a modular and maintainable architecture.
- Robust Database Management: PostgreSQL as the database, managed through Prisma ORM for type-safe database access.
- Caching with Redis: Improve performance and reduce database load by caching frequently accessed data.
- Modern Frontend: A Next.js frontend that interacts seamlessly with the NestJS API, offering a fast and responsive user experience.
To use this template, follow these steps:
- Clone the Repository: Clone this repository to your local machine.
git clone git@github.com:GRoobArt/Railway-Monorepo-Next-Nest.git
- Install Dependencies: Navigate to the project directory and install dependencies.
cd $_
npm install
- Set Up Environment Variables: Create a .env file in the root directory and configure the necessary environment variables for PostgreSQL, Redis, and any other services.
- Run the Project: Start the development servers for both the API and the frontend.
npm run dev
- Deploy on Railway: Follow the Railway deployment instructions to deploy your project.
Railway provides a seamless deployment process. Ensure your environment variables are set in the Railway project settings. Use the following commands to deploy your applications:
- Deploy API:
railway up -s api
- Deploy Frontend:
railway up -s web