Express.js Rest API application with authentication, email notifications, user management. The application is built with TypeScript, PostgreSQL, Sequelize ORM and Docker. Repository includes GitHub Actions for linting and testing the application with Postman and Chai.js.
- User authentication with email verification
- JWT authentication (with JWT tokens stored in the database for revoking on logout before expiration)
- User management (CRUD operations)
- User roles (admin, user)
- Configuration options and environment variables
- Postman collection (includes tests)
Configuration options are set in .env file. The majority of essential configuration options are available through environment variables. All configuration options are available in configs directory. Configuration options are documented in configuration.md.
All necessary components of the application are containerized with Docker. docker-compose.yml defines services for the application and docker-compose.override.yml extends the configuration for development with hot-reloading.
- Express.js application
- PostgreSQL database
- MailHog (email testing tool)
- Nginx (web server for serving static files and reverse proxy)
-
Install dependencies
npm --prefix app i
-
Run docker containers
docker-compose up
Scripts must be run from app
directory.
npm run dev
- run application in development modenpm run build
- build application (output inbuild
directory)npm run start
- run application in production mode frombuild
directorynpm run lint
- run lint and fix issuesnpm run eslint
- run lintnpm run test
- run Postman tests
app
- application source codesrc
- source codeconfigs
- configuration filescontrollers
- controllershelpers
- helper functionsmiddlewares
- middlewaresmodels
- modelsroutes
- routesapp.ts
- application
build
- build outputviews
- templatesapp.ts
- applicationindex.ts
- entry point
- TypeScript Documentation
- Express.js (Node.js web application framework)
- Sequelize (ORM)
- Postman
- Chai.js (assertion library for Postman tests)