A web application for managing teacher-student relationships, tracking student points, and facilitating a rewards system.
User Authentication and Authorization
User Management
Event Management
Points System
Leaderboard
Store for Points Redemption
Clone the repository:
git clone https://your-repository-url.git
cd ogrtakipnext
Install dependencies:
npm install
Create a .env.local
file with the following variables:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_key
Seed the database with an admin user:
npm run seed
This creates an admin user with:
Start the development server:
npm run dev
Open http://localhost:3000 in your browser.
The system includes a registration request workflow:
/register
page/admin/registration-requests
This workflow ensures that only authorized users gain access to the system.
The application provides the following API endpoints:
POST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutGET /api/auth/me
- Get current user infoPOST /api/register
- Submit registration requestGET /api/admin/registration-requests
- Get all registration requests (admin only)POST /api/admin/registration-requests
- Process a registration request (admin only)GET /api/users
- Get all users (admin only)POST /api/auth/register
- Create a user (admin only)GET /api/users/:id
- Get a specific userPUT /api/users/:id
- Update a user (admin only)DELETE /api/users/:id
- Delete a user (admin only)GET /api/events
- Get all eventsPOST /api/events
- Create an event (admin or tutor)GET /api/points
- Get points transactionsPOST /api/points
- Award points (admin or tutor)GET /api/leaderboard
- Get student rankingsGET /api/store
- Get store itemsPOST /api/store
- Create a store item (admin only)GET /api/requests
- Get item requestsPOST /api/requests
- Create an item request (student only)GET /api/requests/:id
- Get a specific requestPUT /api/requests/:id
- Update a request status (admin or tutor)This project is licensed under the MIT License.