-- Reactions (one row per user‑post‑emoji) CREATE TABLE reactions ( post_id BIGINT REFERENCES posts(id), user_id BIGINT REFERENCES users(vk_id), emoji TEXT CHECK (emoji IN ('heart','moon','sound','fireworks')), PRIMARY KEY (post_id, user_id, emoji) );
-- Posts CREATE TABLE posts ( id BIGSERIAL PRIMARY KEY, user_id BIGINT REFERENCES users(vk_id), type TEXT CHECK (type IN ('photo','video','text')), media_url TEXT, text_body TEXT, created_at TIMESTAMP DEFAULT now(), theme_id BIGINT REFERENCES themes(id) ); nevernight vk
<SubmitModal v-if="showSubmit" @close="showSubmit = false" @submitted="onSubmitted"/> </section> </template> -- Reactions (one row per user‑post‑emoji) CREATE TABLE
-- Themes CREATE TABLE themes ( id BIGSERIAL PRIMARY KEY, name TEXT, banner_url TEXT, music_url TEXT, start_time TIMESTAMP, end_time TIMESTAMP ); | Method | Path | Auth | Description | |--------|------|------|-------------| | GET | /api/feed?limit=20&offset=0 | optional | Returns ordered list of posts for the live wall. | | POST | /api/posts | required | Payload: type, media, text, theme_id . Returns post ID. | | POST | /api/posts/:id/react | required | Payload: emoji . Returns updated counters. | | POST | /api/posts/:id/vote | required | No body. Returns success/failure. | | GET | /api/themes/current | none | Returns the active theme (banner, music). | | GET | /api/leaderboard?period=day | none | Top 10 users by night‑score. | | GET | /api/admin/pending | admin only | List of flagged posts for manual review. | | POST | /api/admin/themes | admin only | Create or update a night‑theme schedule. | | POST | /api/admin/pin/:postId | admin only | Pin a post as Night‑Master (24 h). | | | POST | /api/posts/:id/react | required | Payload: emoji
The idea is to give the community a unique, engaging, and technically feasible addition that will keep members active, grow the audience, and reinforce the brand’s “never‑night” vibe. Name: NeverNight Live Pulse Tagline: “Feel the beat of the night, 24 × 7 – even when the world sleeps.”
<button v-if="isMember" class="submit-btn" @click="showSubmit = true"> + Night Moment </button>
All endpoints validate inputs with express-validator and return with ok: true, data: … or ok:false, error: … . 8. Sample Code Snippets 8.1. Vue Component – Live Pulse Wall <template> <section class="pulse-wall" :style="backgroundImage:`url($currentTheme.banner)`"> <audio v-if="currentTheme.music" :src="currentTheme.music" autoplay loop></audio>