Skip to content

umluizlima/user-manager

Repository files navigation

user-manager

A service to manage user information and authentication.

Development

Requirements

Installing

Install dependencies

make install

Testing

make test

Running

Run the following commands to create a private/public key pair. It's required for encoding and decoding the JWT tokens:

openssl genrsa -out private.pem
openssl rsa -in private.pem -pubout -out public.pem

Then, create a .env file and place the keys there. It should look like this:

JWT_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAK..."
JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----
MIIBIjAN..."

After that you should be good to go:

make run

Access the API documentation on http://localhost:8001/docs

Migrating

Generate migration files automatically for changes to models. Make sure all models are imported on models/__init__.py

make db_generate_migration description="your description"

Deployment

Heroku

The app.json, Procfile, and runtime.txt files on this repository are specific for deployment on Heroku. It can be done by clicking the following button:

Deploy

The CloudAMQP add-on must be shared between this service and email-sender to ensure that the access code transactional gets sent.