Skip to content

Mr-Documents/compass-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compass Backend

✅ Prerequisites


⚙️ Setup

# Clone the repository
git clone https://github.com/your-username/compass-backend.git
cd compass-backend

# Install dependencies
npm install

# Create environment file
cp .env.example .env
🧾 Configure Environment
Edit .env:

env
MONGO_URI=mongodb://localhost:27017/house_booking_db
JWT_SECRET=your_secure_secret_here
JWT_EXPIRE=30d
NODE_ENV=development
PORT=3000

mongod  # Start MongoDB service in another terminal
# Development (with auto-restart)
npm run dev

# Production
npm start
compass-backend/
├── src/
│   ├── controllers/      # Business logic
│   ├── models/           # MongoDB schemas
│   ├── routes/           # API endpoints  
│   ├── middleware/       # Authentication & validation
│   ├── db/               # Database connection
│   └── app.js            # Main application
├── .env.example          # Environment template
└── package.json
# Clean reinstall
rm -rf node_modules package-lock.json (in bash. rm is not recognized in cmd)
npm install

##Endpoint testing
POST /api/v1/auth/register
Body: { "email": "user@example.com", "password": "secure123" }

POST /api/v1/auth/login
Body: { "email": "user@example.com", "password": "secure123" }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%