Backend API of SpendLit app.
Using Node.js & Express.js as backend server
Passport.js for user authentication
MySQL as database, Swagger for API document
Deploy on GCP
- Demo: Test the APIs on Postman or Swagger, check the API document in below.
- API Document
- ERD
- User: register, login, profile edition.
- Account: manage personal account for record.
- Record: add expense and income record.
- [email protected], MySQL and MySQL Workbench(optional)
- Git
- Code edittor like VS Code (optional)
- Open your terminal cmd, PowerShell, etc.
- Clone from GitHub
git clone https://github.com/bensonybs/spendlitAPI.git
- Switch to the directory
cd spendlitAPI
- Install dependencies
npm install
- Create .env file and set environment variables
Check .env.example for more details. - Create new database on MySQL
Use MySQL Workbench or other tools to connect the database.
Run the SQL command in below:
CREATE DATABASE spendlit;
- Set database arguments
Modify config.json with your own MySQL username and password
"development": { "username": "<your username>", "password": "<your password>", "database": "ac_twitter_workspace", "host": "127.0.0.1", "dialect": "mysql" }
- Build table and seed data
Run the command in terminal:npx sequelize db:migrate npx sequelize db:seed:all
- Run the server
npm run start
- Check the API server on http://localhost:3000