Skip to content

shellgeistbot/mikromeydan

Repository files navigation

MikroMeydan 🐚

Deploy-ready mini sosyal medya uygulaması. Vanilla frontend + Express backend + PostgreSQL SQL database.

Özellikler

  • Hesap oluşturma, giriş yapma ve token tabanlı oturum
  • Profil kartı, bio/avatar düzenleme ve profil istatistikleri
  • Gönderi paylaşma, silme, beğenme, yankılama
  • Mood rozeti ve 280 karakter composer
  • Hashtag algılama + trend API'si
  • Akış / popüler / benimkiler filtreleri
  • PostgreSQL üzerinde kalıcı SQL veri tabanı
  • Otomatik tablo oluşturma + seed data
  • Healthcheck: /health
  • Docker, Docker Compose, Render config ve GitHub Actions CI hazır

Tek komut Docker deploy

docker compose up --build
# http://localhost:3000

Compose iki servis kaldırır:

  • app: Node/Express web uygulaması
  • db: PostgreSQL 16, kalıcı volume ile

SQL'e girmek için:

npm run db:shell

Lokal geliştirme

Önce PostgreSQL çalıştır:

docker compose up -d db
npm install
npm run dev

Alternatif olarak kendi PostgreSQL bağlantını ver:

DATABASE_URL=postgres://user:pass@host:5432/dbname npm start

API

  • POST /api/auth/register body: { "name": "Tuna", "handle": "tuna", "password": "secret1" }
  • POST /api/auth/login body: { "handle": "tuna", "password": "secret1" }
  • GET /api/me
  • PUT /api/me body: { "name": "Tuna", "avatar": "🐟", "bio": "..." }
  • GET /api/profile/:handle
  • GET /api/posts?filter=all|hot|mine
  • POST /api/posts body: { "text": "Selam #mikromeydan", "mood": "⚡" } + Authorization: Bearer <token>
  • POST /api/posts/:id/like body: { "liked": true }
  • POST /api/posts/:id/echo + auth
  • DELETE /api/posts/:id + auth
  • GET /api/trends
  • GET /health

Test

npm test

Testler pg-mem ile in-memory SQL database üstünde çalışır.

Deploy

Docker VPS

git clone https://github.com/shellgeistbot/mikromeydan.git
cd mikromeydan
docker compose up -d --build

Render

render.yaml hazırdır. Render web service + managed PostgreSQL database oluşturacak şekilde ayarlı.

Environment

.env.example:

PORT=3000
APP_ORIGIN=*
DATABASE_URL=postgres://mikromeydan:mikromeydan@localhost:5432/mikromeydan
AUTH_SECRET=change-me-in-production

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors