Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5389f7f3a1 | ||
|
|
fa54ce8991 | ||
|
|
af22df803c | ||
|
|
3133af88ec | ||
|
|
7c3d3a4d04 | ||
|
|
0750ffae68 | ||
|
|
06e5d4c9e7 | ||
|
|
717739434a |
@ -11,15 +11,18 @@ import { AuthModule } from './auth/auth.module';
|
|||||||
import { MailModule } from "./mail/mail.module"
|
import { MailModule } from "./mail/mail.module"
|
||||||
import { MailerModule } from "@nest-modules/mailer"
|
import { MailerModule } from "@nest-modules/mailer"
|
||||||
|
|
||||||
|
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost/ohmyform'
|
||||||
|
const MAILER_URI = process.env.MAILER_URI || 'smtp://localhost:1025'
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
TypegooseModule.forRoot('mongodb://localhost/ohmyform', { useNewUrlParser: true }),
|
TypegooseModule.forRoot(MONGODB_URI, { useNewUrlParser: true }),
|
||||||
MongooseModule.forRoot('mongodb://localhost/ohmyform'),
|
MongooseModule.forRoot(MONGODB_URI),
|
||||||
TerminusModule.forRootAsync({
|
TerminusModule.forRootAsync({
|
||||||
useClass: TerminusOptionsService,
|
useClass: TerminusOptionsService,
|
||||||
}),
|
}),
|
||||||
MailerModule.forRoot({
|
MailerModule.forRoot({
|
||||||
transport: 'smtp://localhost:1025',
|
transport: MAILER_URI,
|
||||||
defaults: {
|
defaults: {
|
||||||
from:'"OhMyForm" <noreply@ohmyform.com>',
|
from:'"OhMyForm" <noreply@ohmyform.com>',
|
||||||
}
|
}
|
||||||
|
|||||||
13
api/src/user/services/init.service.ts
Normal file
13
api/src/user/services/init.service.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { Injectable, OnModuleInit } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class InitService implements OnModuleInit {
|
||||||
|
onModuleInit() {
|
||||||
|
if (!process.env.CREATE_ADMIN || process.env.CREATE_ADMIN.toUpperCase() === 'FALSE') {
|
||||||
|
console.log('SKIP INITIAL ADMIN USER CREATION')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO process user creation if ENV CREATE_ADMIN is set
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,10 @@
|
|||||||
import { UserService } from "./services/user.service"
|
import { UserService } from "./services/user.service"
|
||||||
import { UsernameAlreadyInUse } from "./validators/UsernameAlreadyInUse"
|
import { UsernameAlreadyInUse } from "./validators/UsernameAlreadyInUse"
|
||||||
import { EmailAlreadyInUse } from "./validators/EmailAlreadyInUse"
|
import { EmailAlreadyInUse } from "./validators/EmailAlreadyInUse"
|
||||||
|
import { InitService } from "./services/init.service"
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
InitService,
|
||||||
UserService,
|
UserService,
|
||||||
UsernameAlreadyInUse,
|
UsernameAlreadyInUse,
|
||||||
EmailAlreadyInUse,
|
EmailAlreadyInUse,
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
$accent: #fae596;
|
$accent: #fae596;
|
||||||
$primary: #3fb0ac;
|
$primary: #379A96;
|
||||||
|
|
||||||
|
$font-size-standard: 1rem;
|
||||||
|
$font-size-md: 1.25rem;
|
||||||
|
|
||||||
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
|
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
|
||||||
|
|
||||||
1html {
|
1html {
|
||||||
font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||||
Roboto, 'Helvetica Neue', Arial, sans-serif;
|
Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||||
font-size: 16px;
|
font-size: $font-size-standard;
|
||||||
word-spacing: 1px;
|
word-spacing: 1px;
|
||||||
-ms-text-size-adjust: 100%;
|
-ms-text-size-adjust: 100%;
|
||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
@ -36,6 +39,8 @@ $primary: #3fb0ac;
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: $primary;
|
background-color: $primary;
|
||||||
border-color: $primary;
|
border-color: $primary;
|
||||||
|
font-size: $font-size-md;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="screen bg-primary dark">
|
<div class="screen bg-primary dark">
|
||||||
<div class="content">
|
<main class="content">
|
||||||
<nuxt />
|
<nuxt />
|
||||||
</div>
|
</main>
|
||||||
|
|
||||||
<div class="footer">
|
<footer class="footer">
|
||||||
<nuxt-link to="/login">Login</nuxt-link>
|
<nuxt-link to="/login">Login</nuxt-link>
|
||||||
<nuxt-link to="/register">Register</nuxt-link>
|
<nuxt-link to="/register">Register</nuxt-link>
|
||||||
<nuxt-link to="/admin">Manage</nuxt-link>
|
<nuxt-link to="/admin">Manage</nuxt-link>
|
||||||
<a href="https://ohmyform.com">OhMyForm</a>
|
<a href="https://ohmyform.com">OhMyForm</a>
|
||||||
</div>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,9 @@ export default {
|
|||||||
*/
|
*/
|
||||||
head: {
|
head: {
|
||||||
title: pkg.name,
|
title: pkg.name,
|
||||||
|
htmlAttrs: {
|
||||||
|
lang: 'en-US'
|
||||||
|
},
|
||||||
meta: [
|
meta: [
|
||||||
{ charset: 'utf-8' },
|
{ charset: 'utf-8' },
|
||||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||||
|
|||||||
@ -1,21 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<h1 aria-label="Login">
|
||||||
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
|
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
|
||||||
|
</h1>
|
||||||
|
|
||||||
<b-form class="box" @submit.prevent="submit">
|
<b-form class="box" @submit.prevent="submit">
|
||||||
<b-form-group label-for="username">
|
<b-form-group>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="username"
|
id="username"
|
||||||
v-model="username"
|
v-model="username"
|
||||||
|
aria-label="Username"
|
||||||
trim
|
trim
|
||||||
placeholder="Username or Email"
|
placeholder="Username or Email"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<b-form-group label-for="password">
|
<b-form-group>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="password"
|
id="password"
|
||||||
v-model="password"
|
v-model="password"
|
||||||
|
aria-label="Password"
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
trim
|
trim
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<h1 aria-label="Recover Password">
|
||||||
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
|
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
|
||||||
|
</h1>
|
||||||
|
|
||||||
<b-form class="box" @submit.prevent="submit">
|
<b-form class="box" @submit.prevent="submit">
|
||||||
<b-form-group label-for="username">
|
<b-form-group>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="username"
|
id="username"
|
||||||
v-model="username"
|
v-model="username"
|
||||||
|
aria-label="Username"
|
||||||
trim
|
trim
|
||||||
placeholder="Username or Email"
|
placeholder="Username or Email"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
|
|||||||
@ -1,30 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<h1 aria-label="Register">
|
||||||
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
|
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
|
||||||
|
</h1>
|
||||||
|
|
||||||
<b-form class="box" @submit="submit">
|
<b-form class="box" @submit="submit">
|
||||||
<b-form-group label-for="username">
|
<b-form-group>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="username"
|
id="username"
|
||||||
v-model="username"
|
v-model="username"
|
||||||
|
aria-label="Username"
|
||||||
trim
|
trim
|
||||||
placeholder="Username"
|
placeholder="Username"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<b-form-group label-for="email">
|
<b-form-group>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="email"
|
id="email"
|
||||||
v-model="email"
|
v-model="email"
|
||||||
|
aria-label="Email"
|
||||||
trim
|
trim
|
||||||
placeholder="Email"
|
placeholder="Email"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<b-form-group label-for="password">
|
<b-form-group>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="password"
|
id="password"
|
||||||
v-model="password"
|
v-model="password"
|
||||||
|
aria-label="Password"
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
trim
|
trim
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user