This guide will help you set up and run the Node.js application along with PHPMyAdmin using Docker with the added convenience of a development container.
- Clone the repository:
git clone https://github.com/vitabletech/node-express-api-bootstrap.git
- Navigate to the project directory:
cd node-express-api-bootstrap
- Rename
.env_sample
to .env andEdit the.env
file to configure your environment variables. You may also need to adjust thedocker-compose.yml
file if you wish to use non-default settings.
- Start the Docker containers:
docker-compose up -d
-
Open your web browser and go to http://localhost:8081 to access PHPMyAdmin.
-
Create a new database named
testdb
as specified in the.env
file. If you made any changes to the database name, ensure to create it with the updated name. -
Access the container shell:
docker exec -it vitabletech-node-app /bin/bash
- Inside the container, run the following command to synchronize the database:
npm run sync-db && npm run seed
This command will automatically create the required tables.
-
Once the database synchronization is complete, you can start working on the application.
-
Access the Node.js application at http://localhost:8080.
You're all set up and ready to start working with the Node.js application. Happy coding!
This repository provides a Node.js application for demonstrating JWT authentication and authorization. It includes features such as user registration, user login, and authorization process. The application is built using Express.js, JWT for authentication, Sequelize ORM for database interactions, and MySQL for database storage.
- Bootstrap project for creating APIs using Express.js
- Pre-configured ESLint setup for code quality assurance
- Husky and commitlint integration for enforcing commit message conventions
- Unit test cases setup for ensuring code reliability
- Code coverage setup for measuring code quality
- Demonstrates JWT authentication and authorization
- Includes user registration and login functionality
- Utilizes Sequelize ORM for database interactions
- Supports MySQL for database storage