A minimal, full-stack social media app. Features include user registration, following, posting, liking, and commenting. Built with a modern monorepo stack and ready for cloud deployment.
- User: Register, edit, or delete accounts
- Follow: Follow/unfollow users, view posts from followed users
- Post: Create text/image posts, like, and comment
- Comment: Comment on posts
- Monorepo: Turborepo
- Backend: Node.js, Express, MongoDB, TypeScript, Zod
- Frontend: React Router, TypeScript, shadcn/ui, Tailwind CSS
- Shared Schemas: Zod (TypeScript)
- Infrastructure: Terraform (AWS), Ansible, Docker, Caddy
.
├── apps
│ ├── client # React frontend
│ └── server # Express backend
├── packages
│ └── schemas # Shared Zod schemas
├── infrastructure
│ ├── ansible # Provisioning & deployment
│ └── main.tf # Terraform AWS setup
├── turbo.json
└── ...
- Node.js (v23+)
- pnpm (v10.6+)
- Docker (for containerization)
- AWS CLI & credentials (for deployment)
- Terraform & Ansible (for infrastructure)
-
Install dependencies:
pnpm install
-
Start MongoDB (locally or with Docker):
docker run -p 27017:27017 mongo
-
Start backend:
pnpm --filter=server dev
-
Start frontend:
pnpm --filter=client dev
-
Visit http://localhost:5173.
# server
docker build --file apps/server/Dockerfile -t pubment-server .
# client
docker build --file apps/client/Dockerfile -t pubment-client .- Terraform provisions AWS EC2, security groups, and networking.
- Ansible installs Docker, clones the repo, builds images, and runs containers.
- Caddy serves the frontend with HTTPS and reverse proxy.
-
Provision AWS resources:
cd infrastructure terraform init terraform apply -
Generate Ansible inventory:
cd ansible python3 gen_inventory.py -
Deploy with Ansible:
ansible-playbook -i inventory.ini frontend.yml ansible-playbook -i inventory.ini backend.yml
- The frontend is served via Caddy on HTTPS (port 443).
- The backend is only accessible from the frontend instance (private networking).
- See
.env.examplefiles in each app for required variables. - During deployment, Ansible templates these automatically.
Project is licened under MIT license.