A database for community. Keeping record of household within small community, events, memberships, etc..
|
|
| Easily search membership information within community | Visualize membership information |
| Category | Technology |
|---|---|
| Framework | Next.js |
| Frontend | React |
| Language | TypeScript |
| Database | MongoDB |
| Authentication | Better-Auth |
| Upload storage | uploadthing |
| Email handling | nodemailer |
| UI Component | HeroUI |
| CSS Processor | Tailwind CSS |
| Animation | Motion |
| Icons | Iconify |
# Create a .env.local file
# Replace the '...' value with appropriate values
cp .env .env.local
# Run the development server
yarn devOpen http://localhost:3000 with your browser to see the result.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
To start development server in HTTPS mode and HTTP/2 mode, refer to nginx/README.md. This project uses SSE (Server Sent Events) to perform graphQL subscription, using HTTP/1 would work as well, but with some restrictions.
The mongo DB must be configured with replication set:
-
stop mongo service:
brew services stop mongodb-community -
update mongo config
$(brew --prefix)/etc/mongod.conffile with replication props:systemLog: destination: file # Change /opt/homebrew/var to /usr/local/var (if on intel) path: /opt/homebrew/var/log/mongodb/mongo.log logAppend: true storage: # Change /opt/homebrew/var to /usr/local/var (if on intel) dbPath: /opt/homebrew/var/mongodb net: bindIp: 127.0.0.1 replication: replSetName: "rs0"
-
start mongo service:
brew services start mongodb-community -
while mongod is running, run
mongosh, then:rs.initiate({_id: 'rs0', members: [{_id: 0, host: '127.0.0.1:27017'}]}); -
if you need to apply new configuration, then:
rs.reconfig({_id: 'rs0', members: [{_id: 0, host: '127.0.0.1:27017'}]}, {force:true});
Whenever mongo schema prisma/schema.prisma is modified, you will need to run:
yarn update-prisma-dbThe screenshots are generated by running the playwright test tests/screenshot/landing.ts. The database is prepared by restoring from __fixtures__/db-screenshot.xlsx. You can optionally reseed the database by uncommentting the line:
await mongodbSeedRandom(10);This test is excluded from e2e test run, so it must be manually run to recreate the screenshots.
# On one terminal, start the dev server
yarn dev:playwright
# On another terminal, run the screenshot tests
yarn pw:screenshotMany app related logo files are generated via this command:
yarn gen-faviconNote: The Google OAuth consent screen also make use of the app logo, and should be updated accordingly if this is changed.
Emails are sent through nodemailer, and the content is defined in src/email/**.ts. The email content is generated using react-email.
To run the email viewer locally:
yarn email-evIn Azure Portal:
- create Resource Group
<group-name> - create Container Registry
<registry-name> - create App Service
<app-name>
Install Azure CLI:
brew update
brew install azure-cli
# Sign in to Azure
az login# clone git repository
# On windows box, it's important to keep the CRLF of the repository file
# because files like `docker/entrypoint.sh` need to have LF line ending (not CRLF)
git clone [email protected]:luumitech/community-db.git --config core.autocrlf=input
# To push a new image and tag it as `dev``
# Tagging an image with 'dev' will trigger a webhook to deploy the image into dev slot
./script/azure/build-image.sh --tag=dev# clone git repository
# On windows box, it's important to keep the CRLF of the repository file
# because files like `docker/entrypoint.sh` need to have LF line ending (not CRLF)
git clone [email protected]:luumitech/community-db.git --config core.autocrlf=input
# To push a new image and tag it as `main``
# Tagging an image with 'main' will trigger a webhook to deploy the image into main slot
./script/docker-hub/build-image.sh --tag=main