Skip to content

InnerCircles is a private social platform built with **Node.js, Express, and PostgreSQL**, where users share posts inside invite-only circles. The app focuses on **real-world authentication, fine-grained authorization, and privacy-first content visibility**, going beyond basic CRUD functionality to mirror production-grade access control systems.

Notifications You must be signed in to change notification settings

devxsameer/inner-circles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

InnerCircles

Private communities. Real conversations. Public anonymity.

Node β€’ Express β€’ PostgreSQL β€’ Passport β€’ Tailwind

InnerCircles is a modern, community-based social platform where users can:

  • Create and join private circles
  • Post publicly or privately
  • Reveal identities only within their circles
  • Manage members with strict role-based permissions

It blends privacy, collaboration, and anonymity into a clean, simple user experience β€” making it a portfolio-grade full-stack project.

This project started as The Odin Project – Members Only assignment, but evolved into a full-featured, production-style web application with real authorization rules, role-based permissions, and relational data integrity.

Node.js Passport.js Express PostgreSQL TailwindCSS


πŸš€ Live Preview

πŸ”— Live App:
πŸ‘‰ https://innercircles.devxsameer.me/

Hosted on Render + Neon PostgreSQL.

Note: First visit may take a few seconds if Render has spun down the instance.


πŸš€ Live Concept

See posts. Join circles. Speak freely.

In InnerCircles:

  • Anyone can read public posts
  • Only circle members can see who wrote them
  • Each circle governs its own members, roles, and content

✨ Key Features

πŸ” Authentication

  • Local auth using Passport.js
  • Session-based login with PostgreSQL session store
  • Bcrypt password hashing
  • Rate-limited login endpoint (secure for production)

πŸ§‘β€πŸ€β€πŸ§‘ Circles (Communities)

  • Users can create their own circles
  • Circle creator automatically becomes owner
  • Role-based system:
    • Owner – full control
    • Admin – manage members & roles
    • Member – post and interact
  • Owners & admins can:
    • Add members by username
    • Promote/demote members
    • Remove members (with strict rules)
  • SQL triggers keep members_count up to date automatically

πŸ“ Posts & Privacy

  • Create, edit, and delete posts inside circles
  • Visibility types:
    • public
    • members_only
  • Identity reveal is circle-based:
    • Outside β†’ Anonymous
    • Inside β†’ Real username
  • Pagination for all feeds

πŸ›‘ Authorization & Security

  • Policy-based permission system
  • Loader middlewares (loadPost, loadCircle, loadMembership)
  • Separation of concerns:
    • Routes β†’ Controllers β†’ Services β†’ Models
  • Business rules enforced at:
    • Service layer
    • Database constraints
    • PostgreSQL triggers

πŸ“Š Performance & UX

  • Pagination for posts and circles
  • Popular circles ranked by member count
  • Indexed queries for efficient lookups
  • Clean, responsive UI using Tailwind CSS

🏠 Homepage

  • Latest public posts
  • Most popular circles
  • Clean, Tailwind-powered design

πŸ“Έ Screenshots

Home Page

Home Page Screenshot

Circle Details Page

Circle Details Page Screenshot

Manage Circle Page

Manage Circle Page Screenshot

All Posts Page

All Posts Page Screenshot

Create Post Page

Create Post Page Screenshot


🧠 Architecture Overview

src/
β”œβ”€β”€ routes/        # Route definitions
β”œβ”€β”€ controllers/   # Request handling & view rendering
β”œβ”€β”€ services/      # Business logic layer
β”œβ”€β”€ models/        # Database queries & data access
β”œβ”€β”€ policies/      # Permission & authorization rules
β”œβ”€β”€ middlewares/   # Auth, loaders, validators
β”œβ”€β”€ utils/         # Helpers, custom errors, pagination
β”œβ”€β”€ views/         # Handlebars templates
└── database/      # PostgreSQL connection pool

πŸ—„ Database Design

Core tables

  • users
  • circles
  • circle_members
  • posts

Notable design choices

  • members_count cached on circles via PostgreSQL triggers
  • Single owner enforced per circle
  • Role constraints at DB level
  • Automatic edited_at updates via trigger
  • Defensive foreign keys with cascading deletes

βš™οΈ Tech Stack

Backend

  • Node.js
  • Express 5
  • PostgreSQL (Neon)
  • Passport.js (local strategy)
  • express-session
  • bcrypt
  • connect-pg-simple (session store)

Frontend

  • Handlebars
  • Tailwind CSS

Tooling

  • pnpm
  • nodemon
  • dotenv
  • Concurrently

πŸ§ͺ Demo Data

The project includes realistic seed data:

  • Multiple users
  • Five circles with varied roles
  • 20+ long-form posts
  • Mixed visibility (public / members-only)

This makes the app immediately demo-ready.


πŸƒ Getting Started

1. Clone the repo

git clone https://github.com/devxsameer/inner-circles.git
cd inner-circles

2. Install dependencies

pnpm install

3. Environment variables

Create a .env file

DATABASE_URL=postgres://user:password@localhost:5432/inner_circles
SESSION_SECRET=supersecret
NODE_ENV=development

4. Initialize database

Run the SQL schema and seed file:

psql $DATABASE_URL -f sql/init.sql

5. Start development server

pnpm dev

App runs at:
πŸ‘‰ http://localhost:6969


πŸ”‘ Example Demo Accounts

For demo/testing purposes only
(Passwords are intentionally identical in seed data)

Username Password
alice password
bob password
charlie password

πŸ“Œ Why This Project Matters

This project demonstrates:

  • βœ… Real-world authorization logic
  • βœ… Clean Express.js architecture
  • βœ… Thoughtful database design
  • βœ… Security-first mindset

πŸ›£ Future Improvements

Planned enhancements include:

  • πŸ” CSRF protection
  • πŸ”‘ OAuth login (Google / GitHub)
  • πŸ’¬ Comment threads
  • πŸ”” Notifications system
  • 🌐 Full REST / JSON API mode

πŸ“œ License

This project is licensed under the ISC License.


πŸ™Œ Acknowledgements

Inspired by The Odin Project,
expanded with production-style architecture, strict permissions, and real privacy rules.


πŸ‘¨β€πŸ’» Author

Sameer Ali

Full-Stack Developer | Community-Driven Builder | Open-Source Contributor

Passionate about crafting clean, scalable applications and building community-based platforms.
Focused on JavaScript, Node.js, and modern full-stack development.

🌍 Links


If you like this project:

πŸ‘‰ Give it a star on GitHub! ⭐

It truly helps!


About

InnerCircles is a private social platform built with **Node.js, Express, and PostgreSQL**, where users share posts inside invite-only circles. The app focuses on **real-world authentication, fine-grained authorization, and privacy-first content visibility**, going beyond basic CRUD functionality to mirror production-grade access control systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published