2PM is an open source social platform designed to help people connect with their friends and family.
It uses a powerful framework that allows the use of AI bots to interact with data, play games and perform tasks
apps/web: Next.js frontend applicationapps/api: NestJS backend APIapps/cli: Command-line interface toolspackages/ui: Interface components built with Storybookpackages/core: Shared libraries and modules
- Frontend: Next.js, React, TypeScript
- Backend: NestJS, TypeScript
- Database: PostgreSQL with Drizzle ORM
- Real-time Communication: Socket.IO
- Package Management: Bun
This is a monorepo for a full-stack application with Next.js frontend, NestJS API backend, and supporting services.
There is a script in the root of the repo ./start which loads each of the apps in it's own Tmux session, with the socket set to 2pm
I switch between apps using CTRL+B s
NX can also be used for those that don't use Tmux, though I haven't configured this
- Node.js (recommended version in
.nvmrc) - Bun package manager
- PostgreSQL
- Install dependencies:
bun install- Initialise library database
# Ensure Git LFS is installed
git lfs install
# Initialize LFS for the repo (if not already done)
git lfs install --local
# Pull the specific LFS file
git lfs pull --include="2pm_library.dump"Then restore the sql dump to your Postgres instance
- Initialise the app database
cd packages/core package and run either bun setup, or
bun niko db create
bun drizzle:app push
bun niko db seed-
Set up environment variables:
- Copy
.env.exampleto.envin each app directory - Update with your configuration
- Copy
Start the development servers for all applications:
# Start the entire stack (from project root)
./start- Application: http://localhost:3000
- Storybook UI: http://localhost:3001
- Swagger UI (API documentation): http://localhost:3002/docs
- Bull Dashboard: http://localhost:3002/queues
Each application has its own testing configuration. Run tests from the individual app directories.
This project is open sourced under the MIT License, with a single provision that servers leave an attribution to the original project
See the LICENSE file for details.
