Coder Social home page Coder Social logo

brunodmartins / church-members-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 1.46 MB

A simple API to manage church's members

License: GNU General Public License v3.0

Go 91.77% Dockerfile 0.08% HCL 6.46% Shell 1.59% Makefile 0.10%
golang docker viper church-management church

church-members-api's Introduction

church-members-api ⛪️

Go codecov Go Report Card Deploy

A simple application to manage a church's members.

Features 💻

  • Member's control (register & search)
  • Member's report
    • Legal members (all except children)
    • All members (including children)
    • By classification
    • Birthdays list
    • Marriage list
  • Notification jobs
    • Weekly births through email
    • Dailly birthdays through SMS
  • i18n
    • Supports pt-BR and en-US

Libraries ⚙️

Deploy ✈️

The application was build upon a Docker image, but rely mostly on AWS resources to work. To deploy on AWS, simple configure a Terraform with some vars described bellow and run the script and it's all done!

AWS ☁️

The following resources are used on AWS

  • DynamoDB to store churchs, users and members information
  • S3 to store report files
  • Event Bridge to CRON the jobs
  • SNS to send notifications from jobs
  • ECR to store a private image of the application
  • Lambda to run the serverless application (both API and JOB)
  • API Gateway to provide a RESTfull interface and authorize access

GitHub Logo

Configuration 🛠

The following configuration are required through Terraform vars

Terraform var Environment variable Description
Hard coded on Terraform SERVER Used to define the environment where the application will run. Defaults to AWS
Hard coded on Terraform APPLICATION Used to defined the Lambda type: API or JOB
Terraform takes it from dynamo resource TABLE_MEMBER DynamoDB members table
Terraform takes it from dynamo resource TABLE_USER DynamoDB users table
Terraform takes it from dynamo resource TABLE_CHURCH DynamoDB churchs table
Terraform takes it from SNS resource REPORTS_TOPIC The topic to notify weekly jobs through email
Terraform takes it from S3 resource STORAGE The S3 bucket

Support ✉️

You can create a PR for it =)

church-members-api's People

Contributors

brunodmartins avatar dependabot[bot] avatar

Watchers

 avatar

church-members-api's Issues

Member edition

Members data change, thus, this API should support it.

A new endpoint should exist, allowing data to be modified. Contact, Address and Personal data should each have its own endpoint allowing the modification.

Contact interface

PUT /members/{id}/contact

Request should follow the current structure Contact struct , allowing the cellphone, phone and email to be modified.

Address interface

PUT /members/{id}/address

Request should follow the current structure Address struct.

Person interface

PUT /members/{id}/person

Request should allow the following modifications:

  • name (first and last)
  • birth date
  • marriage date + spouses name
  • children quantity

Run the application locally

Currently the application is not able to be executed locally, it requires a full connectivity with AWS resources.

It should be able to run locally, even without internet, abstracting most external components such as S3 and DynamoDB. Localstack shoud be an option

Members Anniversary as Calendar

Is your feature request related to a problem? Please describe.

Currently, anniversaries are sent as sms text messages to users that check the functionality

Describe the solution you'd like

A public calendar could be exported, and downloaded independently and used on any smartphone, relying entirely on an Offline app.

Describe alternatives you've considered

A public calendar server could be used to keep in sync always.

Additional context
Add any other context or screenshots about the feature request here.

Use VPC Endpoints

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Church module

Is your feature request related to a problem? Please describe.

Today, the application supports only membership related to a single church, managed by the environment variables.

Describe the solution you'd like

A church module could be added, allowing the application to support many church. Doing so, members and users would be associated to a Church.

Describe alternatives you've considered

Tasks required

Use semver and releases

Currently there is no version concepts, nor releases.

It would be wise to start generating versions based on the semver model.

  • Major releases providing new features with breaking changes on any interfaces
  • Minor releases providing new features without breaking changes on any interfaces
  • Patches releases contains internal changes, libraries upgrades etc.

Update Readme

Is your feature request related to a problem? Please describe.

After deprecating the Cognito, the README documentation was not updated

Describe the solution you'd like

The README must be updated to show the true state of the application

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Improve email template

Describe the solution you'd like
The weekly email should contain a minimal UX, providing a good HTML formatting. Despite that, an unsubscribe link should exist on it.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Church creation flow

How it works today

A manual script must be executed to create a church directly into the database.

How it should work

A new endpoint should exist, allowing the creation of a church. New fields should be required:

  • Church name
  • Church abbreviation (unique)
  • Address
  • Email
  • Admin username (unique)

After the validations are performed, the church must be inserted into the table, and a new user shall be created for it, using the admin username request. An email will be sent for the user requesting it to reset its password with a new one, and it will be ready for usage.

i18n per request

Is your feature request related to a problem? Please describe.

Translation is tied to an application environment, which leads to no scale well.

Describe the solution you'd like

Translation should be tied to the accept-language header, or the church configuration.

Describe alternatives you've considered

  • It should be created an middleware to load the i18n locator into the golang context.
  • The i18n service should use the locator inside the current context

Additional context
Add any other context or screenshots about the feature request here.

Reports saved on S3

Is your feature request related to a problem? Please describe.

Today, every time a user requests a report (legal or birthday lists, for example), the application runs a query on DynamoDB to extract all of its data. This process consumes RCU from the database without need.

The members table has much more reads then writes, thus, the data rarely changes. With organizations coming (#44), many church's could start using the API, making more unnecessary reads to the main table.

Describe the solution you'd like

This whole process could be a new endpoint, where the user generates a report that will be kept on a storage solution, like S3. A private bucket could contain all reports generated, allowing users to request a signed URL to download it on its personal devices or send to other church's members that need this information. The main advantage is the fact that the generated file will be kept on the storage, the disadvantaged is that the report could contain stale data (or even miss members) until someone regenerates it. I believe this must be accepted for the needs of having the church information at hands, not relying on the application!

Describe alternatives you've considered

A automated workflow could be created, generating the required reports every time a member is modified or added into the church.

Tasks required

Use a Email Service for notifications

Is your feature request related to a problem? Please describe.

Today the application is using a SNS topic to notify emails about weekly reports. This leads to a not so good email, having a generic subject from AWS, and also SNS email does not support a good HTML formatting

Describe the solution you'd like

A properly email service should be used to send emails. The application could leverage SES to do so.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Revamp IaC

Currently, Terraform scripts provide all the necessary infrastructure at AWS, plus, the initial deploy required to build the Lambda runtime. This lead to some problems that are not scaling:

  • It's not easy to create a new testing environment
  • Initial infrastructure creation requires an ECR with an image to create the Lambda. The ECR is also defined together within the script.
  • Resources names are hard coded, leading to the initial problem.

To solve that problems, it should be revamped as follows:

  • Extract ECR to a isolated shared module
  • Put all resources into a common module
  • Tag resources using application:{name} and environment:{value}
  • Import the current resources using the module, tagging as environment:production

Subscribe email confirmation

Upon creating a new user for the system (admin church user or common user), a confirmation email should be sent for the given email. The user shall have a status flag, requiring him to confirm the email to change it. After the email confirmation, the user should be authorized to access the system

  • Send email for the user
  • Modify user creation flow
  • Store confirmation link
  • Create endpoint to perform the confirmation operation
  • Modify login operation to allow only confirmed users

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.