Skip to content

Nasaa1234/network

Repository files navigation

Network Olympiad Registration System

Next.js (App Router) + Firebase (Auth, Firestore, Storage) + Tailwind CSS. Mongolian UI for the XIV National Computer Network Olympiad registration flow.

Features

  • Email/password authentication; user role (user | admin) stored in Firestore users/{uid}.
  • /dashboard: registration form, multiple PDF uploads to Storage, one submission per user (submissions/{uid}), status pending by default.
  • /admin: admin-only list of submissions, approve/reject, PDF links.
  • Home page with countdown to 30 April 2026 (registration deadline context) and official copy.
  • Firestore and Storage security rules under firebase/.

Prerequisites

  • Node.js 20+
  • A Firebase project with Authentication (Email/Password), Firestore, and Storage enabled.

Setup

  1. Clone / open the project

    cd network-olympiad
    npm install
  2. Environment variables

    Copy .env.example to .env.local and fill in values from Firebase Console → Project settings → Your apps → Web app.

    cp .env.example .env.local
  3. Deploy security rules

    Install Firebase CLI if needed: npm i -g firebase-tools then firebase login.

    Either paste firebase/firestore.rules and firebase/storage.rules into the Firebase Console (Firestore → Rules, Storage → Rules), or use a firebase.json that points at these files and run firebase deploy --only firestore:rules,storage.

  4. Create an admin user

    • Register a normal account via /register.
    • In Firebase Console → Firestore → users → open that user’s document and set role to string value admin.
  5. Firestore index (if prompted)

    The admin page queries submissions with orderBy('submittedAt', 'desc'). If the console asks for a composite index, click the link it provides to create it (single-field submittedAt is usually auto-indexed).

Run locally

npm run dev

Open http://localhost:3000.

Build & production

npm run build
npm start

Deploy (e.g. Vercel)

  1. Push the repo to GitHub/GitLab.
  2. Import the project in Vercel.
  3. Add the same NEXT_PUBLIC_FIREBASE_* variables in the project’s Environment Variables.
  4. Deploy.

Ensure Firebase Authorized domains includes your production domain (Authentication → Settings → Authorized domains).

Project layout

  • app/ — routes (/, /login, /register, /dashboard, /admin)
  • context/AuthContext.tsx — auth state + Firestore profile
  • lib/firebase.ts — Firebase initialization
  • firebase/firestore.rules, firebase/storage.rules — example rules

Storage paths

PDFs are stored as submissions/{uid}/{timestamp}_{index}_{filename}.

License

Private / event use — adjust as needed.

network

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors