A NodeJS/Express API for handling user authentication, payments, and data management with Stripe and Stytch integration.
Before setting up the project, you need:
- Heroku account with PostgreSQL addon
- Stytch account (for authentication)
- Stripe account (for payments)
- Node.js (v14 or higher)
- Set up its client at
- Clone the repository.
git clone <repository-url>
cd endor-api
-
Install dependencies. '''bash npm install '''
-
Create a
.env
file in the api's root directory with the following variables:
Environment
ENV=development
Database
HEROKU_DEVELOPMENT_DB_HOST=your_db_host
HEROKU_DEVELOPMENT_DB_USER=your_db_user
HEROKU_DEVELOPMENT_DB_PASSWORD=your_db_password
HEROKU_DEVELOPMENT_DB_NAME=your_db_name
HEROKU_DEVELOPMENT_DB_PORT=5432
Server
PORT=4321
LOCAL_URL=http://localhost:4321
WEB_LOCAL_PORT=4321
Stytch (Test Environment)
STYTCH_TEST_PROJECT_ID=your_project_id
STYTCH_TEST_SECRET=your_secret
STYTCH_TEST_PUBLIC_TOKEN=your_public_token
Stripe
STRIPE_SECRET=your_stripe_secret
STRIPE_WEBHOOK_SECRET=your_webhook_secret
- Run database migration.
npx sequelize-cli db:migrate
- Start the development server.
npm run dev
- Initial release with core functionality
- Magic link authentication with Stytch
- Stripe payment integration
- API key generation and validation
- Customer data storage
-
Security
- Implement rate limiting
- Add request validation middleware
- Enhance error handling
- Add input sanitization
- Fix SSL rejectUnauthorized in database config
-
Code Quality
- Implement consistent error handling across controllers
- Add proper TypeScript support
- Add JSDoc comments to all functions
- Change instances of CustomerData and Intake to one or the other
-
Testing
- Add unit tests
- Add integration tests
- Set up CI pipeline with test automation
-
Documentation
- Add OpenAPI/Swagger documentation
- Add endpoint usage examples
-
Features
- Implement webhook retry mechanism
- Add user roles and permissions
- Add batch processing capabilities
- Enhance payment error handling
-
DevOps
- Add Docker support
- Set up automated deployments
- Add monitoring and alerting
- Implement proper logging system