mirror of
https://github.com/elder-plinius/R00TS.git
synced 2026-02-12 17:22:52 +00:00
R00TS Backend Server
This is the backend server for the R00TS application, providing API endpoints for word and dataset management.
Features
- RESTful API for word submissions and retrieval
- MongoDB integration for persistent data storage
- Automatic dataset creation and backup
- Production-ready configuration
Prerequisites
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas account)
Installation
- Clone the repository (if you haven't already)
- Navigate to the server directory:
cd server - Install dependencies:
npm install - Create a
.envfile based on the.env.exampletemplate:cp .env.example .env - Update the
.envfile with your MongoDB connection string
Running the Server
Development Mode
npm run dev
This will start the server with nodemon, which automatically restarts when changes are detected.
Production Mode
npm start
API Endpoints
Words
GET /api/words- Get all wordsPOST /api/words- Add or update a wordGET /api/words/stats- Get word statistics
Datasets
GET /api/datasets- Get all datasets (limited info)GET /api/datasets/:filename- Get a specific dataset by filenamePOST /api/datasets- Create a new dataset snapshotGET /api/datasets/recent/list- Get recent datasets (limited to 5)
Deployment
For production deployment, we recommend:
- Set up a MongoDB Atlas cluster for your database
- Update the
.envfile with your production MongoDB URI - Deploy to a hosting service like Heroku, Vercel, or DigitalOcean
Data Migration
If you have existing data in localStorage that you want to migrate to the database:
- Export your localStorage data
- Use the import functionality (coming soon) to upload to the server
License
See the main project license file.