### Install and Start VAULT Protocol API Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Install dependencies and start the VAULT Protocol API in development mode with encryption enabled. ```bash npm install npm run dev:encrypted ``` -------------------------------- ### Start Production Server Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Starts the production-ready server for the CredVault application. ```bash npm start ``` -------------------------------- ### Start Development Server Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Starts the development server for the CredVault project. Accessible at localhost:4300. ```bash npm run dev ``` -------------------------------- ### Install and Configure Self-Hosted MongoDB Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Steps to install MongoDB on a Debian-based system and configure it for replica set initialization, which is necessary for transactions. ```bash sudo apt-get install mongodb # Configure replica set for transactions sudo nano /etc/mongod.conf # Add: replication: replSetName: "rs0" # Restart and initialize sudo systemctl restart mongod mongo --eval "rs.initiate()" ``` -------------------------------- ### Start MongoDB and Development Server Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Instructions to start the local MongoDB instance and run the CredVault development server using npm. The application will be accessible at http://localhost:4300. ```bash # Start MongoDB (if running locally) mongod # Start the development server npm run dev # Application will be available at: # http://localhost:4300 ``` -------------------------------- ### Start IPFS Daemon Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Start the IPFS daemon. This is necessary for the VAULT Protocol integration. ```bash ipfs daemon ``` -------------------------------- ### Setup Quorum Network Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Set up a Quorum network using the provided command. This is required for blockchain integration. ```bash npx quorum-dev-quickstart ``` -------------------------------- ### Start Production Server with PM2 Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Starts the CredVault application using PM2 for process management, ensuring it runs as a service. ```bash pm2 start npm --name "credvault" -- start ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Steps to clone the CredVault repository, navigate into the directory, install project dependencies using npm, and copy the environment variable template. ```bash # Clone the repository git clone https://github.com/sarthakpriyadarshi/credvault.git cd credvault # Install dependencies npm install # Copy environment template cp .env.example .env.local ``` -------------------------------- ### Run Test Suite Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Executes the full test suite for the project. ```bash npm run test ``` -------------------------------- ### Backup Database Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Creates a backup of the current database. ```bash npm run db:backup ``` -------------------------------- ### Configure Environment Variables for Vercel Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Sets up essential environment variables for deployment on Vercel. Ensure these are kept secure. ```bash NEXTAUTH_URL=https://your-domain.vercel.app NEXTAUTH_SECRET=your-production-secret MONGODB_URI=your-atlas-connection-string # Add all other required variables ``` -------------------------------- ### Seed Development Database Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Seeds the development database with initial data. ```bash npm run db:seed ``` -------------------------------- ### Build for Production Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Builds the CredVault application for production deployment. ```bash npm run build ``` -------------------------------- ### Reset Database Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Resets the database to its initial state. ```bash npm run db:reset ``` -------------------------------- ### Authentication Routes Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Endpoints for user registration and login. ```APIDOC ## POST /api/v1/auth/register ### Description User registration endpoint. ### Method POST ### Endpoint /api/v1/auth/register ## POST /api/v1/auth/login ### Description User login endpoint. ### Method POST ### Endpoint /api/v1/auth/login ``` -------------------------------- ### Run ESLint Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Runs ESLint to check for code linting issues. ```bash npm run lint ``` -------------------------------- ### Environment Configuration Variables Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Essential environment variables for application, database, OAuth providers, VAULT Protocol, and admin security. Ensure NEXTAUTH_SECRET is at least 32 characters. ```env # ============================================ # Application Configuration # ============================================ NEXTAUTH_URL=http://localhost:4300 NEXTAUTH_SECRET=your-super-secure-secret-key-here-minimum-32-characters # ============================================ # Database Configuration # ============================================ MONGODB_URI=mongodb://localhost:27017/credvault # For MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/credvault # ============================================ # OAuth Providers (Optional) # ============================================ GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret GITHUB_CLIENT_ID=your-github-client-id GITHUB_CLIENT_SECRET=your-github-client-secret # ============================================ # VAULT Protocol (Blockchain Features) # ============================================ VAULT_PROTOCOL_URL=http://localhost:3001 FILE_ENCRYPTION_KEY=generate-32-byte-hex-key-here IPFS_URL=http://127.0.0.1:5001 BLOCKCHAIN_URL=http://127.0.0.1:8545 CHAIN_ID=1337 # ============================================ # Admin Security (Optional) # ============================================ ADMIN_CREATE_SECRET=your-admin-creation-secret ``` -------------------------------- ### Clear Build Cache and Reinstall Dependencies Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Commands to clear the Next.js build cache, remove node modules and package lock, and then reinstall dependencies. Useful for resolving build or deployment issues. ```bash # Clear Next.js cache rm -rf .next # Clear node modules rm -rf node_modules package-lock.json npm install # Check TypeScript errors npm run type-check ``` -------------------------------- ### User Routes Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Endpoints for managing user information. ```APIDOC ## GET /api/v1/users/me ### Description Retrieves information for the currently authenticated user. ### Method GET ### Endpoint /api/v1/users/me ### Middleware - withDB - withAuth ``` -------------------------------- ### Clone VAULT Protocol Repository Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Clone the VAULT Protocol repository to your local machine. This is the first step for blockchain credential verification. ```bash git clone https://github.com/sarthakpriyadarshi/VaultProtocol.git cd VaultProtocol ``` -------------------------------- ### Run Tests in Watch Mode Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Runs tests and automatically re-runs them when files change. ```bash npm run test:watch ``` -------------------------------- ### Generate Test Coverage Report Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Generates a report detailing the code coverage of the test suite. ```bash npm run test:coverage ``` -------------------------------- ### Check and Restart MongoDB Service Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Commands to check the status of the MongoDB service and restart it if necessary. Also shows the format for a local MongoDB connection string. ```bash # Check MongoDB status sudo systemctl status mongod # Restart MongoDB sudo systemctl restart mongod # Check connection string format MONGODB_URI=mongodb://localhost:27017/credvault ``` -------------------------------- ### Run TypeScript Checks Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Executes TypeScript checks to ensure type safety. ```bash npm run type-check ``` -------------------------------- ### Generate Encryption Key Source: https://github.com/sarthakpriyadarshi/credvault/blob/main/README.md Generate a 32-byte hexadecimal encryption key using OpenSSL. This key is used for secure operations within the VAULT Protocol. ```bash openssl rand -hex 32 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.