JordiBustos / express-starter

Starter code for an express app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express Starter Project

Welcome to the Express Starter Project! This project is designed to provide you with a solid foundation for building an Express.js site with pre-configured authentication/authorization processes with JWT, database models, and role-based access control.

This project follows the MVC pattern.

  • Redis for caching
  • express-session storage with RedisStorage
  • postgresql as database
  • bcrypt for hashing
  • jest for testing
  • socket.io.
  • Sequelize as ORM
  • swagger for API documentation // todo
  • Crypto with AES for encrypting data
  • JWT for authentication
  • Docker for containerization
  • node-cron for scheduling tasks

Installation

To get started, follow these steps:

Clone this repository to your local machine:

git clone https://github.com/JordiBustos/node-starter.git
cd node-starter
docker-compose build
docker-compose up

To run tests:

docker-compose -f docker-compose.dev.yml up

Environment Variables

Before running the application, make sure to set the following environment variables in a .env file at the root of the project:

DB_USER='postgres'
DB_HOST='db'
DB_NAME='db_name'
DB_PASSWORD='password'
DB_PORT=5432
PORT=3000
JWT_SECRET=1234
REDIS_URL='redis://redis:6379'
REDIS_DATABASES=16
REDIS_PASSWORD='password'
REDIS_HOST=redis
REDIS_PORT=6379
SESSION_SECRET=1234
ALLOWED_DOMAIN='http://localhost:3000'
NODE_ENV='development'

Contributing

If you encounter issues or have suggestions for improvement, feel free to open an issue or submit a pull request. Contributions are welcome!

License

This project is licensed under the MIT License.

About

Starter code for an express app

License:MIT License


Languages

Language:JavaScript 94.8%Language:HTML 3.7%Language:Dockerfile 1.3%Language:CSS 0.3%