Skip to content

A SaaS platform for workspace management with a file manager, soon to be enhanced with chat and calendar features

License

Notifications You must be signed in to change notification settings

nathacks/Collab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a714fa9 Â· Apr 10, 2025

History

3 Commits
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Apr 10, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025

Repository files navigation

Collab - Next.js & Prisma SaaS Starter

GitHub Banner

Next.js Prisma shadcn/ui TailwindCSS Better Auth TypeScript Docker

This project is a Next.js application initialized with create-next-app and using Prisma for database management. It also integrates shadcn for UI components and Better Auth for authentication.

Project Overview

This project aims to provide a SaaS platform with workspace creation, enabling a file manager system. Future features will include chat functionality and a calendar system to enhance collaboration within workspaces.

Prerequisites

Before starting, make sure you have the following tools installed on your machine:

Installation

Clone the repository and install dependencies:

pnpm install
# or
npm install
# or
yarn install

Configuration

Copy the .env.example file to .env and configure the environment variables:

DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE"
FOLDER_DATA=data
BETTER_AUTH_SECRET=..... # openssl rand -base64 32
GROQ_API_KEY=.......

Prisma

Generate the Prisma client and apply migrations:

npx prisma generate
npx prisma migrate dev --name init

Important: Run Database Seeding Before Starting the Project

Before running the development server, make sure to seed the database with initial data:

npx prisma db seed

If you need to reset the database and apply the seeders again:

npx prisma migrate reset
npx prisma db seed

Start the Development Server

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 in your browser to see the result.

Database Seeding

The project includes a seed script to populate the database with test data. Modify the src/lib/prisma/seeds/seed.ts file as needed.

Run the seed script:

npx prisma db seed

Docker Setup for Production

To run the project in a production environment using Docker, use the provided docker-compose.yml file.

Start the Containers

docker-compose up -d --build

Stop the Containers

docker-compose down

Docker Compose Configuration for Production

Below is the docker-compose.yml configuration used for running the application in production:

services:
  db:
    image: postgres:15.6
    container_name: collab-nextjs-db
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_DB=collab
      - POSTGRES_USER=collab
      - POSTGRES_PASSWORD=collab
    volumes:
      - collab_nextjs_db:/var/lib/postgresql/data

  app:
    container_name: collab-nextjs
    build:
      context: .
      dockerfile: Dockerfile
      args:
        - FOLDER_DATA
    environment:
      - DATABASE_URL=postgresql://collab:collab@db:5432/collab?schema=public
    restart: unless-stopped
    ports:
      - "3000:3000"
    depends_on:
      - db
    volumes:
      - collab_nextjs_data:/app/${FOLDER_DATA}

volumes:
  collab_nextjs_db:
  collab_nextjs_data:

Note on Dockerfile

This project uses pnpm as the package manager in the Dockerfile. If you prefer to use npm or yarn, make sure to update the Dockerfile accordingly to replace pnpm commands with the package manager of your choice.

Documentation

Deployment

The easiest way to deploy your application is by using Vercel.

Check out the Next.js deployment documentation for more details.


Happy coding! 🚀

About

A SaaS platform for workspace management with a file manager, soon to be enhanced with chat and calendar features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages