Nevernight Vk ● <SECURE>
-- 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) );
<script setup> import ref, onMounted from 'vue'; import io from 'socket.io-client'; import PostCard from '@/components/PostCard.vue'; import SubmitModal from '@/components/SubmitModal.vue'; import fetchCurrentTheme, fetchFeed from '@/api'; nevernight vk
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> -- Reactions (one row per user‑post‑emoji) CREATE TABLE
<div class="posts"> <PostCard v-for="p in posts" :key="p.id" :post="p" @react="handleReact" @vote="handleVote"/> </div> | | POST | /api/posts/:id/react | required | Payload: emoji
<SubmitModal v-if="showSubmit" @close="showSubmit = false" @submitted="onSubmitted"/> </section> </template>
-- 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). |