A VueJS webapps with Node.js Express backend for managing listings with user authentication
- Tech Stack: VueJS, Tailwind CSS, Nodejs, Express, ES6 Javacript, MySQL, Sequelize ORM, Google Gemini
- Hosting: freesqldatabase, Vercel, Render
https://asessment-adv.vercel.app/
- might fail/slow first time login due to inactivity of free tier SQL server & backend instances, just be patient for backend instance to wake up
- login credentials refer end of readme
- committed .env value was only for testing, it’s long gone: expired and replaced
- Node.js (v18 or higher)
- MySQL database
- Google Gemini API key
- Navigate to the backend directory:
cd my-backend
- Install dependencies:
npm install
- Create environment file:
cp .env.example .env
- Configure your
.env
file with your database and API credentials:
DB_NAME=your_database_name
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=3306
PORT=3113
JWT_SECRET=your_jwt_secret_key
GOOGLE_GEMINI_API_KEY=your_google_gemini_api_key
- Run database migrations and seed data:
npx sequelize-cli db:migrate
npm run dev
The API will be available at http://localhost:3113
- Navigate to the frontend directory:
cd client-admin
- Install dependencies:
npm install
- Ensure local base URL is enabled as follow (in client_admin/source/services/api.js):
//const API_BASE_URL = `https://asessment-adv.onrender.com`
const API_BASE_URL = `http://localhost:3113`
- Run the UI application
npm run dev
POST /a/login
- Admin loginPOST /api/login
- Mobile API login
GET /listing
- Get all listings (admin only)GET /listing/o/:id
- Get listing by ID (protected route)POST /listing/create
- Create new listing (protected route)PUT /listing/update/:id
- Update listing (protected route)DELETE /listing/delete/:id
- Delete listing (protected route)GET /user/listings
- Get users list p(rotected route)
GET /api/listing
- Get user's listings (protected route)?description=true
- Include AI-generated descriptions (optional)?lat=X&long=Y
- Calculate distances from user location (optional)
- JWT-based authentication (protected route)
- Role-based access control (admin/user)
- Google Gemini API integration for place descriptions (optional via URL query)
- Distance calculation between coordinates (optional via URL query)
- Database migrations with Sequelize
- CORS enabled for frontend integration
Admin User:
- Username:
admin
- Password:
123456
Regular Users:
- Username:
test_user_01
/ Password:123456
- Username:
test_user_02
/ Password:123456
- Username:
test_user_03
/ Password:123456
- Username:
test_user_04
/ Password:123456
- Username:
test_user_05
/ Password:123456
*Note: These are default seeded credentials only. You may create on your on via register API.