Skip to content

Commit

Permalink
Merge pull request #20 from lowdefy/test-one
Browse files Browse the repository at this point in the history
chore: adjusted project structure and added README
  • Loading branch information
machielvdw authored Jan 16, 2024
2 parents 72ae644 + 80a9093 commit 5a8a124
Show file tree
Hide file tree
Showing 27 changed files with 5,791 additions and 1,515 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
**/.lowdefy/**
**/.serverless/**
**/.env
**/node_modules/**
**/dist/**
!lowdefy/.lowdefy/cli.json
**/coverage/**
/auth0/globalConfig.json
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Lowdefy
Copyright (c) 2024 Lowdefy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 🪪 Lowdefy Business Card Example

This Lowdefy example demonstrates a digital business card application integrating LinkedIn authentication and MongoDB for data storage. It utilizes the Auth.js LinkedIn provider and the MongoDB community plugin adapter for authentication, along with a custom plugin for QR code generation.

The user interface is designed to efficiently present personal and professional details, akin to a traditional business card, but in a digital format.

### 🗝️ Setting Up LinkedIn Authentication

To use this example, you'll first need to configure a LinkedIn application for authentication. Detailed instructions can be found:

- [Auth.js LinkedIn Provider Setup](https://next-auth.js.org/providers/linkedin)
- [LinkedIn Developer Portal](https://www.linkedin.com/developers/apps/)

## ⚙️ Running this example

- Create a MongoDB cluster and get a URI connection string:
- Create a free MongoDB database cluster hosted by [MongoDB Atlas](https://www.mongodb.com/try).
- In the main cluster view, click "connect", then "Connect you application". This will give a MongoDB URI connection string. Use the credentials you just created.
- You can read more about the [Lowdefy MongoDB connector](https://docs.lowdefy.com/MongoDB).
- Set up your Linkedin app.
- Clone this repository.
- Create a `.env` file in your project folder and set the following environment variables:

```.env
LOWDEFY_SECRET_MONGODB_URI = <MongoDB URI>
LOWDEFY_SECRET_LINKEDIN_CLIENT_ID = <Linkedin API Key>
LOWDEFY_SECRET_LINKEDIN_CLIENT_SECRET = <Linkedin Secret Key>
NEXTAUTH_SECRET = <Random auth signing secret>
NEXTAUTH_URL = http://localhost:3000
```

- In the command console, navigate to your project folder and run the Lowdefy CLI: `pnpx lowdefy@4 dev`.

## 🔗 More Lowdefy resources

- Getting started with Lowdefy - https://docs.lowdefy.com/tutorial-start
- Lowdefy docs - https://docs.lowdefy.com
- Lowdefy website - https://lowdefy.com
- Community forum - https://github.com/lowdefy/lowdefy/discussions
- Bug reports and feature requests - https://github.com/lowdefy/lowdefy/issues
- Discord - https://discord.gg/WmcJgXt

## ⚖️ Licence

[MIT](https://github.com/lowdefy/lowdefy-example-business-card/blob/main/LICENSE)
19 changes: 9 additions & 10 deletions app/lowdefy.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
lowdefy: 4.0.0-alpha.23
lowdefy: 4.0.1

config:
homePageId: home
theme:
lessVariables:
'@primary-color': '#438ef7'
'@border-radius-base': 6px
'@border-radius-sm': 4px
'@border-color-base': '#69c0ff'
'border-width-base': 2px

plugins:
- name: '@lowdefy/plugin-business-cards'
version: 'file:./plugins/plugin-business-cards'
version: 'workspace:*'
- name: '@lowdefy/community-plugin-mongodb'
version: '1.4.1'

auth:
theme:
Expand All @@ -23,7 +18,7 @@ auth:
profile: user.profile
adapter:
id: mdb_adapter
type: MongoDBAdapter
type: MultiAppMongoDBAdapter
properties:
databaseUri:
_secret: MONGODB_URI
Expand All @@ -35,6 +30,10 @@ auth:
_secret: LINKEDIN_CLIENT_ID
clientSecret:
_secret: LINKEDIN_CLIENT_SECRET
# authorization:
# params:
# scope: r_liteprofile

pages:
public:
- profile
Expand Down
2 changes: 1 addition & 1 deletion app/pages/home/home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _ref:
- '6px solid '
- _if_none:
- _var:
name: color
key: color
default:
_user: profile.color
- '#438ef7'
Expand Down
2 changes: 1 addition & 1 deletion app/pages/profile/components/profile_display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ blocks:
- '6px solid '
- _if_none:
- _var:
name: color
key: color
default:
_request: fetch_profile.0.color
- '#438ef7'
Expand Down
1 change: 0 additions & 1 deletion app/plugins/plugin-business-cards/dist/auth/adapters.js

This file was deleted.

163 changes: 0 additions & 163 deletions app/plugins/plugin-business-cards/dist/auth/adapters/MongoDBAdapter.js

This file was deleted.

21 changes: 0 additions & 21 deletions app/plugins/plugin-business-cards/dist/blocks/QRCode/QRCode.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/plugins/plugin-business-cards/dist/types.js

This file was deleted.

1 change: 0 additions & 1 deletion app/plugins/plugin-business-cards/src/auth/adapters.js

This file was deleted.

Loading

0 comments on commit 5a8a124

Please sign in to comment.