AbroadEase is a comprehensive platform for international students to find study guides, university information, and housing options. The platform features SOP and VISA guides with advanced filtering, bookmarking functionality, and admin management.
abroadease/
βββ api/ # Backend (Node.js + Express + MongoDB)
β βββ models/ # Database models
β βββ routes/ # API routes
β βββ middleware/ # Authentication middleware
β βββ package.json # Backend dependencies
β βββ server.js # Server entry point
βββ web/ # Frontend (React + Vite + Tailwind CSS)
βββ src/
β βββ components/ # React components
β βββ pages/ # Page components
β βββ context/ # React context
β βββ constants/ # Static data
β βββ api/ # API configuration
βββ package.json # Frontend dependencies
βββ vite.config.js # Vite configuration
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download here
- MongoDB - Download here or use MongoDB Atlas
- Git - Download here
- Code Editor - VS Code recommended
-
Clone the repository
git clone <repository-url> cd abroadease
-
Install Backend Dependencies
cd api npm install
-
Install Frontend Dependencies
cd ../web npm install
-
Create Environment File
cd api touch .env
-
Add Environment Variables
# Database Configuration MONGODB_URI=mongodb://localhost:27017/abroadease # For MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/abroadease # JWT Secret (generate a secure random string) JWT_SECRET=your-super-secure-jwt-secret-key-here # Server Configuration PORT=1617 NODE_ENV=development # Default Admin User (automatically created on first run) ADMIN_EMAIL=admin@abroadease.com ADMIN_PASSWORD=admin123
The frontend is pre-configured to work with the backend. The API base URL is set in web/src/api/axios.js
:
// For local development
baseURL: 'http://localhost:1617/api'
{
"dependencies": {
"bcryptjs": "^3.0.2", // Password hashing
"cookie-parser": "^1.4.7", // Cookie parsing
"cors": "^2.8.5", // Cross-origin requests
"dotenv": "^17.2.1", // Environment variables
"express": "^5.1.0", // Web framework
"jsonwebtoken": "^9.0.2", // JWT authentication
"mongoose": "^8.17.1" // MongoDB ODM
}
}
{
"dependencies": {
"react": "^18.2.0", // React library
"react-dom": "^18.2.0", // React DOM
"react-router-dom": "^6.8.0", // Routing
"axios": "^1.3.0" // HTTP client
},
"devDependencies": {
"tailwindcss": "^3.3.0", // CSS framework
"vite": "^4.4.5" // Build tool
}
}
-
Start the Backend Server
cd api npm start
The backend will run on
http://localhost:1617
First Run: If this is your first time starting the server, you'll see the admin user creation message in the console.
-
Start the Frontend Development Server (in a new terminal)
cd web npm run dev
The frontend will run on
http://localhost:5173
If you have concurrent scripts set up:
npm run dev # Runs both frontend and backend
-
Install MongoDB Community Edition
- Follow the official installation guide
-
Start MongoDB Service
# On macOS/Linux sudo systemctl start mongod # On Windows net start MongoDB
-
Verify Connection
mongo # or mongosh
The application uses JWT (JSON Web Tokens) for authentication and automatically creates a default admin user on first startup.
When you start the backend server for the first time, it will automatically create an admin user with the credentials specified in your .env
file:
ADMIN_EMAIL=admin@abroadease.com
ADMIN_PASSWORD=admin123
Console Output on First Run:
MongoDB connected
Default admin user created successfully!
Email: admin@abroadease.com
Password: admin123
Please change the password after first login!
- Change Default Credentials: For production, update the admin credentials in your
.env
file before starting the server - Change Password: Log in with the default credentials and immediately change the password through the profile page
- Environment Variables: Never commit
.env
files with production credentials to version control
Generate a secure random string for JWT_SECRET:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
If you prefer to create admin users manually:
// In MongoDB shell
db.users.updateOne(
{ email: "user@example.com" },
{ $set: { role: "admin" } }
)
The project uses Tailwind CSS with custom configurations:
cd web
npx tailwindcss init -p
The application uses custom CSS classes defined in web/src/index.css
:
.btn
- Primary button styles.btn-secondary
- Secondary button styles.input
- Form input styles.card
- Card container styles
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logout
GET /api/posts
- Get all posts with filteringGET /api/posts/:id
- Get single postPOST /api/posts
- Create post (admin only)PUT /api/posts/:id
- Update post (admin only)DELETE /api/posts/:id
- Delete post (admin only)
GET /api/bookmarks
- Get user bookmarksPOST /api/bookmarks
- Create bookmarkDELETE /api/bookmarks/:id
- Remove bookmark
GET /api/me
- Get current userPUT /api/me
- Update user profile
-
MongoDB Connection Error
Error: connect ECONNREFUSED 127.0.0.1:27017
Solution: Ensure MongoDB is running or check connection string
-
CORS Errors
Access to XMLHttpRequest blocked by CORS policy
Solution: Ensure backend CORS is properly configured
-
Module Not Found
Cannot resolve module 'xyz'
Solution: Run
npm install
in the respective directory -
Port Already in Use
EADDRINUSE: address already in use :::1617
Solution:
# Find and kill process using port lsof -ti:1617 | xargs kill -9
Verify your .env
file in the api
directory:
cd api
cat .env
If you encounter permission errors:
# Clear npm cache
npm cache clean --force
# Remove node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
-
Environment Variables
MONGODB_URI=<production-mongodb-uri> JWT_SECRET=<secure-jwt-secret> PORT=1617 NODE_ENV=production # Production Admin Credentials (CHANGE THESE!) ADMIN_EMAIL=your-admin@yourdomain.com ADMIN_PASSWORD=your-secure-password
-
Build Command
npm install --production npm start
-
Build for Production
cd web npm run build
-
Serve Static Files
- The
dist
folder contains the production build - Serve using Nginx, Apache, or any static file server
- The
Update API base URL for production in web/src/api/axios.js
:
baseURL: process.env.NODE_ENV === 'production'
? 'https://your-api-domain.com/api'
: 'http://localhost:1617/api'
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues:
- Check this README for common solutions
- Search existing issues in the repository
- Create a new issue with:
- Operating system
- Node.js version
- Error messages
- Steps to reproduce
Happy coding! π