Skip to content

Commit

Permalink
make template cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
vincanger committed Dec 14, 2023
1 parent 6e8fb18 commit b2f8fb4
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 331 deletions.
2 changes: 1 addition & 1 deletion app/.env.server.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GOOGLE_CLIENT_ID=722...
GOOGLE_CLIENT_SECRET=GOC...

# get your sendgrid api key at https://app.sendgrid.com/settings/api_keys
SENDGRID_API_KEY=
SENDGRID_API_KEY=test...
# if not explicitly set to true, emails will be logged to console but not actually sent during development
SEND_EMAILS_IN_DEVELOPMENT=false

Expand Down
18 changes: 9 additions & 9 deletions app/main.wasp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ app SaaSTemplate {
"<meta name='twitter:image:height' content='400' />",
"<meta name='twitter:card' content='summary_large_image' />",
// you can put your analytics scripts here
"<script defer data-domain='opensaas.sh' src='https://plausible.apps.twoducks.dev/js/script.js'></script>",
// plausible has script extension `script.local.js` for local development TODO: remove before deploying
"<script defer data-domain='opensaas.sh' src='https://plausible.apps.twoducks.dev/js/script.local.js'></script>",
"<script defer data-domain='<your-site-id>' src='https://plausible.io/js/script.js'></script>",
// plausible has script extension `script.local.js` for local development
"<script defer data-domain='<your-site-id>' src='https://plausible.io/js/script.local.js'></script>",
// google analytics only needs one script and will automatically detect if you are in dev mode
"<!-- Google tag (gtag.js) --><script async src='https://www.googletagmanager.com/gtag/js?id=G-H3LSJCK95H'></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-H3LSJCK95H');</script>"
"<!-- Google tag (gtag.js) --><script>...</script>"
],
// 🔐 Auth out of the box! https://wasp-lang.dev/docs/auth/overview
auth: {
Expand All @@ -33,7 +33,7 @@ app SaaSTemplate {
// fromField: {
// name: "Open SaaS App",
// // make sure this address is the same you registered your SendGrid or MailGun account with!
// email: "vince@wasp-lang.dev"
// email: "me@example.com"
// },
// emailVerification: {
// clientRoute: EmailVerificationRoute,
Expand All @@ -46,9 +46,9 @@ app SaaSTemplate {
// },
},
signup: {
additionalFields: import setAdminUsers from "@server/auth/setAdminUsers.js",
additionalFields: import setIsAdminViaEmailSignup from "@server/auth/setIsAdminViaEmailSignup.js",
},
onAuthFailedRedirectTo: "/",
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/gpt",
},
db: {
Expand All @@ -63,9 +63,9 @@ app SaaSTemplate {
emailSender: {
provider: SendGrid,
defaultFrom: {
name: "SaaS App",
name: "Open SaaS App",
// make sure this address is the same you registered your SendGrid or MailGun account with!
email: "vince@wasp-lang.dev" // TODO change to generic email before pushing to github
email: "me@example.com"
},
},
// add your dependencies here. the quickest way to find the latest version is `npm view <package-name> version`
Expand Down
113 changes: 0 additions & 113 deletions app/migrations/20231211161119_init/migration.sql

This file was deleted.

14 changes: 0 additions & 14 deletions app/migrations/20231211163814_username/migration.sql

This file was deleted.

3 changes: 0 additions & 3 deletions app/migrations/migration_lock.toml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/client/admin/components/TotalRevenueCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TotalRevenueCard = ({dailyStats, weeklyStats, isLoading}: DailyStatsProps)
if ( weeklyStats[1]?.totalRevenue === 0 || weeklyStats[0]?.totalRevenue === 0 ) return 0;

weeklyStats.sort((a, b) => b.id - a.id);
console.log('weeklyStats[1]?.totalRevenue; ', !!weeklyStats && weeklyStats)

const percentage = ((weeklyStats[0].totalRevenue - weeklyStats[1]?.totalRevenue) / weeklyStats[1]?.totalRevenue) * 100;
return Math.floor(percentage);
}, [weeklyStats]);
Expand Down
4 changes: 1 addition & 3 deletions app/src/client/app/GptPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function GptPage() {
const { data: user } = useAuth();

const onSubmit = async ({ instructions, command, temperature }: any) => {
console.log('user, ', !!user);

if (!user) {
alert('You must be logged in to use this feature.');
return;
Expand All @@ -19,7 +19,6 @@ export default function GptPage() {
const response = await generateGptResponse({ instructions, command, temperature });
if (response) {
setResponse(response.split('\n'));
console.log(response);
}
} catch (error: any) {
alert(error.message);
Expand Down Expand Up @@ -111,7 +110,6 @@ export default function GptPage() {
step='0.1'
{...register('temperature', {
onChange: (e) => {
console.log(e.target.value);
setTemperature(Number(e.target.value));
},
required: 'This is required',
Expand Down
7 changes: 2 additions & 5 deletions app/src/client/components/AppNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ export default function AppNavBar() {
</div>
<div className='hidden lg:flex lg:flex-1 lg:justify-end lg:align-end'>
{isUserLoading ? null : !user ? (
<a
href={!user ? '/login' : '/account'}
className='flex justify-end items-center text-sm font-semibold leading-6 '
>
<div className='duration-300 ease-in-out text-gray-900 hover:text-yellow-500'>
<a href={!user ? '/login' : '/account'} className='text-sm font-semibold leading-6 '>
<div className='flex justify-end items-center duration-300 ease-in-out text-gray-900 hover:text-yellow-500'>
Log in <BiLogIn size='1.1rem' className='ml-1 mt-[0.1rem]' />
</div>
</a>
Expand Down
Loading

0 comments on commit b2f8fb4

Please sign in to comment.